LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 06-12-2008, 04:01 PM   #1
lumix
Member
 
Registered: Mar 2007
Distribution: Hardy (Gnome on Ubuntu 8.04) on Compaq N600c laptop
Posts: 323

Rep: Reputation: 30
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.
 
Old 06-12-2008, 05:13 PM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
As far as the Linux boot process there is plenty of documentation. Here is one place to start. http://www.tldp.org/LDP/intro-linux/...tml#sect_04_02

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.
 
Old 06-12-2008, 07:36 PM   #3
lumix
Member
 
Registered: Mar 2007
Distribution: Hardy (Gnome on Ubuntu 8.04) on Compaq N600c laptop
Posts: 323

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by stress_junkie View Post
As far as the Linux boot process there is plenty of documentation. Here is one place to start. http://www.tldp.org/LDP/intro-linux/...tml#sect_04_02

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?

In any case, thanks for the link.
 
Old 06-12-2008, 08:38 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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
 
Old 06-12-2008, 11:40 PM   #5
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Rep: Reputation: 57
Quote:
Originally Posted by lumix View Post
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.
 
Old 06-13-2008, 02:55 AM   #6
lumix
Member
 
Registered: Mar 2007
Distribution: Hardy (Gnome on Ubuntu 8.04) on Compaq N600c laptop
Posts: 323

Original Poster
Rep: Reputation: 30
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?
 
Old 06-13-2008, 08:36 AM   #7
SlowCoder
Senior Member
 
Registered: Oct 2004
Location: Southeast, U.S.A.
Distribution: Debian based
Posts: 1,250

Rep: Reputation: 164Reputation: 164
Quote:
Originally Posted by lumix View Post
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.
 
Old 06-13-2008, 02:04 PM   #8
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
Quote:
Originally Posted by lumix View Post
Where does the boot process start, exactly?

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.
 
Old 06-16-2008, 09:16 PM   #9
lumix
Member
 
Registered: Mar 2007
Distribution: Hardy (Gnome on Ubuntu 8.04) on Compaq N600c laptop
Posts: 323

Original Poster
Rep: Reputation: 30
Some good information here. Thanks to all (except snide comments of course )

Quote:
Originally Posted by IsaacKuo View Post
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?
 
Old 06-16-2008, 09:22 PM   #10
lumix
Member
 
Registered: Mar 2007
Distribution: Hardy (Gnome on Ubuntu 8.04) on Compaq N600c laptop
Posts: 323

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by SlowCoder View Post
I suppose you prefer an answer more closely related to Linux, rather than electricity.
You are correct. I had figured out the part about conception for myself. Apologies if that wasn't obvious.
 
Old 06-16-2008, 09:52 PM   #11
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
Quote:
Originally Posted by lumix View Post
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Live user to Persistent ? a1234 Linux - Newbie 5 05-17-2008 04:04 PM
How to make a new distribution CD Live ? guigonza Linux - General 1 01-15-2008 11:57 AM
Can I make Nautilus have a persistent clipboard? Game_boy Linux - Software 4 10-21-2007 08:53 AM
where is the persistent home option in Kubuntu 6.06 (live) alaios Ubuntu 4 01-26-2007 10:54 AM
How does one make a static route persistent in AIX? artasse AIX 2 11-22-2006 02:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration