PDA

View Full Version : [ubuntu] 9.10 doesn't boot with lvm



pierre_m47
November 3rd, 2009, 06:33 AM
Hi !

I installed ubuntu on my eeepc 1000H from karmic-dvd-i386.iso , but it won't boot.


I booted on the live DVD, installed lvm2, and then made the install.

I found my already existing lvm partitions. I already used them with ubuntu 9.04

I choose the partitionnement :

/dev/sda9 /
/dev/vg/usr /usr
/dev/vg/var /var


It worked all right, but on reboot, the system stops on :

/usr: waiting for /dev/mapper/vg-ubu_usr
/var: waiting for /dev/mapper/vg-ubu_var

and nothing happens, even after 5 minutes.


I tried the rescue shell.
Nothing in /dev/vg

vgchange is unknown.


I can mount these partitions from my debian system:

pier@eeesqueeze~% mount |grep ubu
/dev/mapper/vg-ubu_usr on /mnt/ubu_usr type ext3 (rw,noexec,nosuid,nodev,user=pier)
/dev/mapper/vg-ubu_var on /mnt/ubu_var type ext3 (rw,noexec,nosuid,nodev,user=pier)

pier@eeesqueeze~% ll /mnt/ubu_usr
total 160
drwxr-xr-x 2 root root 36864 nov 1 06:39 bin/
drwxr-xr-x 2 root root 4096 oct 28 22:53 games/
drwxr-xr-x 38 root root 4096 nov 1 06:38 include/
drwxr-xr-x 195 root root 65536 nov 1 06:39 lib/
drwxr-xr-x 10 root root 4096 oct 28 22:49 local/
drwx------ 2 root root 16384 nov 1 06:02 lost+found/
drwxr-xr-x 2 root root 12288 nov 1 06:40 sbin/
drwxr-xr-x 297 root root 12288 nov 1 06:39 share/
drwxrwsr-x 4 root src 4096 oct 28 23:00 src/


pier@eeesqueeze~% ll /mnt/ubu_var
total 68
drwxr-xr-x 2 root root 4096 oct 20 02:04 backups/
drwxr-xr-x 17 root root 4096 nov 1 06:22 cache/
drwxrwxrwt 2 root root 4096 oct 15 18:29 crash/
drwxr-xr-x 2 root root 4096 oct 28 22:56 games/
drwxr-xr-x 54 root root 4096 nov 1 06:38 lib/
drwxrwsr-x 2 root staff 4096 oct 20 02:04 local/
drwxrwxrwt 2 root root 4096 oct 20 02:04 lock/
drwxr-xr-x 13 root root 4096 nov 1 06:40 log/
drwx------ 2 root root 16384 nov 1 06:02 lost+found/
drwxrwsr-x 2 root mail 4096 oct 28 22:49 mail/
drwxr-xr-x 2 root root 4096 oct 28 22:49 opt/
drwxr-xr-x 7 root root 4096 oct 28 22:57 run/
drwxr-xr-x 6 root root 4096 oct 28 22:52 spool/
drwxrwxrwt 2 root root 4096 oct 20 02:04 tmp/



On installing the 9.04, I installed all in one partition, and then splitted the system. I can't do it
anymore because my /dev/sda9 partition has been resized and is now too small.

Hope you can give me a workaround.

Thanks in advance.

Pierre

shaggy999
November 3rd, 2009, 07:19 AM
It sounds like what you did was:

A) Install lvm2 in the *LIVE* environment
B) Installed the OS
C) Rebooted?

If so, you skipped a step between B and C:

You have to remount the target OS after installing, mount sys and proc onto it, then chroot into the new install and install lvm2 into the *INSTALLED* OS and change your /etc/fstab as necessary.

pierre_m47
November 3rd, 2009, 10:05 AM
> A) Install lvm2 in the *LIVE* environment
> B) Installed the OS
> C) Rebooted?

That's it.

> If so, you skipped a step between B and C:

> You have to remount the target OS after installing, mount sys and proc onto it, then chroot into the new > install and install lvm2 into the *INSTALLED* OS and change your /etc/fstab as necessary.

I suppose I have to :

# mount -o remount,rw /dev/sda9 /

but then, I don't know what to type.

Could you please explain further ?

pierre_m47
November 3rd, 2009, 04:14 PM
I looked around and tried:

# mkdir /sda9
# mount /dev/sda9 /sda9
root@ubuntu:/sda9# mount -o bind /sys /sda9/sys
root@ubuntu:/sda9# mount -o bind /proc /sda9/proc
root@ubuntu:/sda9# cd
root@ubuntu:~# chroot /sda9
bash: groups: command not found
bash: dircolors: command not found

but:
root@ubuntu:/# aptitude search lvm
bash: aptitude: command not found
root@ubuntu:/# mount
/dev/sda9 on / type ext3 (rw,relatime,errors=remount-ro,data=writeback)
/dev/mapper/vg-ubu_usr on /usr type ext3 (rw,relatime,errors=continue,data=writeback)
/dev/mapper/vg-ubu_var on /var type ext3 (rw,relatime,errors=continue,data=writeback)
/dev/loop0 on /cdrom type iso9660 (ro,noatime)
none on /proc type proc (rw,nosuid,nodev,noexec,relatime)
none on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
root@ubuntu:/# which dpkg
root@ubuntu:/# alias ll='ls -lF'
root@ubuntu:/# ll /usr/
total 0
root@ubuntu:/# mount /dev/vg/ubu_usr /usr
mount: special device /dev/vg/ubu_usr does not exist
root@ubuntu:/# mount /dev/mapper-vg/ubu_usr /usr
mount: special device /dev/mapper-vg/ubu_usr does not exist
root@ubuntu:/# ll /dev/vg
ls: cannot access /dev/vg: No such file or directory
root@ubuntu:/# ll /dev/mapper
ls: cannot access /dev/mapper: No such file or directory

:-(

shaggy999
November 8th, 2009, 01:48 AM
Is your entire system, including /boot directory on lvm? I don't think that's possible to have /boot on lvm.

Anyway, what you need to do is go back into a liveCD, update the package cache, re-install lvm (package name is 'lvm2') and use the utilities to mount the drives. I'm forgetting the exact commands for mounting lvm partitions, but you'll want to mount them to /target (create it, if it doesn't exist). Once you get that going you'll want to mount the root directory to target. Then mount any subdirectories on other partitions to the proper places (like /boot). Then you need to mount sys and proc to simulate a live system. Then install lvm2 and update grub/kernel.

Here's some commands I found that should help.



sudo apt-get update
sudo apt-get install lvm2
sudo pvscan
sudo vgchange -a y my_volume_group
sudo mkdir /target
sudo mount /dev/my_volume_group/my_logical_volume /target

#For below replace /dev/sda1 with whatever the /boot drive is if it's seperate
sudo mount /dev/sda1 /target/boot
sudo chroot /target
sudo mount -t proc proc /proc
sudo mount -t sysfs sys /sys
sudo apt-get install lvm2
sudo update-initramfs -k all -c
exit #Brings you back to CD environment
sudo umount /target/boot
sudo umount /target
#Something here to sync lvm drives?
sudo shutdown -r now


You may also need to edit your fstab and ensure that everything is pointed correctly. Hopefully the above helps you out.