RE: Unmounting and ejecting the root fs on shutdown.

Per Erik Stendahl (PerErik@onedial.se)
Thu, 1 Mar 2001 09:47:51 +0100


> > What I do know now is how to make the kernel not lock the
> CD in the
> > first place. Simply ioctl(/dev/cdrom,
> CDROM_CLEAR_OPTIONS, CDO_LOCK)
>
> > from /linuxrc in the initrd. This way I can remove the CD anytime
> > I please which is enough for me. And I dont have to patch the
> kernel.
>
> Or : echo 0 > /proc/sys/dev/cdrom/lock
> ( I am not sure if this is the right filename )

Nah, that looks too easy! ;-)

> This might save everyone some pain:
> from hdparm(8) man page (mine has some format
> bugs, but you get the picture)
>
> -L Set the drive's doorlock flag. Setting this to
> will lock the door mechanism of some removeable
> hard drives (eg. Syquest, ZIP, Jazz..), and setting
> it to maintains the door locking mechanism automat­
> ically, depending on drive usage (locked whenever a
> filesystem is mounted). But on system shutdown,
> this can be a nuisance if the root partition is on
> a removeable disk, since the root partition is left
> mounted (read-only) after shutdown. So, by using
> this command to unlock the door -b after the root
> filesystem is remounted read-only, one can then
> remove the cartridge from the drive after shutdown.

Is it true that the root fs is left mounted read-only? What is the
rationale behind this? It seems to me that it would be better to
completely unmount it and do whatever cleaning up is required (like
cdrom_release()?). But I've been known to miss important issues before!
:-)

BTW, what would be the best way to determine which devices are cdrom
devices? Looks like /proc/sys/dev/cdrom/info could be of use but what
happens on a computer with more than one cdrom device?

Cheers
/Per Erik Stendahl
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/