Saturday, July 23, 2011

check grub menu.lst every shutdown

I have a strange problem: during the boot if I have UUID in my grub file for root the sys stops booting "waiting for root fs"
I sometimes forget to change after kernel update so I thought to solve it: 

I made a small script that changes the UUID into my device:

cp /boot/grub/menu.lst /boot/grub/menu.lst.old
cat  /boot/grub/menu.lst.old|sed -e s%UUID=[0-9,a-z,-]*%/dev/sda6%> /boot/grub/menu.lst.new
mv  /boot/grub/menu.lst.new  /boot/grub/menu.lst


then made it run every shutdown:
  • sudo cp checkGrub.sh /etc/init.d/
  • sudo ln -s /etc/init.d/checkGrub.sh /etc/rc0.d/K01checkGrub.sh
  • sudo ln -s /etc/init.d/checkGrub.sh /etc/rc6.d/K01checkGrub.sh

that's all 

ciao alex barchiesi

No comments:

Post a Comment