Re: Unmounting and ejecting the root fs on shutdown.

Jeremy Jackson (jerj@coplanar.net)
Wed, 28 Feb 2001 22:33:44 -0500


David Balazic wrote:

Per Erik Stendahl wrote :

> 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 )

Or run magicdev ;-)

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.

you seem to be into reading the source (tm) so hdparm's
might be a good place to look (if it doesn't just work like it
says above)

-
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/