Creating multi-OS boot CD using codes - iso

Is it possible to write coding that will allows one to store multiple OS (in their ISO format) into a CD/DVD and turn them into a Live CD/DVD for later use?

Yes. You would probably want to use Grub4DOS as your boot loader because it can boot operating systems from disk images, which, to my knowledge, other boot loaders don't do. So you could potentially load up a DVD-ROM with Grub4DOS and several live CD isos so that you could then boot multiple operating systems from that DVD-ROM.

Related

Automatically enabling all ethernet, ATA, SATA, and SCSI drivers in the Linux .config file

I am compiling my own Linux kernel and userland tools for a PXE environment meant for cloning and reimaging. Right now, I'm sticking to a specific kernel version and using preconfigured .config's for building the Linux kernel.
I need to change from using preconfigured .config's to automatically generating the default configuration for the specified architecture, and then enabling all ethernet, ATA, SATA, and SCSI drivers.
The reason I want to do this is:
Updating the kernel means updating the preconfigured .config's, which takes too much time to manually do. The way I'm doing it now is using menuconfig, enabling the options I need, and saving the resulting .config to my repository.
I know the kernel I'm building is missing some drivers because I've encountered some PC's that were not able to mount the NFS share because Linux could not find an ethernet device (which I've verified by booting an Ubuntu CD, which did find the ethernet device). I want an automated way of building any Linux kernel version that will guarantee that ALL drivers I need are pulled in.
Using a distribution's configuration pulls in too many unnecessary drivers and features for my purposes. It lengthens the kernel build time from 10-15 mintues to an hour or more, and the resulting image is too big.
Does anyone know how to write a Bash script to accomplish this?
Have you considered using a text editor to modify the .config file.
Then you can modify it using search and replace.
Plus, there are other choices for configuring the kernel than the menu-driven "menuconfig".

How can we use Linux from a small storage pen drive? Does it work on micro-controllers also?

I generally hear that LINUX OS can be downloaded on flash, pen drive (floppy disk?) etc. How we can do that?
I have RHEL 5.4 source code - so how can download it into pen drive and how much space is required?
What other functionality I can add apart from the OS - so that when I boot from that storage device I can make use of them?
Can we download Linux OS into micro-controllers also?
I generally hear that LINUX OS can be downloaded on flash, pen drive (floppy disk?) etc. How > we can do that?
If you can't get it to work on your own, you can buy a ready made Linux on a USB drive from
a site like http://www.osdisc.com or http://www.cheapbytes.com
Not all PCs, especially older PCs, can boot from the USB Drive. Even some newer PCs are beginning to ship with security features that can interfere with booting code. When it does work, you have to find out the proper way to boot the USB drive. You might have only a few seconds during reboot to enter the right key, or it will boot Windows (if Windows is installed). The key to get to the BIOS Boot Menu might be delete or escape or F10 or some other key (varies with PC motherboard manufacturer). A message on the screen that flashes by rather quickly might mention keys you can press. Boot to a specific device or changing boot order can also often be found in the BIOS setup.
There is a linux utility called unetbootin that will create a USB drive that will boot linux. It does not create a USB boot drive from a source code distribution, but rather from an ISO file representing a live CD or the live CD itself.
Since large USB drives (e.g. 32GB) are relatively inexpensive, if you want to compare systems or have multiple systems there is a way to have multiple linux and other operating systems on one USB drive and be able to choose which to boot into. See, for instance, http://www.pendrivelinux.com/ which has a wide variety of procedures for making a bootable USB using either windows or Linux to set up the USB and booting a variety of systems.
I have RHEL 5.4 source code - so how can download it into pen drive
and how much space is required?
RHEL 5.4 is a bit old. You need the Live CD, if there was one.
The ISO file can take up 600+MB. You want space left over to use the system. 2GB for the pen drive is OK. Sometimes you can get by with less.
What other functionality I can add apart from the OS - so that when I
boot from that storage device I can make use of them?
Upon boot the operating system will often recognize sound cards, other usb devices, the hard drives, etc. You need to know how to use these things within Linux, and how to enable them if they are not configured. Some Linux distributions have a place to put packages that are to be autoinstalled when a USB pen drive based system initializes. In this way you can "install" software from the distribution archives that are not included on the standard live system, even if you don't have internet access.
Can we download Linux OS into micro-controllers also?
People run it on raspberry pi and such, but the versions of Linux on non-PC hardware that has low memory are often quite tiny compared to a desktop version. They can be tiny enough to be challenging to work with or expand.

