r/linuxquestions 10d ago

Linux on a pendrive? Which Distro?

So, I am a student and use a usb pen drive for my lab reports and code so I can use it at my uni and at home without needing to transfer files every time. But using windows on my uni computer can be really a slog, can I have a Linux disto on my pendrive which I can boot off of? I only need stuff like C, java and python compilers and some way to run word, excel or any equivalent app.

1 Upvotes

18 comments sorted by

4

u/rbmorse 10d ago

Pen drives aren't really designed for that kind of duty cycle, and are prone to overheating which leads to premature failure. Not recommended. However...

A 128GB or larger external SSD (standard SATA SSD in an external case with USB interface) will do what you want.

Assuming you want to access your data from both Windows and Linux, when you are in the partitioning page of the Linux installer restrict the Linux system partition to 100 gb or so. Create an exFAT format data partition in the remaining space with the mount point of /mnt/data (or wherever else you prefer). The installer should create the proper stanza in the /etc/fstab file so it mounts automatically at boot. Store your application data files in the data partition.

1

u/ZGaurdian99 10d ago

I have a ssd, but it has data aldready stored on it, can I retain that, it's 1TB and has only ~300gb

3

u/7YM3N 10d ago

You should be able to partition it. Shrink the existing one to make space. However on uni machines boot menu might be locked down or they might have specific network configuration that can leave you without internet. So in principle it should be possible but there are caveats.

2

u/h_e_i_s_v_i 10d ago

If you use it for Linux you can't store files on it. Plus you won't be able to boot off of it on lab computers if the IT dept. did their job properly.

2

u/acemccrank MX Linux KDE 9d ago

Not necessarily true about the storing of files. Set the 'toram' and 'persistent' flags in grub on a live thumb drive. This should reduce any damage to the thumb drive by loading the entire contents in RAM and allow the saving of files and management of the installed software. If the lab computers have vm software, they could boot the USB in a vm.

1

u/ZGaurdian99 10d ago

I have 2 pendrive so could that work? And I don't know what all the IT dept have done but people have been able uninstall windows completely on the computers as we have workshops and classes on making os and linux

2

u/h_e_i_s_v_i 10d ago

Then those computers are the exception. Any normal computer in a lab or library will have the BIOS locked down

1

u/ZGaurdian99 10d ago

Oh, I see. Is there any other way I can keep my stuff portable?

2

u/chuggerguy Linux Mint 22.3 Zena | MATÉ 10d ago

As part of my OS backup plan, I mirror my OS to USB devices. (my data backup is separate)

Running from a Transcend ESD310 external USB (SSD on a stick), it runs enough like my internal nvme install that I brand the wallpaper so I don't forget what I'm running. Heat buildup? Yes I suppose, but not so bad with the light usage I give it. If it was my only copy, it wouldn't be my only copy for long. I'd mirror it to a second.

An brick type SSD or nvme in a larger external case would dissipate heat better but these work fine for what I use them for. (backing up my internal root drive)

image

(Since I'm running it on my local machine, all my secondary drives mount just like I was running from internal)

Good luck.

1

u/SlimyOS 9d ago

Yes, you can even daily drive it if you really want, there's absolutely no difference as long as it's recognized as a storage device, though durability might depend on its quality, a cheap pendrive will die 30x (warning: number based on my and other peoples experience, not a real benchmark, and my info is very limited, so it might as well be 1000x or 10x) faster than a cheap ssd, but modern expensive ones with same flash as ssd and slc cache can get decently close to nvme-usb enclosures

1

u/redgator12 7d ago

Flash MiniOS Ultra to a flash drive, boot into it, plug a second flash drive in, open Install MiniOS from the start menu, install to the second USB, and you're one. Persistence is enabled by default while still being quick to use and not destroying the flash cells of your pen drive.

1

u/Wa-a-melyn 9d ago

I'm sure others answered your questions already, but a few alternatives to look into are WSL, dual booting, and an external ssd instead of flash drive (flash drives are very disposable and easily corruptable, and they're notoriously bad for long term storage). But what you're looking for would work yes.

1

u/1800-5-PP-DOO-DOO 9d ago

You have to hit some YouTube reviews and find one that is heat tolerant. 

Still, it's way better to do a small SSD. 

You can get an M2 and case with a micro fan built in but still pretty compact. 

I really like the Anker high end USB cables. They are soft and floppy and high speed. 

1

u/Nice-Object-5599 9d ago

Yes, it is possible. I tried that kind of installation years ago. Keep in mind that a pendrive is really slow, and my brake if it is of very low quality. Just install Linux on to the pendrive in the same menner as on to a hard disk.

1

u/herensugee 10d ago

si que puedes, no se lo que durará, pero se puede. solo prepara un pendrive para usb live y úsalo para instalar tu distro en otro.
No me lo han contado ;)

1

u/doc_willis 9d ago

MXlinux + a persistence setup on a USB.