WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: TC on 2GB UFD: Boottime Scripts for Running on Virtual and Real Machines  (Read 1569 times)

Offline mavigozler

  • Newbie
  • *
  • Posts: 1


I have a 2 GB UFD that I managed to install TinyCore 3.0 with multi-booter GRUB running at boot time.  I am not sure if GRUB is really necessary if I don't have another OS and I can use BIOS to choose devices.

My questions:

1. PARTITIONING
TCL is installed in 128 MB primary with fstype = ext2 and flagged bootable, and the rest of the UFD (1.8 GB) is a logical partition of fstype = FAT32 (all done with gparted running in TCL).  Why?  I want persistence of user data to be available to other OSes.   I also want persistence of extensions I am to frequently use, but not sure how much size they need and what fstype they should be stored.

What is best practice for partitioning of the 2 GB UFD?


2. "UNIVERSAL" BOOT-TIME and SHUTDOWN SHELL SCRIPTS for REAL and VIRTUAL MACHINES

I will use TCL 95% of the time as a guest OS running inside VMware Player with a MS Windows 6.x (Vista) host, at least until I can kick the MS Windows addiction that is forced on me whenever I have to buy a notebook machine whose OEM won't sell it without a Windows version bundled with it. 

The VMware Player provides:

  • virtual network card (VMnet 8 NAT)
  • virtual sound card
  • virtual HDD:  8 GB area probably somewhere on the real machine SATA/PATA/IDE HDD
  • other storage when I connect other UFDs
  • connection to a host OS Windows "shared folder" I create using a mount point through network interface

The other 5% of the time, I may actually run TCL on a real machine.

Given that much advice has been given to avoid using the UFD for any session activity that does a lot of read/write operations because the UFD has limited lifetime of write operations, a boot-time shell script would ideally check its environment (resources), determine if it is in a virtual or real machine, look for (possibly create for the session) the proper resource for a swap partition/paging file (or not boot with warning to user if there is a failure to detect), and do persistence (Backup/Restore) to the UFD on demand and/or at session close.

For instance, what should a boot time script do to see if TCL is running in VMware, what should it detect and choose as a resource for temp data and swap/paging/vram, and how to construct restoration of user data and extensions I don't want to install/DL from Appbrowser?

My question is if this is a good strategy, and as I am not proficient at writing Bourne scripts (even when I wrote them at a basic level  years ago), how would I write such scripts?  What would/should I take into account with virtual machines (VMware) to minimize UFD write operations and keep vram off the device and used on the HDD?

Thanks

Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
Re: TC on 2GB UFD: Boottime Scripts for Running on Virtual and Real Machines
« Reply #1 on: September 09, 2010, 05:59:34 PM »
I don't know if this will help in your situation, as I am not using any virtual machines right now but...

Re. item 2:

I have a USB flash drive that I use to boot microcore + core elements + jwm + wbar on any of several different physical hosts.  I have the extensions that I regularly use (and their deps) all downloaded to /tce/optional on the usb stick.  Extensions common to all hosts are listed in /tce/onboot.lst.  There is no persistence beyond the tce directory (which also holds the backup file).

I have scripting in place that determines what host machine it is running on based upon a stored list of the blkids of filesystems present on the hosts' permanent hard drives.  Once it knows what host it is on, it sets up the hostname, networking parameters and such.  There's a default setup for when I'm not on any of my known hosts.

If you're running under VMware, I suppose you have a virtual disk with a particular blkid at a particular device (sda1, perhaps).  If you're running on a physical host, I suppose you have other drives available with other blkids.  Logic similar to what I use to distinguish between two physical hosts should be able to distinguish any host from any other, physical or virtual.  Any filesystems that are shared would have to be excluded from such checks to avoid confusion.


32 bit core4.7.7, Xprogs, Xorg-7.6, wbar, jwm  |  - Testing -
PPR, data persistence through filetool.sh          |  32 bit core 8.0 alpha 1
USB Flash drive, one partition, ext2, grub4dos  | Otherwise similar