Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a casper rw loop file and why do I need it to make saving persistent on a USB flash drive?

Tags:

Suppose I've installed Linux on my flash drive. Why do I need something like the casper loop file to make saving persistent? So files are being erased? Isn't the flash drive the same as actual hard disk drive? I'm a Linux noob so be patient.

Or it is because Linux on a flash drive is actually like live CD on a flash drive? Can it be installed just like it is installed on a hard disk drive?

like image 958
l245c4l Avatar asked Apr 02 '10 10:04

l245c4l


People also ask

What is a casper-rw file?

NOTE: A casper-rw filesystem is just a regular filesystem that's been tucked inside a single file. In that example they're using a EXT3 filesystem within it.


2 Answers

Live Linux off a USB stick is done by embedding a bootable, read-only filesystem image as a file on a USB stick and booting from that. This is done for a couple of reasons, the largest of which being that the stick remain readable / usable on other systems, but also because it means you can use the same stack of files to make a Live CD as a USB stick.

Normally when this is done, the RW portion is done via a ramdisk, however with a USB stick, you have the opportunity to store the mutable portion of the live system on the stick.

You may think, "well, why not just do it as a directory on the stick?" The reason for this is that a FAT32 filesystem doesn't have all the metadata that a Unix environment needs. You need to use something like ext2.

So what is a casper file? It's a file that has been treated like it's a hard drive partition. That's it. Instead of pointing mkfs.ext2 or mount at /dev/sda3 (a partition), you've pointed it at /mnt/sda3/casper-rw (a file).

like image 76
Fordi Avatar answered Sep 19 '22 16:09

Fordi


Casper is basically a storage container for Linux systems which downloads programs/drivers/settings anything that is software based is saved in. The files that are not in the casper drive are either the live cd (which would be on a USB drive in this case) and user-created files such as Open Office documents, pictures, and videos. Don't use up the free space on your USB drive with casper or you won't have room to save documents on the drive.

You can install Linux onto your flash drive which in turn wouldn't need a casper persistent storage because of how it runs, but it renders the USB drive as only usable on the pc that it was installed with.

That's what casper provides because a live USB drive can be used on many pcs with the same hardware configuration as the version you downloaded, and casper brings your programs and settings with you.

like image 28
TheMASTER Avatar answered Sep 21 '22 16:09

TheMASTER