embedded linux root filesystem on disk

I would like to know how to create a root file system for an embedded Linux system that is stored on a hard drive. Would this be the same procedure if it was on a flash card?
No, your boot loader would need to know how to initialize the hard drive. With flash cards the boot loader initializes as an MTD and can understand the file system.
You might be able to make progress with an IDE HD and IDE support in the boot loader.
On a regular computer (e.g., PC) the BIOS takes care of initializing all peripherals, like a primary HD.
Typically Linux embedded system is not operate directly in disk based filesystem, but use a mechanism to load the OS from a persistent storage (hard drive, flash card or memory, etc.) to volatile memory space (RAM). In general, these OS's file (commonly called as firmware) are kernel image file and a initrd (Initial RAM Disk) file, the initrd file contains root filesystem's files and any system's related files, upon boot the initrd will be uncompressed and deployed into a RAM based filesystem such as tmpfs, once completed, the system will use the tmpfs filesystem just like any disk based filesystem (ext3, btrfs), for example to run init program or script to do system initialization. Embedded system is tend to minimize I/O on persistent storage for some advantages: reliability, speed and cost.
You can learn how to accomplish this by learning any general Linux distribution on how to create and modify a initrd file.

Real-Time File Mirroring in Linux to a NAS

Can anyone tell how I might best mirror selected files and folders to a NAS, (Network Addrssable Storage) box from a Linux workstation in real-time?
These are very large files, (> 50GB) and are being continually modified, so I would only like to change those portions of the files that have been changed, added or deleted.
FYI: These files are actually Virtual Box virtual hard disk (VDI) files.
I discovered that my Synology DS211J NAS can run an RSync service. So I enabled that and used lsyncd for the live mirror... the VirtualBox VMs... all works very well.
Rsync only synchronises the parts of files that have change and so is very efficient at synchronising large files.
Of the solutions that #awm mentioned, only drbd provides block-level, realtime synchronization. The other tools will meet your goal of only propagating deltas, but they operate asynchronously. In fact, rsync will work just as well in this case, since you're not trying to provide bi-directional synchronization.
For drbd to provide block-level replication, you need need to install the drbd kernel modules and userspace tools on both the workstation on the NAS...which means this solution is only appropriate if your NAS is actually a fairly generic Linux box over which you have a great deal of control.
Before hand I just want to suggest that you don't do this. You can easily bottlenet your network and NAS and cause all sorts of problem on your host.
That being said, these claim they can do it:
Unison can be found at: http://www.cis.upenn.edu/~bcpierce/unison/
PeerSoft can do it too: http://www.peersoftware.com/products/peersync/peersyncserver/overview.aspx
Maybe - http://www.drbd.org/

Mounting ISO image from USB at boot time

Is it possible to mount a ISO image from USB disk and to use it as a filesystem at boot time(with grub)? I ask it because I would like to put the kernel linux image and an ISO to be used as a filesystem(with fedora bootstrap) into an USB disk(without creating new partitions, etc.), as it is possible to do by using Qemu, for example.
Qemu is a virtualization/emulation environment. Grub is a bootloader, designed to get a kernel loaded into memory and start it executing. Neither program is directly related to your question, although you could certainly use Qemu to execute a VM that uses Grub to start Linux to do what you want.
Modern Linux distributions create an initrd, which the bootloader puts into memory for the kernel to use as its initial root file system. The initrd does things like loading the modules necessary to access the hard disks where the real root file system lives. In your case, you should look at having the initrd find your ISO, mount it, and use it as the root.
The contents of initrd vary based on what distro you're using. I'd grab a livecd from somewhere, dump its initrd's contents with zcat /boot/initrd-2.6.whatever.img | cpio -id, and check out what it's doing. Look for the init file, which will be the first user-space process run by the kernel.
Grub's loopback feature should allow you to boot a kernel and initrd from within an ISO image. Unfortunately, there's no way to allow the kernel to mount a loopback device as the root filesystem, so I think you're out of luck.

Resources