You are not logged in.

#1 2010-05-16 19:50:39

newbster
Member
Registered: 2009-10-02
Posts: 9

Corrupted root partition - a possible rescue?

Hello everyone, and thanks in advance for your help.

I have an Arch box which since a few hours ago contained also Ubuntu. Then I decided to increase the size of my Arch /home partition to solve a space issue, and since I didn't use Ubuntu anymore since I installed Arch, I thought I could remove the Ubuntu partitions to make some room for my /home.

So booted from an Ubuntu live cd and used gparted to remove the unwanted partitions. After the removal my partition table looked like this:

/dev/sda5  /
/dev/sda6  /boot
/dev/sda7  /home
/dev/sda8  /swap
/dev/sda9   /var
/dev/sda10 /tmp
/dev/sda11 /usr
/dev/sda12 /opt

All of the above partitions used by Arch.

Since the Ubuntu partitions were on the left of my Arch partitions, the / and /boot partitions had to be moved to the left in order for the /home partition to be grown.

So here's the problem: while moving the root partition the system froze. I had to reboot. Then, Grub wouldn't load Arch anymore, and obviously Ubuntu did no longer exist. I loaded the Ubuntu live CD again and checked the root partition via gparted, and found that it was corrupted and not even mountable.

And the question is: since all the other Arch partitions were left untouched, is there a possible way to reinstall only the needed files in the root partition?  Unfortunately, I didn't backup the partitions, so yes, I think I pretty much screwed it beyond repair, but I figure asking doesn't hurt.

So thanks again for any help, and I hope I didn't miss any obvious wiki page or something. And sorry for my bad english too.

Offline

#2 2010-05-17 03:28:44

frigaut
Member
From: Canberra, Australia
Registered: 2009-05-10
Posts: 215
Website

Re: Corrupted root partition - a possible rescue?

Why do you want to re-install only root? The answer is obvious for /home, but did you install stuff in /usr you want to preserve?


Archer since 03/2009 - AUR packages

Offline

#3 2010-05-17 04:07:13

toad
Member
From: if only I knew
Registered: 2008-12-22
Posts: 1,775
Website

Re: Corrupted root partition - a possible rescue?

Have you tried (not that it is likely to work, mind) fsck.ext4 (or whatever fs you have for /)?


never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::

Offline

#4 2010-05-17 04:19:48

chpln
Member
From: Australia
Registered: 2009-09-17
Posts: 361

Re: Corrupted root partition - a possible rescue?

I'd boot up a LiveCD and fsck the partition if you haven't already.

If you have no luck there.  I've not tried it, but I can't see any reason why you couldn't:
1) mkfs /dev/sda5 and mount it then unpack pacman and it's dependencies
2) mount /dev/sda9 ro (or under something other than /var to preserve it and point pacman to the path of the syncdb) and mount proc, sys and dev from the livecd.
3) chroot and 'pacman -S $(pacman -Qq)'
4) prune the contents of directories for which a mountpoint exists

Keep in mind that if you choose to go this way you could very well have two separate versions of packages installed (the latest under /, a previous version elsewhere).  Unless you confirm that all versions are identical to that which was installed previously, you're likely to run into trouble.

Unless you have a reason not to, I think it would be better to have all partitions on their correct mountpoint before reinstalling packages.

Offline

#5 2010-05-17 13:14:53

newbster
Member
Registered: 2009-10-02
Posts: 9

Re: Corrupted root partition - a possible rescue?

Thanks for your answers guys. I tried fsck.ext4 on the partition, here is the output

fsck from util-linux-ng 2.16
e2fsck 1.41.9 (22-Aug-2009)
Error reading block 23101440 (Invalid argument).  Ignore error<y>? yes

Force rewrite<y>? yes

Error writing block 23101440 (Invalid argument).  Ignore error<y>? yes

Superblock has an invalid journal (inode 8).
Clear<y>? yes

*** ext3 journal has been deleted - filesystem is now ext2 only ***

Superblock has_journal flag is clear, but a journal inode is present.
Clear<y>? yes

The filesystem size (according to the superblock) is 46142688 blocks
The physical size of the device is 2500107 blocks
Either the superblock or the partition table is likely to be corrupt!
Abort<y>? yes

@chpln
I will try doing what you said. I will post some feedback as soon as I can. Thanks again.

Offline

Board footer

Powered by FluxBB