1 (edited by thunderbirdje 2011-10-19 15:42:06)

Topic: Attemp to resize and move a partition fails

Dear,

I have basically two partitions: one windows partition and one linux partition (the other partitions). Because the first lacks space, and it is just a fresh install I was trying to shrink the linux partition (with pain in my heart) to 100GB, then move it further on the disc so that the space after my linux partition would be before it thereby able to extend the windows partition with the free unallocated space.

However, it fails with an error.

In short the operations applied are:
1) Move /dev/sda3 to the right and shrink it from 99.98 GiB to 99.98 GiB  00:35:13    ( ERROR )
2) Grow /dev/sda2 from 19.66 GiB to 43.11 GiB

I hope someone can help me because I can't delete the windows partition (I just installed my licensed TI-Nspired software needed for my university, and it is limited to two installs :s)

Thank you so far!

Gparted version 0.7.0 from Ubuntu 11.04 LiveCD

Details as suggested by gparted:

GParted 0.7.0 --enable-libparted-dmraid

Libparted 2.3

Move /dev/sda3 to the right and shrink it from 99.98 GiB to 99.98 GiB  00:35:13    ( ERROR )
       
calibrate /dev/sda3  00:00:00    ( SUCCESS )
       
path: /dev/sda3
start: 41441280
end: 251111423
size: 209670144 (99.98 GiB)
check file system on /dev/sda3 for errors and (if possible) fix them  00:00:41    ( SUCCESS )
       
e2fsck -f -y -v /dev/sda3
       
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

441083 inodes used (6.73%)
1442 non-contiguous files (0.3%)
940 non-contiguous directories (0.2%)
# of inodes with ind/dind/tind blocks: 0/0/0
Extent depth histogram: 398558/437
6052142 blocks used (23.09%)
0 bad blocks
1 large file

335674 regular files
47115 directories
57 character device files
25 block device files
0 fifos
750 links
58198 symbolic links (41991 fast symbolic links)
5 sockets
--------
441824 files
e2fsck 1.41.14 (22-Dec-2010)
shrink file system  00:00:03    ( SUCCESS )
       
resize2fs /dev/sda3 104834047K
       
Resizing the filesystem on /dev/sda3 to 26208511 (4k) blocks.
The filesystem on /dev/sda3 is now 26208511 blocks long.

resize2fs 1.41.14 (22-Dec-2010)
shrink partition from 99.98 GiB to 99.98 GiB  00:00:02    ( SUCCESS )
       
old start: 41441280
old end: 251111423
old size: 209670144 (99.98 GiB)
new start: 41441280
new end: 251109375
new size: 209668096 (99.98 GiB)
check file system on /dev/sda3 for errors and (if possible) fix them  00:00:37    ( SUCCESS )
       
e2fsck -f -y -v /dev/sda3
       
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

441083 inodes used (6.73%)
1442 non-contiguous files (0.3%)
940 non-contiguous directories (0.2%)
# of inodes with ind/dind/tind blocks: 0/0/0
Extent depth histogram: 398558/437
6052142 blocks used (23.09%)
0 bad blocks
1 large file

335674 regular files
47115 directories
57 character device files
25 block device files
0 fifos
750 links
58198 symbolic links (41991 fast symbolic links)
5 sockets
--------
441824 files
e2fsck 1.41.14 (22-Dec-2010)
grow file system to fill the partition  00:00:03    ( SUCCESS )
       
resize2fs /dev/sda3
       
Resizing the filesystem on /dev/sda3 to 26208512 (4k) blocks.
The filesystem on /dev/sda3 is now 26208512 blocks long.

resize2fs 1.41.14 (22-Dec-2010)
check file system on /dev/sda3 for errors and (if possible) fix them  00:00:37    ( SUCCESS )
       
e2fsck -f -y -v /dev/sda3
       
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

441083 inodes used (6.73%)
1442 non-contiguous files (0.3%)
940 non-contiguous directories (0.2%)
# of inodes with ind/dind/tind blocks: 0/0/0
Extent depth histogram: 398558/437
6052142 blocks used (23.09%)
0 bad blocks
1 large file

335674 regular files
47115 directories
57 character device files
25 block device files
0 fifos
750 links
58198 symbolic links (41991 fast symbolic links)
5 sockets
--------
441824 files
e2fsck 1.41.14 (22-Dec-2010)
grow partition from 99.98 GiB to 123.43 GiB  00:00:02    ( SUCCESS )
       
