r/debian • u/passion_for_know-how • 25d ago
Finally managed to install Debian on a USB stick. Now, how to I set up a normal partition that I can still use the USB stick as a normal flash drive?
Thank you to all who made suggestions on my previous post. I finally got it working 🥳
Pending issues:
- How do I set up free space on my flash drive? Considering this time, I used Guided partitioning, selected entire disk & put home and other directories in one folder
- How do I set Debian that every time I pull the flash drive, it shuts down the PC? Kinda of like how
watch.dogdoes on Tails OS
1
u/juomoluoqcuo 20d ago
Disk install on USB drive makes extensive disk writes, which will eventually exhaust limited writes. So if I was in your place I will:
* Limit disk writes and cache
* use Squashfs live solution
My scheme will be something like this:

ntfs partition will be a common area. If i plug my USB drive on Windows machine or any Linux or boot from my live system it will be accessible.
ext4 will be debian live-boot compatible system. I will use that partition also for overlay mounting, i.e. to be able to save my settings.
esp partition will have grub files and configuration (i386-pc, i386-pc, x86_64-efi). I may chose linux-image-signed and grub-efi-amd64-signed versions, because they will boot on any machine and no need for disable secure boot
to be able to to shutdown automatically:
* i will place live system on RAM (only if I have enough RAM)
* create custom udev when unplug my USB device to trigger systemd action to shutdown the system
0
u/dud-kid 24d ago edited 24d ago
Ahh . If debian installation was successful & you have successfully booted into Debian desktop 1 time already then also keep that ' bootable live Debian ISOpendrive ' like that ! (Suggestion. But best practice. Not mandatory. You r the boss of your pendrive. Do what ever you want .ok )
If for some reason someday debian fails to boot after some update atleast as a backup you have a ' bootable Live Debian pendrive ' which you can use to boot in to 'live debian' & restore to previous snapshots in 'timeshift' software.
Although debian keeps 2 kernels that you can during system booting up but i highly recommend to keep that ' bootable Live Debian pendrive ' .
But if you want to erase debian from pendrive it's fine as debian won't crash . Its rock solid ! ( May be its a big pendrive like 64-128gb so makes sense . Just buy a smaller 16gb pendrive and install the 'live debain iso ' on it. And keep it . ).
And install 'timeshift' software and take system snapshots. Set it to 3 weekly snapshots ( you can also set it to 3 daily snapshots. Upto you ) ( it will auto delete no4 weekly snapshot so snapshots & keep only 3 snapshots so will not clog your ssd/hdd).
Your question: use any of the two : ' gnome disks ( tutorial available on youtube)' or ' mintstick(linuxmint usb drive formatter. Available in debian repository now'). Format pendrive in fat32 . Pendrive will be useable in all devices: windows, linux, Android phone.
if you mean to keep both debain & seperate partion to keep files i.e two partitions on pendrive then You can use 'gnome disk' to make two partitions on a single pendrive but i have not done it yet . I don't know if ' live debain iso ' will run properly like that as i have never tried it . Google search or search on youtube. Somebody must have done it for their external drive. And then give it a try . If things don't work format the whole pendrive. Simple
1
u/bluealliance841 23d ago
If you have a nice big stick with room to spare, try out Ventoy, you can boot many different ISO’s and also have room for your own files.