WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: is it possible to eject source media safely after boot  (Read 2455 times)

Offline manit123

  • Sr. Member
  • ****
  • Posts: 315
is it possible to eject source media safely after boot
« on: October 23, 2015, 10:02:38 AM »
I like tiny core because of its small memory footprint and customisable modules.
Is there any kernel option or something which enables me to load OS , utilities , application etc. completely in RAM so that I can safely remove usb stick from which it booted while leaving the OS running.
Please suggest .
Here is my grub entry currently
Code: [Select]
title tinycore 6.3
root (hd0,1)
kernel /boot/vmlinuz63 waitusb=10 loop.max_loop=256 tce=UUID="611772c2-af11-4e27                                                                                      -93a0-245172ae2dea" lst=onboot63.lst mydata=tc-with-wifi
initrd /boot/core63.gz
My system has 2GB RAM .
Running stats .
Code: [Select]
tc@box:~$ free -m
             total         used         free       shared      buffers
Mem:          2015         1891          123            0          338
-/+ buffers:               1553          462
Swap:          496          187          308
Thanks.
« Last Edit: October 23, 2015, 10:34:48 AM by manit123 »

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: is it possible to eject source media safely after boot
« Reply #1 on: October 23, 2015, 11:04:54 AM »
Touch /etc/sysconfig/tcedir/copy2fs.flg
reboot
Try to umount /etc/sysconfig/tcedir
If successful, you can remove the media.

Offline manit123

  • Sr. Member
  • ****
  • Posts: 315
Re: is it possible to eject source media safely after boot
« Reply #2 on: October 26, 2015, 09:08:57 AM »
Code: [Select]
tc@box:~$ touch /etc/sysconfig/tcedir/copy2fs.flg
tc@box:~$ df
Filesystem                Size      Used Available Use% Mounted on
rootfs                    1.8G    340.8M      1.4G  19% /
tmpfs                  1007.6M         0   1007.6M   0% /dev/shm
/dev/sdb2                 4.8G      4.4G    176.4M  96% /mnt/sdb2
/dev/sda2                97.8G     43.3G     54.5G  44% /mnt/sda2
/dev/sdb1                10.0G      8.7G      1.3G  87% /mnt/sdb1
tc@box:~$ mount
rootfs on / type rootfs (rw,size=1857204k,nr_inodes=681933)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,mode=600,ptmxmode=000)
tmpfs on /dev/shm type tmpfs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
/dev/sdb2 on /mnt/sdb2 type ext2 (rw,relatime)
/dev/sda2 on /mnt/sda2 type fuseblk (rw,relatime,user_id=0,group_id=0,allow_othe                                                                                      r,blksize=4096)
/dev/sdb1 on /mnt/sdb1 type vfat (rw,noexec,relatime,fmask=0000,dmask=0000,allow                                                                                      _utime=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)

tc@box:~$ ls -al /etc/sysconfig/
total 40
drwxrwxr-x    2 root     staff          280 Oct 26 18:07 ./
drwxr-xr-x   10 root     root           720 Oct 26 18:12 ../
-rw-r--r--    1 root     root             6 Oct 26 18:07 Xserver
-rw-r--r--    1 root     root             2 Oct 26 18:07 backup
-rw-rw-r--    1 root     staff            9 Oct 26 18:07 backup_device
-rw-r--r--    1 root     root            13 Oct 26 18:07 desktop
-rw-r--r--    1 root     root             5 Oct 26 18:07 icons
-rw-r--r--    1 root     root            10 Oct 26 18:07 keymap
-rw-r--r--    1 root     root             7 Oct 26 18:07 language
-rw-r--r--    1 root     root            13 Oct 26 18:07 mydata
-rw-r--r--    1 root     root             0 Oct 26 18:07 newmodules
-rw-r--r--    1 root     root            13 May 30 15:24 ntpserver
lrwxrwxrwx    1 root     root             8 Oct 26 18:07 tcedir -> /tmp/tce/
-rw-r--r--    1 root     root             3 Oct 26 18:07 tcuser
I did not understand the purpose of unmount tcedir . it is not a mount point .

Offline manit123

  • Sr. Member
  • ****
  • Posts: 315
Re: is it possible to eject source media safely after boot
« Reply #3 on: October 26, 2015, 09:10:19 AM »
Code: [Select]
root@box:/home/tc# umount /etc/sysconfig/tcedir
umount: can't umount /etc/sysconfig/tcedir: Invalid argument
tc@box:~$ umount /etc/sysconfig/tcedir
umount: can't umount /etc/sysconfig/tcedir: Operation not permitted

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: is it possible to eject source media safely after boot
« Reply #4 on: October 26, 2015, 10:17:18 AM »
See where /etc/sysconfig/tcedir points.
Umount that directory.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14851
Re: is it possible to eject source media safely after boot
« Reply #5 on: October 26, 2015, 10:21:25 AM »
I just double-checked - using the apps gui to toggle copy2fs as the default and rebooting allowed to me to un-mount and remove the usb stick I booted from.

("sudo umount /mnt/sdb1" in my case)

Offline manit123

  • Sr. Member
  • ****
  • Posts: 315
Re: is it possible to eject source media safely after boot
« Reply #6 on: October 30, 2015, 05:08:47 AM »
i am able to unmount usb stick as juanito had said without unmounting /tmp/tce .

Question 1)Still , I can't understand how can somebody unmount a directory which does not appear in 'mount' command output .
Can you explain ?
Question 2) BTW ,I boot using an ext2 partition of my USB . What steps can I do to have good USB life ?

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: is it possible to eject source media safely after boot
« Reply #7 on: October 30, 2015, 05:37:25 AM »
1) I guess gerald_clark just didn't use the best wording. un-mounting the media which contains  /etc/sysconfig/tcedir  is probably what he meant.

2) Core doesn't write to the boot media except when downloading extensions or repacking the backup file, where the latter happens at every shutdown by default.
You can edit  ~/.profile and change
Code: [Select]
export BACKUP=1
to
Code: [Select]
export BACKUP=0
and then, after a reboot, only run Backup if necessary.
Download a copy and keep it handy: Core book ;)