old start: 41441280
old end: 251109375
old size: 209668096 (99.98 GiB)
new start: 41441280
new end: 300292095
new size: 258850816 (123.43 GiB)
move file system to the right  00:33:06    ( ERROR )
       
perform read-only test  00:33:06    ( ERROR )
       
using internal algorithm
read 99.98 GiB
finding optimal block size
       
read 16.00 MiB using a block size of 2.00 MiB  00:00:01    ( SUCCESS )
       
16.00 MiB of 16.00 MiB read
0.842462 seconds
read 16.00 MiB using a block size of 4.00 MiB  00:00:01    ( SUCCESS )
       
16.00 MiB of 16.00 MiB read
0.80048 seconds
read 16.00 MiB using a block size of 8.00 MiB  00:00:00    ( SUCCESS )
       
16.00 MiB of 16.00 MiB read
0.661705 seconds
read 16.00 MiB using a block size of 16.00 MiB  00:00:01    ( SUCCESS )
       
16.00 MiB of 16.00 MiB read
0.636349 seconds
optimal block size is 16.00 MiB
read 99.92 GiB using a block size of 16.00 MiB  00:33:03    ( ERROR )
       
60.18 GiB of 99.92 GiB read
Error while reading block at sector 124737536
60.24 GiB (64685604864 B) read
rollback last change to the partition table  00:00:02    ( SUCCESS )
       
shrink partition from 123.43 GiB to 99.98 GiB  00:00:02    ( SUCCESS )
       
old start: 41441280
old end: 300292095
old size: 258850816 (123.43 GiB)
new start: 41441280
new end: 251109375
new size: 209668096 (99.98 GiB)
libparted messages    ( INFO )
       
Input/output error during read on /dev/sda
========================================

Grow /dev/sda2 from 19.66 GiB to 43.11 GiB
========================================

2

Re: Attemp to resize and move a partition fails

First the good news.  Since the error occurred when GParted was only reading (not moving or copying) the partition, all data should still be intact.

Now the bad news.  The following error

Error while reading block at sector 124737536

indicates a hardware problem.  This can be caused by a loose drive connection cable, or more often is due to a failing hard drive.

Drive manufacturers often provide drive testing software at their web sites.  Please note that this software often overwrites the drive so be sure to backup your data before running drive tests.

On another note, version 0.7.0 of GParted is quite old.  We highly recommend that you use the latest version (currently 0.9.1) which is also available as a bootable image (GParted-Live).

3 (edited by thunderbirdje 2011-10-20 11:41:14)

Re: Attemp to resize and move a partition fails

Thank you for the fast reply! A backup has been updated.

By now I have checked the connection of my drive which visually seems still good (it is a laptop). Based on your recommendation I searched for a testing program.

1) When reading out the SMART information everything is labeled 'healthy'.
2) I have also ran badblocks with the following output:

user@pc:~$ sudo badblocks -sv -b 512 /dev/sda
[sudo] password for user: 
Checking blocks 0 to 312581807
Checking for bad blocks (read-only test): 124740672one, 30:09 elapsed
124740688one, 31:03 elapsed
124740689one, 31:20 elapsed
124740690one, 31:39 elapsed
124740691one, 31:57 elapsed
124740692one, 32:14 elapsed
124740693one, 32:33 elapsed
124740694one, 32:51 elapsed
124740695one, 33:10 elapsed
done                                
Pass completed, 9 bad blocks found.

3) I have read (http://askubuntu.com/questions/21101/ho … sector-xxx) that you can run this command to mark de bad sectors as 'bad':

sudo dd if=<device-name> of=/dev/null bs=512 count=1 skip=<sector>

I am wondering if this command is safe to run? I mean obviously I will lose the data in that sector and should check regulary the drive to see if it isn't failing. But will it mark the sectors as 'bad' so they won't be used anymore by the system?

PS: downloaded the new gparted version, much more handy and fast live cd! Great work!

4

Re: Attemp to resize and move a partition fails

From reading the link you provided, it would appear that the user psusi suggests you use hdparm with some parameters to address the bad blocks.

5

Re: Attemp to resize and move a partition fails

gedakc wrote:

From reading the link you provided, it would appear that the user psusi suggests you use hdparm with some parameters to address the bad blocks.

I had to eventually reformat the whole drive. Because I needed a windows partition for some only windows programs for my university - such a pity -. The tool provided by my HD manufacturer (WD)  was only Windows based and could only handle the active windows partition.

Thank you for the help!