LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Distributions (http://www.linuxquestions.org/questions/linux-distributions-5/)
-   -   Live Linux USB with a read-WRITE Filesystem <Bon Appétit> (http://www.linuxquestions.org/questions/linux-distributions-5/live-linux-usb-with-a-read-write-filesystem-bon-app%E9tit-4175419834/)

Cleancut Callahan 08-01-2012 04:03 PM

Live Linux USB with a read-WRITE Filesystem <Bon Appétit>
 
[Appetizer]
Intro for Linux beginners (which the Linux supermen & superwomen can skip):

Some Live Linux distros enable a user to save their work & OS customizations inside a persistent Folder called a 'Home' Directory, i.e., in a Folder called 'Home'. This 'Home' Folder, having the “persistency” feature, saves the user's work on the USB even after the USB is removed and/or the computer is shut-down & re-started. The Home Directory is persistent because it's on a partition of the USB that is writable. However the Filesystem, a separate set of folders used for loading & running the Live Linux OS, is on a separate partition of the USB that is NOT writable (which leads to the question):


[Meat & Potatoes]
Here's the Question:

Are there any Live Linux distros that can also enable a user to make & save persistent changes to the Filesystem Folders on a Bootable USB Stick/SD Card? If there aren't any, how can one be made?


[Bread & Butter – optional]
I'd like to install/ extract software packages to the Filesystem Folders of Live Linux Operating Systems on USB stick-drives. The reason is that some programs are scripted such that they require additions & changes to the Filesystem Folders. This is a problem because, by default, some software is hard-coded to install & look in predetermined Filesystem Folders. And those default folder-settings are difficult if not impossible to change. If a user is unable to modify the Filesystem, then they can't save the software programs that they need to do their work when they are traveling. Aside from simply tasting new Linux flavors, the idea is to literally carry my entire computer (OS, files , AND Custom Filesystem Software) in my pants pocket or vest holster:

Specifically, I'm asking the above Question because I'd like to add a persistent installation of the Linux XAMPP package for web development PLUS I'd like to update the MySQL RDBMS (that comes pre-packaged in the Filesystems of Linux distros) by using newer rpm packages of newer versions as they're released – which requires write-access to Filesystem Folders that have the persistency feature.

For example:
Linux XAMPP forces installation & file/folder-referencing inside the '/opt' Filesystem Folder. Using the following command, I tried to globally find-&-replace '/opt/' with '/home/' so that XAMPP could run from the 'Home' directory instead:

grep -lir '/opt/' /home/lampp | xargs -i@ sed -i 's:/opt/:/home/:g' @

Unfortunately, it did not work because, among the scattered 1,037 files that contain multiple instances of '/opt/', many of them still needed '/opt/' in their scripts. As a result, NONE of the bundled XAMPP programs could start.


[Candy & Dessert]
If there aren't any Live distros that allow persistent OS modifications & updates, I was thinking:

This problem could be possibly solved if a Live USB has, first, a tiny read-only partition with code that starts the boot process but then points to, second, a read-write filesystem partition and, third, a read-write home-directory partition; or at least the user should have the ability to change the read-write permissions for the filesystem partition.

Does anyone know how to actually implement this or have any other techniques that could be used to solve this (excluding HDD installs and excluding booting or shooting the USB with my shoe or side-arm)?

273 08-01-2012 04:14 PM

As long as you don't want things like proprietary nVIDIA drivers then you could probably install most distros onto the USB drive as if it were a hard drive. If you wrote GRUB to its master boot record and it was using GRUB2 then you probably wouldn't even need to mess with that.
I've not tried it myself yet but I may do in the next few days, out of interest.

jefro 08-01-2012 10:17 PM

I don't think there is any live cd that can properly do full updates. Most live cd's installs that you are talking about use a split sort of file system. One is the original live cd part and the other is the persistent part.

As 273 suggests, almost every distro can be used to install to a usb drive just as if it were a real hard drive. An internal and usb is basically a scsi drive to the OS. The only thing you loose is the compressed disk image. It could be replicated if you are tight on space.

I almost always create a virtual machine without a hard drive. I attach the usb device to the virtual machine and boot to the cd/dvd iso image. I then install like any normal install.

Some distro's offer a hybrid iso that can be copied to a usb. Kind of a different deal and different ways to get it to work as you want.

Things like SuseStudio can create a usb image with almost any app you want installed.

dru8274 08-04-2012 01:23 AM

I haven't used Linux LiveCDs for a couple of years. But before that, I was quite deeply into it. And I remember that the custom LiveCDs I put together were persistent across the whole root-filesystem. So, some the above doesn't sound quite right...
Quote:

Originally Posted by Cleancut Callahan (Post 4743490)
Are there any Live Linux distros that can also enable a user to make & save persistent changes to the Filesystem Folders on a Bootable USB Stick/SD Card? If there aren't any, how can one be made?

I think you should keep looking, until you find a LiveCD distro that does what you want. Because there is no technical reason that prevents persistent changes to the whole root filesystem. Seriously, most LiveCDs are based on a union file system like aufs, and changes can be saved across the whole root filesystem. But if a limitation on that exists, then it is entirely because the designer of that particular LiveCD decided to dumb things down intentionally.

But like I said, I'm not currently using LiveCDs. But if I needed to... well, I believe that Puppy Linux allows you to install new packages, with persistence. And I would look at Porteus Linux too, which is a specialist LiveCD distro. And I just can't imagine those guys tolerating half-assed persistence.
Quote:

Originally Posted by jefro (Post 4743689)
I don't think there is any live cd that can properly do full updates. Most live cd's installs that you are talking about use a split sort of file system. One is the original live cd part and the other is the persistent part.

I agree that yes,the persistent changes are stored separately. But no, I don't agree that this restricts a LiveCD from installing new packages etc. Because basically, a persistent layer can store changes for the entire root filesystem. During boot up, the changes in the persistent layer are transparently superimposed over the read-only layer, and if aufs works as advertised, then everything in the root filesystem should look similar to how it would with any other filesystem like ext2.

The read-only and persistent layers are typically stored on the USB as compressed squashfs fiiles. But if the persistence layer grows large and unwieldy, then the read-only layer and the persistence layer can also be combined, to create a new larger read-only layer. And to then start anew with an empty persistent layer...
Quote:

Originally Posted by jefro (Post 4743689)
As 273 suggests, almost every distro can be used to install to a usb drive just as if it were a real hard drive. An internal and usb is basically a scsi drive to the OS. The only thing you loose is the compressed disk image. It could be replicated if you are tight on space.

Well, if your PC uses usb-2.0, then your main performance bottleneck will be data transfer to/from your USB. And it could be very, very slow. Basically data transfer to/from a USB isn't fast anyway, but its data-transfer is the fastest when transferring large compressed files, which is typically what a LiveCD does. But a full-install to USB does the opposite... it's data isn't compressed, and it contains lots and lots of small files. So the data-transfer times can be large, and your cpu will be forced to sit idle, while it waits for data-transfer from the USB to catch up.

So yes, it is doable. But no, I wouldn't choose to go that way. Not if I could avoid it.


All times are GMT -5. The time now is 01:48 PM.