lainchan / Ω
OS on a USB
Frank Garza · 2022-11-05 13:39
Does anyone here have his main OS installed on a USB?
Pros:
>Avoids the need to keep multiple machines (laptop and desktop for example) "in sync"
>Boot into your system from just about any machine
Cons:
>Cheap USBs or old USB ports would have speed and/or storage size issues
>One less usable USB port
I think it would be interesting if you could boot any regular distro from USB and have it copy to RAM so you could remove the USB drive, then when shutting down it would write any changes made to the USB so that you didn't have to have it plugged in constantly and have to deal with the USB speed bottleneck.
A quick search yielded ramroot which allows booting from a USB either normally or copying it to RAM, but it doesn't seem to directly support writing changes made during RAM mode to the USB drive. It does allow you to mount the USB so I suppose you could rsync any changes to it before shutting down, but I wonder if "dirty files" that are only supposed to exist while the system is running (caches etc) would cause problems.
Unidentified · 2022-11-05 13:56
i have done this. newer usbs are faster so now its not so much of a pain, but it is limiting. There are a number of distros that are USB focused and at least some of them do/have copied to RAM. it makes it faster, but it also eats your ram, and as you note there's the file persistence problem. You can get around it, but it adds hassel and whatever.
Fun excercise to setup, useful to have one around as an emergency system to fix other machines, but outside of extremely niche uses and maybe the extremely paranoid, I don't think its especially practical.
Elliot Alderson · 2022-11-05 14:54
>>64936
I've been doing this for like a year now, on my distro installation for gaming;
I use a sandisk (32 gigs) flashdrive, the space is limiting but since the kind of games i most often play are 100MB-1.2GB, it's not really a problem. I also use a partition of my main ssd as swap so i guess that would be the real limitation when it comes to switching PCs (nothing a nano /etc/fstab can't fix)
Y.T · 2022-11-05 15:29
>>64936
https://puppylinux-woof-ce.github.io/
I'm pretty sure that puppy linux runs in RAM.
Acid Burn · 2022-11-06 01:16
the requirement of 'being able to remove the flash drive' is going to be your big limitation here. There are OSs like Tails that allow you to have a persistent partition on the drive, but with most of it being immutable. Gets you most of the way there.
If you want just a standard install, you can set up a tmpfs, rsync your / over to that, then when you want to shutdown, rsync -u back to the drive I guess? Seems like fun though!
Motoko Kusanagi · 2022-11-06 01:26
Don't many USBs just die after a few years though?
Unidentified · 2022-11-06 02:08
>>64949
any modern persistent storage dies after a few years of active use
Boris Grishenko · 2022-11-06 02:48
>>64938
>Fun excercise to setup
>>64948
>Seems like fun though!
That's probably the main reason I'm interested in it, honestly.
That plus getting tired of having to install and maintain a desktop on multiple machines.
>>64949
I'm pretty sure the main reason for dead drives aside from being cheap and buying cheap chink soykaf is lots of writing. If you copied to RAM and only wrote to the drive when necessary you could probably extend the its life quite a bit barring any physical damage.
The Plague · 2022-11-06 08:26
>>64949
I have a few drives that I have been using since the early 2010s on a pretty regular basis.
Yet Another Lainon · 2022-11-08 06:56
I recommend getting a SSD USB stick, they're not that expensive.
https://unix.stackexchange.com/questions/118965/how-to-create-a-debian-live-usb-with-persistence
Drifter · 2022-11-09 20:19
>>64936
>Does anyone here have his main OS installed on a USB?
While not my MAIN, I used puppy linux often on a USB stick at college because the old computers over there were being bottlenecked by their HDD OF ALL THINGS!!!
Thankfully the programs I used in that lab weren't too soykaf and was able to use Wine at worst to run stuff. There was luckily always a linux package of an app i needed.
>>64942
oh hey this guy gets it :)
Ender · 2022-11-13 05:39
>>64936
>but it doesn't seem to directly support writing changes made during RAM mode to the USB drive
find the ramdisk in /dev and dd it to the usb drive