27

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?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
l245c4l
  • 4,135
  • 9
  • 35
  • 40
  • 4
    I think this question belongs on superuser. – glenneroo Jan 08 '11 at 07:28
  • 1
    @glenneroo, no, [Unix SE](http://unix.stackexchange.com) would be more appropriate than superuser. – cjm Mar 20 '12 at 07:10
  • 2
    I don't know much about casper rw either. Here is the neat thing about it. Wish you could do it in Windows. The operating system stays the same. All of the changes you make folders, on the desktop, downloads, etc. stay in the casper. I put the casper on my hard drive. When I mess up my os - I just put the old (last working) casper back. – Jeffrey Feldman May 04 '10 at 01:08
  • 1
    I don't think that any of the answer addresses the question "why do I need it to make saving persistent on a USB flash drive?" Why not just use an ext4 fs as on normal installations? – Jarl Jan 18 '19 at 15:45

3 Answers3

24

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).

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Fordi
  • 2,798
  • 25
  • 20
  • However, there were two distros which were installable onto FAT32 paritions: [ZipSlack](http://www.slackware.com/zipslack/) and [PhatLinux](https://web.archive.org/web/20070721004353/http://phatlinux.com/). – niutech Feb 05 '14 at 14:39
  • Really? How did they handle permissions and symlinking? Either way, that would be incompatible with a live CD. The live CD had first class permissions and symlinks; the F32 drive could not. This would cause all kinds of trouble if you tried to store the override for a special file in F32. At worst, you'd have an edited duplicate of a symlinked file on the F32 partition that didn't match the original, and had different permissions to it. – Fordi Apr 25 '14 at 22:29
10

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.

bneely
  • 9,083
  • 4
  • 38
  • 46
TheMASTER
  • 116
  • 2
  • 3
1

It seems like a "no brainer" model in keeping your "Tool"=(OS) & your "Art"=(Data / Documents) isolated from each other, and it could go even farther by "Tool"=(OS) "Special Tools"=(Additional 'wares) & "Art"=(Data / Documents).

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
IDZignIt
  • 19
  • 1