What makes a live distribution non-persisent? What would make it persistent?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Hardy (Gnome on Ubuntu 8.04) on Compaq N600c laptop
Posts: 323
Rep:
What makes a live distribution non-persisent? What would make it persistent?
Mostly an academic question, what is it that makes the live boot volatile, in terms of additions and edits? I know it uses some kind of ram-drive, but how is it created and loaded? What else does it do?
Also, what is it that some folks do to make these suddenly NOT volatile, but persistent?
Just trying to understand the linux boot process a bit better. If necessary, assume the newest Ubuntu (now 8.04?) for the sake of argument, since it has a live boot option.
As far as the difference between a live CD's volatile configuration and an installed system's nonvolatile configuration the answer is pretty obvious. The live CD usually doesn't have access to configuration files that can hold a tailored configuration. At least one live CD distribution does look for configuration files on a floppy disk if a floppy disk is available.
As far as the difference between a live CD's volatile configuration and an installed system's nonvolatile configuration the answer is pretty obvious.
I get that the ram-disk is volatile, but how is it created and where? Would a simple change of any live distro be sufficient to make it persisent? What would that change be?
Basically, a 'Live' CD runs entirely in RAM, so (for example) you could boot a purely MS-Win box with it and try out Linux, without any danger of messing with your MS install.
You'll see this recommended in some LQ threads.
Some Live CDs also have an option to do an install to your harddisk.
This will (obviously) be a minimal install, but once its there, you can boot the HDD version and connect to the Internet to get updates and extra SW pkgs.
HTH
Mostly an academic question, what is it that makes the live boot volatile, in terms of additions and edits? I know it uses some kind of ram-drive, but how is it created and loaded? What else does it do?
Also, what is it that some folks do to make these suddenly NOT volatile, but persistent?
Just trying to understand the linux boot process a bit better. If necessary, assume the newest Ubuntu (now 8.04?) for the sake of argument, since it has a live boot option.
If I recall well, there is a way so that knoppix save his home somewhere to be persistent... knoppix can has additional package installed with apt-get install
you can run/install linux on a USB pendrive bootable, and you get shtg persistent ... dont know how but possible
Last edited by frenchn00b; 06-12-2008 at 11:41 PM.
Distribution: Hardy (Gnome on Ubuntu 8.04) on Compaq N600c laptop
Posts: 323
Original Poster
Rep:
I appreciate the comments, but again, I understand what a live boot is, what a ramdrive is, what can be done with them, etc. What I need is some information about how this stuff works.
An example:
Pendrivelinux's suggestions for converting an Ubuntu8 CD to a usb drive doesn't work on any of 5 systems I have. Unetbootin works on all of them. I'd like to understand why, more than I'd like to get any particular job done.
Where does the boot process start, exactly?
How are filesystems like squashfs recognized and mounted?
What makes the the live boot setup suddenly persistent?
I appreciate the comments, but again, I understand what a live boot is, what a ramdrive is, what can be done with them, etc. What I need is some information about how this stuff works.
An example:
Pendrivelinux's suggestions for converting an Ubuntu8 CD to a usb drive doesn't work on any of 5 systems I have. Unetbootin works on all of them. I'd like to understand why, more than I'd like to get any particular job done.
Where does the boot process start, exactly?
How are filesystems like squashfs recognized and mounted?
What makes the the live boot setup suddenly persistent?
Well, since you want to know *exactly* where the boot process starts, my answer is the end of your finger, which you use to press the power button. However, I suppose you prefer an answer more closely related to Linux, rather than electricity. I suggest a lookup of "linux boot process" on Google. Plenty of explanation there. You'll read about init, the kernel, BIOS, rc.d, etc.
A LiveCD will never be persistent, unless it is installed to the hard drive. Most LiveCDs are designed this way, for the purpose of previewing, or system repair/recovery.
How are filesystems like squashfs recognized and mounted?
What makes the the live boot setup suddenly persistent?
The answers are very specific to the LiveCD in question. There is not "standard" method of achieving the goals of a LiveCD. All of them are ugly hacks in one way or another.
Not all LiveCD's have a method of handling "persistence", and those which do do so in their own specific ways.
In order to understand a LiveCD boot process, you're going to first need to understand how a traditional hard drive boot process works. Hard drive booting is MUCH simpler, but it's still rather complex. There still isn't just one "standard" way of doing things in Linux, but there's a lot less variation than with a LiveCD.
I've learned about the boot process in bits and pieces, and don't really know a good reference for the whole picture. Here are the basics:
1) Grub. Grub is a general universal bootloader, which can load up many different operating systems. Linux is merely one of them. Grub is weird if you're familiar with how, say, Linux does things. Grub is more comprehensible if you first start with the realization that it is not really related to Linux. But your Linux operating system needs SOMETHING to boot it up.
2) Linux kernel and initial ram disk. Grub can load up a linux kernel and initial ram disk image. It will typically load this from a hard drive partition. But grub isn't linux, so once Linux is loaded the computer seemingly "forgets" how to access the hard drive. But it's not really that linux forgot how to access the hard drive. It never learned in the first place--it was only Grub which knew how to access it.
So, Linux starts off with just a kernel and a "disk" in RAM. This minimal OS is small but potent. It contains all of the information needed for Linux to get most of the hardware up and running. This includes the hard drives so it can load up the "main" operating system.
3) The "main" operating system. After the initial ram disk Linux OS has done its job of getting the basics up and running, it mounts the "real" root file system and hands over control to the "real" OS.
Now, a LiveCD handles things a bit differently. The "real" root file system isn't a hard drive but rather something a bit more complex. The root may be squashfs, something pointed to a compressed archive which uncompresses files on the fly. Some LiveCDs will copy the archive image into RAM if it'll fit, for extra performance (and also allowing the OS CD to be removed). Then, read-write filesystems are mounted into parts of the file system which need read-write functionality. Usually, these will be tmpfs ramdisks. For example, a tmpfs ramdisk will be mounted on /tmp. For "persistence", /home might be mounted to a hard drive partition, or something more complex may be done.
In all cases, these complex steps are done via scripts in the initrd.img image. This is all done during the initial ramdisk stage, before the "main" OS takes over control.
Distribution: Hardy (Gnome on Ubuntu 8.04) on Compaq N600c laptop
Posts: 323
Original Poster
Rep:
Some good information here. Thanks to all (except snide comments of course )
Quote:
Originally Posted by IsaacKuo
In all cases, these complex steps are done via scripts in the initrd.img image. This is all done during the initial ramdisk stage, before the "main" OS takes over control.
So, that initial ramdisk stage sounds like the point of interest for me, where semi-permanent mounts (live systems or otherwise) are performed, and where a ram-based vs. a disk-based mount are performed. So if I wanted to take a liveCD-transferred to USB and make it persistent (installs, documents, etc.) I'd need to look at this stage to see where things like /home and /usr/local, etc. are mounted. If so, where in the initrd.img (I'm assuming this is a number of files within an image/compressed file) would these initial mounts be performed?
So, that initial ramdisk stage sounds like the point of interest for me, where semi-permanent mounts (live systems or otherwise) are performed, and where a ram-based vs. a disk-based mount are performed. So if I wanted to take a liveCD-transferred to USB and make it persistent (installs, documents, etc.) I'd need to look at this stage to see where things like /home and /usr/local, etc. are mounted. If so, where in the initrd.img (I'm assuming this is a number of files within an image/compressed file) would these initial mounts be performed?
Well...not ALL mounts are done within the initrd image. Usually, only the mounts required to get the root file system mounted is done. With a typical hard drive install, that means ONLY the "/" partition. The rest of the partitions--including /boot (if it's a seperate partition) are mounted later by the main OS.
However, with a LiveCD the root partition may not be quite enough to get things going, necessarily. Like I said, the specifics will depend on the precise way the developer(s) of the LiveCD in question solve things.
The format of initrd.img is a compressed file system image. I'm not familiar with messing with it directly; something to do with gzip and a loop filesystem. I use the mkinitramfs tool included in Debian to create initrd.img files.
If you really want to understand how a LiveCD works, you'd best pick one in particular and understand how it works. You won't get anywhere with generalities. Knoppix is a particularly heavily documented LiveCD.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.