WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Remove media after Netbooting  (Read 7743 times)

Offline Zendrael

  • Sr. Member
  • ****
  • Posts: 363
    • Zendrael's home of projects
Remove media after Netbooting
« on: March 08, 2013, 02:04:20 PM »
Hello all!

Let's say I have Core installed on a USB stick (pendrive, flashdrive....) working as a server for other machines to netboot looking for this machine.

Is it possible to, after booting the server, remove the pendrive where it is installed on?

The other machines will boot up if the server system is running only on RAM?

This is a particular project to teach children/teenagers how to work with Linux and other Open Source tools, even playing with the server. So, I need that every time I boot the server, it will be fresh to play another day.

What do you think about it? Possible? How the best way?

Thanks!


Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11624
Re: Remove media after Netbooting
« Reply #1 on: March 08, 2013, 02:12:10 PM »
Hi Zendrael
To do that you have to make sure nothing on the pen drive gets mounted to the system. So you can't have a
persistent /home or /opt on the pen drive. You also need to make sure extensions on the drive get copied
to the machine, maybe using copy2fs.

Offline Zendrael

  • Sr. Member
  • ****
  • Posts: 363
    • Zendrael's home of projects
Re: Remove media after Netbooting
« Reply #2 on: March 08, 2013, 02:23:22 PM »
Hey Rich!

I am thinking this way:
- Install Core on pendrive
- setup everything I need, download extensions, change whatever I need...
- get all setup scripts, config files and home dirs persistent trought mydata.tgz

The boot time on the server may be a little slow but, I will not have OnDemand extensions, neither SCM apps. All apps that I need (and the others will need) will be mounted the usual way on OnBoot.

I found only 2 occurences of copy2fs in the wiki. Any example avaiable?

Thanks for the fast response!

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Remove media after Netbooting
« Reply #3 on: March 08, 2013, 02:38:11 PM »
You cannot remove the drive if it has apps mounted.
Use
Apps->Install Options->Toggle Default  Install to Filesystem Flag
and verify that the copy2fs file exists
or;
touch /etc/sysconfig/tcedir/copy2fs

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11624
Re: Remove media after Netbooting
« Reply #4 on: March 08, 2013, 02:40:42 PM »
Hi Zendrael
Create an empty file called  copy2fs.flg:
Code: [Select]
touch /mnt/YourPenDrive/tce/copy2fs.flgThe search page will return more results for  copy2fs.flg  if you need them.
When you think you have it set up correctly, try unmounting the drive. If it says it's busy, you're not there yet.

Offline Zendrael

  • Sr. Member
  • ****
  • Posts: 363
    • Zendrael's home of projects
Re: Remove media after Netbooting
« Reply #5 on: March 08, 2013, 02:46:22 PM »
Thanks Rich and Gerald_Clark!

I will do some tests then I return to this thread!

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Remove media after Netbooting
« Reply #6 on: March 08, 2013, 03:44:09 PM »
tc-terminal-server will work in this case, too, as it copies the kernel and initrd to ram. So you can remove the usb stick after starting tc-terminal-server, assuming nothing else is using the stick.

(This post(tm) assuming you're using tc-terminal-server)
The only barriers that can stop you are the ones you create yourself.

Offline Zendrael

  • Sr. Member
  • ****
  • Posts: 363
    • Zendrael's home of projects
Re: Remove media after Netbooting
« Reply #7 on: March 08, 2013, 04:26:20 PM »
Hello all!

Using copy2fs.flg let me remove the pendrive after boot. But my apps are not loaded, even the ones that have icons on the wbar (firefox). The base apps are OK.

The other problem is that after I removed the pendrive, the Apps application does not connect to any mirror, but a ping from the command line returns ok from any website.

Any clues?

And Curaga, I will try that too (later), thanks!

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Remove media after Netbooting
« Reply #8 on: March 08, 2013, 04:35:18 PM »
Post the output of 'ls -l /etc/sysconfig/tcedir'  and 'showbootcodes'.

Offline Zendrael

  • Sr. Member
  • ****
  • Posts: 363
    • Zendrael's home of projects
Re: Remove media after Netbooting
« Reply #9 on: March 08, 2013, 04:56:03 PM »
@Gerald_Clark, the output is:

ls -l /etc/sysconfig/tcedir
Code: [Select]
lrwxrwxrwx   1   root   root   13 Mar  8  21:48   /etc/sysconfig/tcedir -> /mnt/sda1/tce   
showbootcodes
Code: [Select]
initrd=/tce/boot/core.gz quiet waitusb=5:UUID="<I am hand copying... but you know that there is a lot of hex here....>" tce=UUID="<the same uuid...>" BOOT_IMAGE=/tce/boot/vmlinuz
As I can see, it is looking for the extensions on the /mnt/sda1/tce, right? So, I rebooted the system without removing the pendrive and without unmounting it... The firefox app open and soon it hangs...

Almost there!!!

Should I try to setup a new tcedir?

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Remove media after Netbooting
« Reply #10 on: March 08, 2013, 04:59:55 PM »
How much RAM do you have?  If you are going to load everything into RAM and then attempt to run firefox, you will need a few G.

Offline Zendrael

  • Sr. Member
  • ****
  • Posts: 363
    • Zendrael's home of projects
Re: Remove media after Netbooting
« Reply #11 on: March 08, 2013, 05:09:49 PM »
Running on 256MB of RAM with 32MB shared with video!

Hum... maybe that's the problem?

While just running the system without the copy2fs everything runs ok, I understand that it can be a problem to load everything into RAM... Firefox, LibreOffice and other apps will crash for sure...

If there's no way of doing that, even because I think that all the other clients must have the same amount of RAM, maybe I should go for the tc-terminal-server approach?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11624
Re: Remove media after Netbooting
« Reply #12 on: March 08, 2013, 05:17:11 PM »
Hi Zendrael
I think if you move your tce directory from the pen drive to the local hard drive and remove copy2fs.flg it might
do what you want.

Offline Zendrael

  • Sr. Member
  • ****
  • Posts: 363
    • Zendrael's home of projects
Re: Remove media after Netbooting
« Reply #13 on: March 08, 2013, 05:25:30 PM »
Hi Zendrael
I think if you move your tce directory from the pen drive to the local hard drive and remove copy2fs.flg it might
do what you want.

The idea is/was to have the entire "server" running on RAM so I can, after boot, remove the media, and at some point in the course, let the students "have fun" with the server. In another day, boot again from the media and all is shinning new!

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Remove media after Netbooting
« Reply #14 on: March 08, 2013, 05:31:28 PM »
The problem is that all extensions, your home directory, and the tmp directory are in RAM.
You will have difficulty doing anything in firefox as you have no room to download anything.