]>
git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/initscripts/init.d/checkfstab
2 ########################################################################
3 # Begin $rc_base/init.d/checkfstab
5 # Description : Check and repair fstab if the drivename has changed
7 # Authors : Arne Fitzenreiter - arne_f@ipfire.org
13 ########################################################################
20 boot_mesg
"Checking fstab rootdevice entry ..."
21 OLDROOT
=`cat /etc/fstab | grep " / " | cut -d" " -f1`;
22 NEWROOT
=`df | grep " /$" -m1 | cut -d" " -f1`;
23 OLDDRV
=${OLDROOT::`expr length $OLDROOT`-1}
24 NEWDRV
=${NEWROOT::`expr length $NEWROOT`-1}
25 if [ "$OLDROOT" == "$NEWROOT" ]; then
30 boot_mesg
"Warning! Rootdevice not match with fstab entry!"
32 boot_mesg
"Rootdevice: $NEWROOT"
33 boot_mesg
"fstab-entry: $OLDROOT"
35 boot_mesg
"Attempt to repair it ..."
37 sed -i -e "s|$OLDDRV|$NEWDRV|g" /etc
/fstab
39 sed -i -e "s|$OLDDRV|$NEWDRV|g" /boot
/grub
/grub.conf
45 echo "Usage: ${0} {start}"
50 # End $rc_base/init.d/checkfstab