1

Topic: Problems resizing ext4 partition

I'm having troubles resizing an EXT4 partition with GParted on Ubuntu 10.04 LTS. The drive I would like to resize is on a RAID 5 NAS connecting via iSCSI to the Ubuntu machine. I have emphasized the error message in the detailed job report below.

Any ideas about how to resize this partition without losing any data? Thanks!

GParted 0.5.1

Libparted 2.2
Grow /dev/sdb1 from 2.00 TiB to 4.99 TiB  00:05:48    ( ERROR )
         
calibrate /dev/sdb1  00:00:00    ( SUCCESS )
         
path: /dev/sdb1
start: 63
end: 4294961684
size: 4294961622 (2.00 TiB)
check file system on /dev/sdb1 for errors and (if possible) fix them  00:02:54    ( SUCCESS )
         
e2fsck -f -y -v /dev/sdb1
         
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

2733286 inodes used (2.04%)
13159 non-contiguous files (0.5%)
1142 non-contiguous directories (0.0%)
# of inodes with ind/dind/tind blocks: 0/0/0
Extent depth histogram: 2732520/752/2
481058963 blocks used (89.60%)
0 bad blocks
76 large files

2590194 regular files
143081 directories
0 character device files
0 block device files
0 fifos
0 links
2 symbolic links (2 fast symbolic links)
0 sockets
--------
2733277 files
e2fsck 1.41.11 (14-Mar-2010)
grow partition from 2.00 TiB to 4.99 TiB  00:00:00    ( ERROR )
         
old start: 63
old end: 4294961684
old size: 4294961622 (2.00 TiB)
check file system on /dev/sdb1 for errors and (if possible) fix them  00:02:54    ( SUCCESS )
         
e2fsck -f -y -v /dev/sdb1
         
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

2733286 inodes used (2.04%)
13159 non-contiguous files (0.5%)
1142 non-contiguous directories (0.0%)
# of inodes with ind/dind/tind blocks: 0/0/0
Extent depth histogram: 2732520/752/2
481058963 blocks used (89.60%)
0 bad blocks
76 large files

2590194 regular files
143081 directories
0 character device files
0 block device files
0 fifos
0 links
2 symbolic links (2 fast symbolic links)
0 sockets
--------
2733277 files
e2fsck 1.41.11 (14-Mar-2010)
grow file system to fill the partition  00:00:00    ( SUCCESS )
         
resize2fs /dev/sdb1
         
resize2fs 1.41.11 (14-Mar-2010)
The filesystem is already 536870202 blocks long. Nothing to do!

libparted messages    ( INFO )
         
partition length of 10715933277 sectors exceeds the msdos-partition-table-imposed maximum of 4294967295

========================================

2

Re: Problems resizing ext4 partition

Tinto wrote:

Grow /dev/sdb1 from 2.00 TiB to 4.99 TiB  00:05:48    ( ERROR )

<snip>

partition length of 10715933277 sectors exceeds the msdos-partition-table-imposed maximum of 4294967295

Any ideas about how to resize this partition without losing any data? Thanks!

Do you have an MSDOS partition table on this RAID?

If so then this is the limiting factor.  With a sector size of 512 bytes, the maximum size of an MSDOS partition is slightly less than 2 Terabytes.

3

Re: Problems resizing ext4 partition

Unfortunately it appears so! sad

Is there any way to somehow work around this problem without having to clear the entire drive? I can manage with three partitions, but one single partition in this case would be more elegant.

4

Re: Problems resizing ext4 partition

First I would recommend that you make a backup of all your data.

If you wish to have a single partition larger than 2 TiB, then you will need to use a GUID Partition Table (GPT).

Before trying to convert your partition table from MSDOS to GPT, you should make sure that your operating systems can boot from a GPT partition table.  If yes, then you might try the following steps:

Write down the starting and ending sectors of every partition using "fdisk -l -u".

Next you could try erasing the MSDOS partition table with "dd if=/dev/zero of=/path-to-your-raid bs=512 count=1".  Please note that this will zero out the first sector of the device and erase the existing MSDOS partition table.

Then create a new GPT partition table using gdisk and then recreate each of the partitions at the exact sector locations that you wrote down earlier.