public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: Unmounting and ejecting the root fs on shutdown.
@ 2001-03-01  3:33 Jeremy Jackson
  0 siblings, 0 replies; 12+ messages in thread
From: Jeremy Jackson @ 2001-03-01  3:33 UTC (permalink / raw)
  To: David Balazic, Per Erik Stendahl, linux-kernel


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)


^ permalink raw reply	[flat|nested] 12+ messages in thread
* RE: Unmounting and ejecting the root fs on shutdown.
@ 2001-03-01  8:47 Per Erik Stendahl
  2001-03-01 21:01 ` Jeremy Jackson
  0 siblings, 1 reply; 12+ messages in thread
From: Per Erik Stendahl @ 2001-03-01  8:47 UTC (permalink / raw)
  To: 'Jeremy Jackson'; +Cc: 'Linux Kernel'

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

^ permalink raw reply	[flat|nested] 12+ messages in thread
* RE: Unmounting and ejecting the root fs on shutdown.
@ 2001-02-28 18:07 David Balazic
  0 siblings, 0 replies; 12+ messages in thread
From: David Balazic @ 2001-02-28 18:07 UTC (permalink / raw)
  To: Per Erik Stendahl; +Cc: linux-kernel

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

-- 
David Balazic
--------------
"Be excellent to each other." - Bill & Ted
- - - - - - - - - - - - - - - - - - - - - -

^ permalink raw reply	[flat|nested] 12+ messages in thread
* RE: Unmounting and ejecting the root fs on shutdown.
@ 2001-02-28 16:12 Per Erik Stendahl
  2001-02-28 16:26 ` Mr. James W. Laferriere
  2001-02-28 16:37 ` Miquel van Smoorenburg
  0 siblings, 2 replies; 12+ messages in thread
From: Per Erik Stendahl @ 2001-02-28 16:12 UTC (permalink / raw)
  To: 'James A. Sutherland'; +Cc: 'Linux Kernel'


Oops, I almost missed this one. High-volume mailinglists... :-)

> > 	Hello Per ,  Has anyone gotten back to you on this subject ?
> > 	I as well am very interested in any information about releiving
> > 	this difficulty .  Tia ,  JimL
> >
> Such a CD would be very nice; one or two people do have this already,
> though. Have you tried using a ramdisk for root, and mounting 
> the CD as
> /usr?

Well, doing this on your own certainly will teach you a lot about
Linux I tell you. :-)

I still dont know how to make the kernel unlock and eject the CD on
shutdown. I haven't been able to pinpoint the shutdown sequence in
the kernel sources yet. :-)

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.

Mounting a ramdisk for / is doable (I think) but kludgy since you have
to symlink or mount so many subdirectories. Right now I only have /var
in a ramdisk (and why _WHY_ is /etc/mtab located in /etc and not
in /var??).

Anyways the CD works - and yes, being able to boot Linux w/o touching
the harddrives or the network is nice! :-) I might even put it on the
web once I get it cleaned up. Though the ISO is ~200 Mb.

Cheers
/Per Erik Stendahl

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Unmounting and ejecting the root fs on shutdown.
@ 2001-02-21  8:27 Per Erik Stendahl
  2001-02-28 14:32 ` Mr. James W. Laferriere
  0 siblings, 1 reply; 12+ messages in thread
From: Per Erik Stendahl @ 2001-02-21  8:27 UTC (permalink / raw)
  To: 'Linux Kernel'

Hi!

I'm putting together a maintenance/rescue CD. It's bootable with
RH6.2 (2.2.16) "installed" - ie the root fs is on the CD itself, no
harddrives involved. I've run across a slight inconvenience:
when I shutdown the CD is still locked in the drive. I have to power-off
then power-on again to get the CD out of the drive. Is there any way
I can get the kernel to unlock the CD and even possibly eject it
on shutdown? If kernel-hacking is required could somebody please
point to where it should be done? (I'm not very familiar with the
kernel-layout).

TIA,
Per Erik Stendahl

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2001-03-01 21:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-03-01  3:33 Unmounting and ejecting the root fs on shutdown Jeremy Jackson
  -- strict thread matches above, loose matches on Subject: below --
2001-03-01  8:47 Per Erik Stendahl
2001-03-01 21:01 ` Jeremy Jackson
2001-02-28 18:07 David Balazic
2001-02-28 16:12 Per Erik Stendahl
2001-02-28 16:26 ` Mr. James W. Laferriere
2001-02-28 16:37 ` Miquel van Smoorenburg
2001-02-21  8:27 Per Erik Stendahl
2001-02-28 14:32 ` Mr. James W. Laferriere
2001-02-28 15:29   ` James A. Sutherland
2001-02-28 15:56     ` Mr. James W. Laferriere
2001-02-28 18:06       ` James A. Sutherland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox