Brigantia's LiveCD GParted screwed up my 800GB ext4 /home ;d
Hello there.
I tried to upgrade from my Dagda, but as the installation required 1400 MB in /var, whose partition has only 1 GB, I booted from Brigantia LiveCD, shrink my /home to be 1GiB shorter and... voilá! GParted did something wrong with my /home superblock and I can't mount it.
I'm using PartedMagic right now -- partedmagic.com
# e2fsck -vnf /dev/sda1
e2fsck 1.42.1 (17-Feb-2012)
The filesystem size (according to the superblock) is 241191675 blocks
The physical size of the device is 240667643 blocks
I'm trying this: http://gparted-forum.surf4.info/viewtopic.php?id=14393 but I'm having no success. Anyone?
I can use Testdisk to list the partition files.
Testdisk: analyze, quick search, "P" to list files. I can see my home and browse my files.
Found this too: http://linuxexpresso.wordpress.com/2010/03/31/repair-a-broken-ext4-superblock-in-ubuntu/
Update: right now I'm doing:
# fsck -b 32768 /dev/sda1
(checking for bad blocks... 48% done, 1h elapsed, 0/0/0 errors.)
# e2fsck -cfv /dev/sda1
I hope it'll fix it.
UPDATE (2012/04/18):
I sent an e-mail to Rod Smith from rodsbooks.com, he answered me. I'll try this, and come back soon.
_____________________________
> Hi, Rod Smith,
>
> firstly, thanks for GPT.
>
> I have the same problem soupcan solved here:
> http://gparted-forum.surf4.info/viewtopic.php?pid=23573#p23573 -- though,
> I'm using GPT, and I find no option in gdisk which would permit me to edit
> the partition table like he did with fdisk (I get only binary data in the
> output file with "b" command). I need to resize my partition to what it
> was before I shrunk it with buggy GParted. I found nothing in recovery and
> transformation which could help me with this. What could I do?
If I understand correctly, your filesystem is too big for the partition
that contains it. If this is correct, you can delete the partition in
gdisk and then create a new one in its place that's the proper size. You
must be VERY CAREFUL that the new partition has EXACTLY the same START
POINT as the original. The end point is less critical, so long as it's
as large as or larger than the filesystem the partition contains. If
your current partitions aren't aligned to 1 MiB boundaries, you might
need to adjust gdisk's alignment policy (via "l" on the experts' menu)
to get the partition's start point set the way it should be.
Note that if any filesystems on the disk you're modifying are currently
mounted, you may need to reboot before Linux will "see" the changes.
I recommend you save the binary partition table backup and the output of
the "p" command in gdisk to a removable disk before you do anything.
This will provide you with a way to restore to your current state if
something goes wrong.
--
Rod Smith
_____________________________
IT WORKED! I did like Rod said. Many thanks to him, and to #parabola@freenode guys, especially alfplayer, who found the most useful and helpful URLs.
That's what I needed to do, after backing up my partition table with option "b" in gdisk:
$ sudo gdisk /dev/sda
1. Command "d" to delete the partition I wanted to delete, "1" was its number.
2. Command "x" to go to the expert mode.
3. Command "l" to set gdisk's alignment police, I set "1" because my /home's first sector was 34 and I didn't want to calculate its sub-divisors...
4. Command "m" to go back to the main menu.
5. Command "n" to create a new partition, with the values gdisk recommended since they matched my necessities.
6. Command "w" to write the partition table and exit.
Fortunately, I didn't lost any data.
Also, after upgrading to Brigantia, which I'm doing right now, I'll test Brigantia LiveCD's GParted in an empty HD and try to reproduce the failure. If I have success, I'll file a bug. BTW, I know that failure was mainly my fault, since I knew I should do it in the next day (I was sleepy) and by other means. Trisquel is really great, thanks to quidam (Rubén) for it and for the great work!