3

LVM mount with Ubuntu upgrade

Posted by sanjay on 11:30 PM

Yesterday, I updated .. Ok, attempted to update my Ubuntu 5 system to Ubuntu 6. Everything seemed to go alright, until I had to reboot. Suddenly my system was hosed...Well, I could surely go to the backup copy I had, right? Nopes.. was taking a risk after reading about the smoothness of the Ubuntu dist-upgrade procedure.. Ouch.. that skipped back-up does hurt.

Anyway, today, I booted with the Live Ubuntu 6.06 disc and tried hard to get to my data on my logical volume. I remembered my disk looked like this before the upgrade

/boot 250 MB ext3 /dev/sda1
/ 65 GB reiserfs /dev/sda5 (LVM)

Yes, I now know that it is a BAD idea, but you learn by mistakes. Anyway, just that knowledge was useful. After a lot of reading up on lvm*, pv*, etc.. I am able to access my data with the following commands

sudo pvscan
PV /dev/sda5 VG Ubuntu lvm2 [x.y GB/0 free]

# load device module
modprobe dm-mod

#change logical volumes to active
sudo vgchange -a y

#create mount point
sudo mkdir /mnt/newroot

#list devices for VG ubuntu
sudo ls /dev/Ubuntu
root swap_1

# I want to mount root -- that's where my data is
# remember that it is reiserfs
# I just realized that I also had a swap partition under my logical volume!
sudo mount -t reiserfs /dev/Ubuntu/root /mnt/newroot/

cd /mnt/newroot
cd my_data_dir
ls -al

Wow!! everything is here .. back it up ... fast!! :)





3 Comments


Well.. the results are mixed. I could get my most important data (photos), but I noticed some files are unreadable.. Do not know why!


Phew! .. that was me panicking. It turns out that it was just a premissions issue

sudo chmod -R +r+x /mnt/newroot/my_data_directory/.*

sudo chmod -R +r+x /mnt/newroot/my_data_directory/*


fixed that. Now I have all my data!! and am wondering what's the best filesystem to use for my going-to-be-newly-formatted disk.

Anonymous says:

Ubuntu is great and Dapper Drake makes it even better!

I upgraded to Dapper and was pleasantly surprised to find that my system is much more responsive than with Breezy. Firefox seems especially snappier. I really like the new GNOME deskbar applet too.

Copyright © 2009 Note my web All rights reserved. Theme by Laptop Geek. | Bloggerized by FalconHive.