Fiasco trying to upgrade fs from ext3 to ext4

It was afternoon when I tried my hands on trying to upgrade my filesysten from ext3 to ext4. I referred to :

http://ext4.wiki.kernel.org/index.php/Ext4_Howto#Converting_an_ext3_filesystem_to_ext4

As mentioned… I did the following :

# tune2fs -O extents,uninit_bg,dir_index /dev/VolGroup00/LogVol00

# e2fsck -fD /dev/VolGroup00/LogVol00

After quite some time, the procedure finally completed. I was so delighted that I did a sytem reboot to find that my system won’t boot. The reason, I didn’t update my kernel ramdisk image, and it tried to mount the / partition as ext3 and failed as the partition has already become ext4. What I forgot to do was :

#mv /boot/initrd-‘uname -r’.img /boot/initrd-‘uname -r’.img.bak

// this is to keep a backup of the existing initrd image

#mkinitrd -v –with=ext4 /boot/initrd-‘uname -r’.img ‘uname -r’

Also the following line in /etc/fstab :

UUID=fd296dfc-e7b3-4dc9-adf9-0038631d9c1f /                       ext3    defaults        1 1

needed to be updated as :

UUID=fd296dfc-e7b3-4dc9-adf9-0038631d9c1f /                       ext4    defaults        1 1

But, I was a bit hasty. I tried to correct this issue. I booted my system from the F11-Beta installed in my pocket hard drive. I learnt how to mount an LVM partition:

#vgchange -ay

#mount /dev/VolGroup00/LogVol00 <mount point>

I tried updating the initrd images in the mounted LVM partition to find that the kernel modules for the particular kernel version of the initrd image was not found. As F11-Beta was running on a newer kernel. Tried to update the initrd images on other similar system as mine, copied the respective files in /boot and pasted it in my /boot folder and I tried to boot. It didn’t boot and gave an error message saying :

cannot mount /dev/root to /sysroot

Any suggestions?

Resolved Kernel boot problem :D

I am using Fedora 10 and I was running the kernel 2.6.27.15-170.2.24.fc10.i686 and I was happy until I did a ‘yum update’. My kernel got updated to kernel 2.6.27.19-170.2.35.fc10.i686, and then the system won’t boot the latest kernel. While booting it gave a mesage :

Unable to access resume device (/dev/dm-1)

mount : could not find filesystem ‘/dev/root’

I wondered what had happened? But, the old kernel 2.6.27.15-170.2.24.fc10.i686 seemed to work perfectly. I became fanatic to resolve this issue. I did some googling, and finally came to know that the issue was with /etc/fstab and my Fedora 10 being installed on LVM. Here is my previous fstab details :

# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>

tmpfs    /dev/shm    tmpfs    defaults    0    0
devpts    /dev/pts    devpts    gid=5,mode=620    0    0
sysfs    /sys    sysfs    defaults    0    0
proc    /proc    proc    defaults    0    0
/dev/dm-0    /    ext3    defaults    1    1
#Entry for /dev/sda7 :
UUID=3bb42530-5757-4f5a-9c10-16580ee6994a    /boot    ext3    defaults    1    2
#Entry for /dev/sda5 :
UUID=08563C60563C50A4    /media/Personal_Data    ntfs-3g    defaults,locale=en_US.UTF-8    0    0
#Entry for /dev/sda2 :
UUID=FCB60995B6095196    /media/c:    ntfs-3g    defaults,locale=en_US.UTF-8    0    0
/dev/dm-1    swap    swap    defaults    0    0

But there were no /dev/dm-0 and /dev/dm-1 in /dev/ folder. The solution was to replace dm-0 by VolGroup00/LogVol00 and dm-1 by VolGroup00/LogVol01. Actually in LVM, the root is denoted by /dev/VolGroup00/LogVol00 and swap by /dev/VolGroup00/LogVol01. I made the necessary changes. Now, /etc/fstab looks like this:

NOTE : For the following steps, root access will be required, do ‘su -‘ first.

# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>

tmpfs    /dev/shm    tmpfs    defaults    0    0
devpts    /dev/pts    devpts    gid=5,mode=620    0    0
sysfs    /sys    sysfs    defaults    0    0
proc    /proc    proc    defaults    0    0
/dev/VolGroup00/LogVol00    /    ext3    defaults    1    1
#Entry for /dev/sda7 :
UUID=3bb42530-5757-4f5a-9c10-16580ee6994a    /boot    ext3    defaults    1    2
#Entry for /dev/sda5 :
UUID=08563C60563C50A4    /media/Personal_Data    ntfs-3g    defaults,locale=en_US.UTF-8    0    0
#Entry for /dev/sda2 :
UUID=FCB60995B6095196    /media/c:    ntfs-3g    defaults,locale=en_US.UTF-8    0    0
/dev/VolGroup00/LogVol01    swap    swap    defaults    0    0

Now I just needed to create initial ramdisk images for preloading modules. So I did :

mkinitrd -f -v /boot/initrd-2.6.27.19-170.2.35.fc10.i686.img 2.6.27.19-170.2.35.fc10.i686

and also for the previous kernel

mkinitrd -f -v /boot/initrd-2.6.27.15-170.2.24.fc10.i686.img 2.6.27.15-170.2.24.fc10.i686

Then I did a reboot, and booting with the kernels (2.6.27.19-170.2.35 and 2.6.27.15-170.2.24) were as smooth as before.

That was all.

Thank you

Regards

rtnpro