mar 102015
 

Knepig rubrik till detta inlägg, men följande har jag råkat ut för.

Ett antal servrar var uppsatta att boota från lvm med bara en pv. Allt fungerade bra tills man la till ytterligare en pv i vg.

Boot avbröts med bl.a. följande meddelande:

gave up waiting for root device. Common problems: boot args ( cat 
/proc/cmdline ) 
check rootdelay= (did the system wait long enough?) 
check root=(did the system wait for the right device? 
Missing modules (cat /proc/modules; ls /dev) 
ALERT! /dev/disk/<> does not exist.
Dropping to a shell!

Efter detta hamnar man i BusyBox.

Snabbaste sättet att få igång servern är då att starta lvm och sedan köra kommandot vgchange -ay.

Så här:

lvm> vgchange -ay
  3 logical volume(s) in volume group "vg0" now active
lvm>

Efter detta kan man avsluta lvm och BusyBox. Då bootar servern upp utan problem. Tyvärr blir det samma visa efter omstart.
Problemet finns i grubs device.map.

root@server:/# cat /boot/grub/device.map
(hd0)   /dev/sda

/dev/sdb/ saknas.

Provade update-grub

root@server:~# update-grub
Generating grub.cfg ...
/usr/sbin/grub-probe: error: Couldn't find PV pv1. Check your device.map.
Found linux image: /boot/vmlinuz-3.2.0-4-amd64
Found initrd image: /boot/initrd.img-3.2.0-4-amd64
/usr/sbin/grub-probe: error: Couldn't find PV pv1. Check your device.map.
/usr/sbin/grub-probe: error: Couldn't find PV pv1. Check your device.map.
/usr/sbin/grub-probe: error: Couldn't find PV pv1. Check your device.map.

Det gick inget vidare. Tricket är att skapa en ny/korrekt device.map. Till hjälp finns grub-mkdevicemap.

root@server:~# grub-mkdevicemap

Efter det kör man update-grub igen.

Om vi nu kikar på device.map igen så ser den ut så här:

root@server:/# cat /boot/grub/device.map
(hd0)   /dev/sda
(hd1)   /dev/sdb

Då gör vi ett nytt försök med update-grub.

root@nwtfront02:~# update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-4-amd64
Found initrd image: /boot/initrd.img-3.2.0-4-amd64
Done

Sedan är det ok att starta om.

 Posted by at 15:56

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)