DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I like to use a virtual machine sometimes but best is if you remove power to your internal drives. Then you simply can't make a mistake. Boot to dvd and follow instructions to install to usb drive.
I'd like to install Debian stable to USB as if it were HDD, so that later I can add/remove packages, compile stuff etc...
Is there a way to do it?
Thanks.
The Debian installer sees USB drives just like any other drives. It will happily let you do the install. However, be aware that the computer's motherboard might not let you boot from all USB ports. I've had laptops where I had to move the USB drive to another port before it would boot.
Especially if the USB drive is smaller than 16GB, I would recommend that you do an install without a swap partition. The Debian installer will give you a warning and ask if you really want to continue without configuring a swap partition. Later on, you can configure a swap file, which I like to place in /var/swapfile
The big advantage of using a swap file instead of a swap partition is that it's a lot easier to adjust the drive space set aside for swap vs usable drive space. The big disadvantage is that hibernation doesn't work with a swap file (not without some ugly hacks, I think). I've personally never used the hibernation feature, so I don't miss that.
There's an explanation how to create and set up a swap file here:
If you find yourself desperate for disk space, or you want to create a new swap file with a different size, you can do the following to immediately recover the space consumed by the swap file:
from my notes on swap file using fallocate, I think this is a bit faster then dd
Code:
a different way to make a swapfile
userx@crunchbangerz:~$ man 1 fallocate
sudo fallocate -l 512M /swapfile
1GB Swap File
sudo fallocate -l 1G /media/data/moreswap/swapfile ;
sudo mkswap /media/data/moreswap/swapfile ;
sudo chmod 0600 /media/data/moreswap/swapfile ;
sudo swapon /media/data/swapfile
userx@crunchbangerz:~$ sudo mkswap /swapfile1
Setting up swapspace version 1, size = 524284 KiB
no label, UUID=67328381-6ed2-4c61-8276-c54a003906f9
userx@crunchbangerz:~$ sudo swapon /swapfile1
as you can see from my crunchbangerz prompt its been a while sense I've used a swap anything actually. but with a USB Boot its not a bad idea to use a little swap file - you can also just add to it, by making another swap file and swapon with that one having more than one swap file at a time up and running.
Yeah, dd isn't the most efficient way to do this, but it works and it's what was in the web reference I linked to.
BTW, by default Debian does not install sudo. The usual way of doing things in Debian is to log in as root (either directly on a console or using "su -").
chrunchbang was a Debian knock off - nothing wrong with options - but to each his own -- as long as it gets done.
when I did my USB OS install experiments I used GParted to create my swap and partition on the USB stick before installing it via USB ports - as stated before it just sees the USB Ports as hdd as well. I put the swap on the back end.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.