Author Topic: Eject Tinycore boot cd  (Read 4591 times)

Offline limeblack

  • Jr. Member
  • **
  • Posts: 69
Eject Tinycore boot cd
« on: March 07, 2011, 12:51:37 PM »
How would I go about ejecting the tinycore linux cdrom through bash.

It is throughly documented that tc boots entirely to ram.  That's great for speed and allows you to rip the thumb drive out after boot, http://www.tinycorelinux.com/faq.html#arch.

Unfortunately I can't realistic 'rip' the cdrom out because the door won't open  ;D  

I have attempted forcing a umount -f and using sudo.
I can successfully umount the cdrom using the lazy command.
Code: [Select]
sudo umount -l /dev/hdc
Unfortunately afterwards I still can't eject the cd.
Code: [Select]
eject /dev/hdc
eject: /dev/hdc: Input/output error

I also tried using fuser -kf /dev/hdc to kill the processes using /dev/hdc but that kills tinycore :P

Does anyone have any ideas ???
Thanks
« Last Edit: March 07, 2011, 01:27:45 PM by limeblack »

Offline danielibarnes

  • Hero Member
  • *****
  • Posts: 548
Re: Eject Tinycore boot cd
« Reply #1 on: March 07, 2011, 02:15:21 PM »
what is the output of mount? I am able to duplicate your problem when I have extensions in a /tce directory of the CD. A lazy unmount will remove the drive from "mount" but the loop devices are still using the disc:

# mount
/dev/hdc on /mnt/hdc type iso9660 (ro,relatime)
/dev/loop0 on /tmp/tcloop/dropbear type squashfs (ro,relatime)
/dev/loop1 on /tmp/tcloop/syslinux type squashfs (ro,relatime)
# umount -l /dev/hdc
# mount
/dev/loop0 on /tmp/tcloop/dropbear type squashfs (ro,relatime)
/dev/loop1 on /tmp/tcloop/syslinux type squashfs (ro,relatime)
« Last Edit: March 07, 2011, 02:22:09 PM by danielibarnes »

Offline limeblack

  • Jr. Member
  • **
  • Posts: 69
Re: Eject Tinycore boot cd
« Reply #2 on: March 07, 2011, 03:10:59 PM »
Mount responds with the following.

Code: [Select]
rootfs on / type rootfs (rw,size=447456k,nr_inodes=111864)
tmpfs on / type tmpfs (rw,relatime,size=813176k)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
tmpfs on /dev/shm type tmpfs (rw,relatime)
/dev/hdc on /mnt/hdc type iso9660 (ro,relatime)
/dev/loop0 on /tmp/tcloop/kmaps type squashfs (ro,relatime)
/dev/sdf2 on /mnt/sdf2 type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)

Also you are right, about me having extensions on the cd.  It is a remastered tinycorelinux with kmaps for dvorak.  

Not sure if that helps.
« Last Edit: March 07, 2011, 03:36:04 PM by limeblack »

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Eject Tinycore boot cd
« Reply #3 on: March 07, 2011, 03:16:25 PM »
It is still mounted.

Offline limeblack

  • Jr. Member
  • **
  • Posts: 69
Re: Eject Tinycore boot cd
« Reply #4 on: March 07, 2011, 03:34:13 PM »
Yes it is still mounted.  :(

I'm trying to diagnose whats keeping it in, but I'm not really sure.
Code: [Select]
umount /dev/loop0
fuser -m /dev/hdc
and got the following response
Code: [Select]
627 662 913
I looked up the ps values using ps | grep num

flwm_topside
wbar -press -config /usr/local/tce.icons
aterm

Not really sure if that helps.
After doing the above I again tried to eject the cd.
Code: [Select]
umount -l /mnt/hdc
eject /mnt/hdc
eject: /mnt/hdc: Inappropriate ioctl for device

I feel closer, with the different error message.
« Last Edit: March 07, 2011, 03:47:56 PM by limeblack »

Offline limeblack

  • Jr. Member
  • **
  • Posts: 69
Re: Eject Tinycore boot cd
« Reply #5 on: March 07, 2011, 03:53:05 PM »
 ;D I have successfully ejected the cd!  Thanks!

Is there any where to determine the loop devices being used at the moment?
I would like to eject the cd at boot, and it appears I must umount and losetup -d /dev/loopX for every extension I have installed.  If that's true it would be nice to set up a for in loop or something so I don't have to edit the script for every extension I add.

Code: [Select]
umount /dev/loop0
losetup -d /dev/loop0
umount /dev/hdc/
eject /dev/hdc

« Last Edit: March 07, 2011, 04:03:38 PM by limeblack »

Offline danielibarnes

  • Hero Member
  • *****
  • Posts: 548
Re: Eject Tinycore boot cd
« Reply #6 on: March 07, 2011, 03:58:03 PM »
Quote
I have successfully ejected the cd!  Thanks!

Yes, but you also removed the kmaps extension by unmounting the loop device, or was that your intention? If not, you should copy the extension to ram before mounting with the copy2fs flag file.

Offline limeblack

  • Jr. Member
  • **
  • Posts: 69
Re: Eject Tinycore boot cd
« Reply #7 on: March 07, 2011, 04:10:49 PM »
I would like to keep the extension installed.
Though, I'm unsure what you mean ???
How would you successfully keep the extensions installed with the copy2fl file?

Offline danielibarnes

  • Hero Member
  • *****
  • Posts: 548
Re: Eject Tinycore boot cd
« Reply #8 on: March 07, 2011, 05:06:33 PM »
Sorry, I misspoke. The presence of a copy2fs.flg file in your tce directory will cause extensions to be copied into the root filesystem instead of being loop-mounted. Thus, you will be able to unmount and eject the CD after booting.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Eject Tinycore boot cd
« Reply #9 on: March 07, 2011, 05:58:34 PM »
There are ways to have extensions mounted from rootfs, e.g. from /opt/tce.
Search wiki for "remaster"  ;)
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline danielibarnes

  • Hero Member
  • *****
  • Posts: 548
Re: Eject Tinycore boot cd
« Reply #10 on: March 08, 2011, 08:14:01 AM »
or use my qremaster script to create an iso image.

Offline roberts

  • Administrator
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Eject Tinycore boot cd
« Reply #11 on: March 15, 2011, 04:45:24 PM »
The title of this topic and opening salvo is very misleading.
Quote
Unfortunately I can't realistic 'rip' the cdrom out because the door won't open

Booting Tiny Core from CD defaults to loading the OS into ram and the CD is easily ejected.

However, if one is using a remaster where one has, in particular, decided to mount extensions from this CD then of course, the CD is in use and cannot be unmounted.

Using a remaster should be disclosed.

10+ Years Contributing to Linux Open Source Projects.