From: Friedrich L. <fl...@fl...> - 2004-05-08 15:37:40
|
Tim Tait wrote on 07.05.2004 04:48 MET: > > The current scripts have an issue when mounting the bootcd.iso file off > of a disk device. The disk is initially mounted under the initrd /mnt > point with rw access. When the /mnt/bootcd.iso is mounted followed by > the chroot, it then makes it it impossible to unmount the disk device > (now on /initrd/mnt) in pre_init, leaving it mounted read/write. I > couldn't find a perfect solution to this, but I think these changes help- > > mount_cdrom: > Remount the disk device ro before mounting the iso. Sure to reduce > filesystem corruption during reboots, less security issues. I also added > a output line to say what version of the bootcd.iso it found - useful if > there was more than one to find - hate to upgrade/downgrade > unintentionally.. > [...] > ------------------------------------------------------------------------ > > --- ./config/etc/initrd/mount_cdrom.old 2004-05-02 13:33:41.000000000 +0200 > +++ ./config/etc/initrd/mount_cdrom 2004-05-02 22:36:28.000000000 +0200 > @@ -26,6 +26,12 @@ > CDROM_SCSI=`find /dev/scsi/ -name "cd*" 2> /dev/null` > CDROMS="$CDROM_IDE $CDROM_SCSI" > > +if [ "$3" != "silent" ]; then > + $GREEN > + echo "Search list: $CDROMS" > + $NORMAL > +fi > + > for disk in $CDROMS > do > echo checking $disk > @@ -78,13 +84,20 @@ > $NORMAL > fi > if [ -e /mnt/bootcd.iso ] ; then > + # since this could be flash disk, lets make read-only. > + # Should not write to this mount anymore anyway. It > + # is attempted to umount it in pre_init but will fail > + # because bootcd.iso is still mounted inside it. > + # RO will make it less painfull. > + mount -o remount,ro,noatime $disk 2> /dev/null Why don't you change the original mount and add the options "ro,noatime" there? Just tried it with my local CD-Rom drive to make sure iso9660 accepts the "noatime" option. # mount /dev/cdrom /mnt/ -o ro,noatime # mount | grep /mnt /dev/sr0 on /mnt type iso9660 (ro,noatime) -- MfG / Regards Friedrich Lobenstock ____________________________________________________________________ Friedrich Lobenstock Linux Services Lobenstock URL: http://www.lsl.at/ Email: fl...@fl... ____________________________________________________________________ |