LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   How to install Debian 9 onto usb (https://www.linuxquestions.org/questions/debian-26/how-to-install-debian-9-onto-usb-4175616380/)

firenze465 10-25-2017 12:37 PM

How to install Debian 9 onto usb
 
I would like to install debian 9 onto usb but not sure how to do it.

I currently use debian 8 on my desktop which was installed by a friend.
But can anyone say how I can have linux on usb?

There is a debian-installer which I think I need to download to a usb.
After that, I'm not sure what to do. Any help would be great. Thanks everyone!

business_kid 10-25-2017 02:05 PM

If they have usb instructions, follow them. Otherwise get the iso, and the key things are
1. Your bios must boot to usb
2. To transfer the iso, use
Code:

dd if=<your_iso> of=/dev/sdb
not /dev/sdb1. It has to provide the boot sector, and a partition tabe screws it up. Replace sdb with whatever the usb drive shows up as.

firenze465 10-25-2017 03:24 PM

Quote:

Originally Posted by business_kid (Post 5773803)
If they have usb instructions, follow them. Otherwise get the iso, and the key things are
1. Your bios must boot to usb
2. To transfer the iso, use
Code:

dd if=<your_iso> of=/dev/sdb
not /dev/sdb1. It has to provide the boot sector, and a partition tabe screws it up. Replace sdb with whatever the usb drive shows up as.


Ok, I'll give it a go. But what happens after that?
Does this mean if I boot from usb I'll go thru the install wizard for Debian 9?

IsaacKuo 10-25-2017 03:27 PM

There are numerous ways to install Debian. I usually put the netinst installer onto a CD-ROM, and boot the installer off the CD-ROM. Then at that point, it treats any attached USB drive just like any other drive. You can install onto a USB drive just like any internal drive.

Most people don't have a big stack of blank CDRs just lying around, so most people put the installer on a USB thumbstick. You can boot that USB thumbstick in order to install onto a different USB drive. In other words, the easiest way to do it is to have two USB drives. One that you put the netinst installer on, and the other which you install onto after booting up the installer.

There are also various other ways to install Debian onto a USB drive from your existing debian 8 system (such as debootstrap)

michaelk 10-25-2017 03:46 PM

Welcome to LinuxQuestions.

There are two versions. One is just the installer and the other is a live version. The live version runs just like the real thing except it can not save settings/updates etc and the installer is just for installing the operating system.

In either case if you want a regular debian installation you would need a second USB flash drive. You will need to be careful when formatting to select the second flash drive and not the hard drive. I suggest reading the documentation.

https://www.debian.org/releases/stable/installmanual

andre@home 10-26-2017 03:01 AM

Quote:

Originally Posted by michaelk (Post 5773832)
The live version runs just like the real thing except it can not save settings/updates etc and the installer is just for installing the operating system.[/url]

This is only true when you install the Live iso directly on the USB stick or external USB drive.
You can also install Debian as "persistent", so the settings are saved. I did not check the updates option yet.

This is how I did it: made my own live USB stick with persistent settings.
Quote:

It is now configured in such a way that when my boot disk would fail... the live usb has all the settings to make it a replacement.
After rebooting I can continue immediately. Later I can put back my image or do other things to repair the system.

For Debian 8.1 it works similar, just adapt names...
http://cosmolinux.no-ip.org/raconetl...rsistence.html

Works like a charm....
PS: of course my live passwords are as on the original disk....

firenze465 10-26-2017 05:25 AM

Quote:

Originally Posted by IsaacKuo (Post 5773829)
Most people don't have a big stack of blank CDRs just lying around, so most people put the installer on a USB thumbstick. You can boot that USB thumbstick in order to install onto a different USB drive. In other words, the easiest way to do it is to have two USB drives. One that you put the netinst installer on, and the other which you install onto after booting up the installer

Thankfully I do have 2 usb thumbsticks.
So how do I install the netinst installer onto a usb?


Quote:

There are also various other ways to install Debian onto a USB drive from your existing debian 8 system (such as debootstrap)
I have looked up debootstrap on the debian wiki.
It's a very convenient way of installing a new debian system onto a new partition.
This is of course if you have an existing debian system like me.

However, the method is a little complicated and the wiki doesn't say if the debootstrap method will install to usb (i.e. removable device rather than a hdd partition).
So for the moment I'll use the '2 usb' method.

However in the future, I can't see why the debootstrap method isn't used to install all new debian systems.
It doesn't need cd or usb!

firenze465 10-26-2017 05:36 AM

Quote:

Originally Posted by michaelk (Post 5773832)
if you want a regular debian installation you would need a second USB flash drive. You will need to be careful when formatting to select the second flash drive and not the hard drive. I suggest reading the documentation.

https://www.debian.org/releases/stable/installmanual

The link seems to say I need to put debian-installer onto usb and then boot the usb (to install a debian system onto a separate usb).

Is this right? In which case, how do I get debian-installer onto a usb?

firenze465 10-26-2017 05:57 AM

Quote:

Originally Posted by andre@home (Post 5773969)
This is how I did it: made my own live USB stick with persistent settings.

Debian Live can be used to install 'A full install of Debian to the computer's hard drive can be initiated from the live image environment''

Also, debian live can be used for 'data recovery, computer forensics, disk imaging, system recovery and malware removal'

In which case, I think it's better to install Debian Live with persistence onto usb.
So this means I won't need to install debian-installer onto usb.
Is this right?

andre@home 10-26-2017 12:33 PM

If you want a reasonable complete, but limited in size, fully on a USB workind Debian.... then you can try my advice.
For the first time do exactly what is in the link using Debian 7 Live iso (i think so out of my mind).
This should work... it worked at my places too. So.. if it does not work find out why it does not and fix that...
Then take a new usb stick as they are cheap.....
Make a live USB again but now with Debian 9.
If it does not work... try to compare it with the working Debian 7 live usb...

Have fun in making it.

PS: my live usb contains all the safety measures here... else I would have uploaded by version to test.
I also use it on other systems when i have a problem, easy to do when you comment the hard disks out with a "#" on fstab (without the ""). If you do not comment them out... the desktop will not start you will come in some rescue mode, not the normal desktop.

IsaacKuo 10-26-2017 01:39 PM

I would do a traditional install rather than Debian Live, unless there is a specific reason you prefer Debian Live over normal Debian. I use normal Debian installs on USB sticks. A fast USB3.0 thumbdrive is even a great cheap alternative to an SSD for computers that have a USB3.x port.

For better or worse, Debian Live is not as well supported as normal Debian, and it never will be.

The netinst CD image can be downloaded from here:

https://www.debian.org/CD/netinst/

To get the netinst CD image to a USB thumbdrive, see this documentation:

https://www.debian.org/releases/stab...h04s03.html.en

Note that this will blow away the current contents of the target thumbdrive. Basically:

Code:

su
fdisk -l
dd if=debian-9.2.1-amd64-netinst.iso of=/dev/sdZ

Replace "sdZ" with the device of your thumbdrive - probably sdb. You use the command "fdisk -l" to list the currently attached drives. This will let you know for sure where the output of "dd" should go.

This will prepare your netinst install drive. Note that the image iso is purposefully designed to be bootable whether it is burned to a CDR or it is written onto a USB thumbdrive.

firenze465 10-27-2017 04:44 AM

Quote:

Originally Posted by andre@home (Post 5774133)
Make a live USB again but now with Debian 9.
If it does not work... try to compare it with the working Debian 7 live usb...

This is the setup I was looking for.
A debian Live usb and a Debian 9 usb.
However, a Debian 9 usb seems to function the same as debian Live.

In which case, I'm gonna go for a debian 9 install onto usb.
The main difference seems to be that debian live exists in RAM and has fewer 'write cycles'.

But the full-fat debian 9 on usb can do an 'apt-get upgrade' and also should be more stable.

firenze465 10-27-2017 05:37 AM

Quote:

Originally Posted by IsaacKuo (Post 5774157)
To get the netinst CD image to a USB thumbdrive, see this documentation:

https://www.debian.org/releases/stab...h04s03.html.en

Thank you this is very helpful.

The tutorial has lots of options. But I wonder why it isn't simplified to:

1. Get the right iso file.
2. Just use the 'dd' command.
3. Now boot the usb.

The tutorial seems to be made for a hybrid 'live' iso rather than a full debian iso.

IsaacKuo 10-27-2017 07:27 AM

No, "hybrid" iso means the netinst installer iso can be used on either CDR or USB drive. The normal official Debian installer is completely separate from Debian Live.

andre@home 10-27-2017 01:22 PM

A live iso is a complete Debian, similar to the one you can download as CD or DVD.
You can use any suitable tool to make it work on a usb stick.
Like https://unetbootin.github.io/
When you do that just like that, it is only a basic live Debian usb, so NOT persistent.

The method I used to make it persistent came from:
http://cosmolinux.no-ip.org/raconetl...rsistence.html
A did not check whether you can use a normal live CD/DVD instead.


Found other tutorials to make it persistent: I did NOT check them on working. my own procedure worked.
https://www.linux.com/blog/creating-...ce-non-techies
http://forums.debian.net/viewtopic.php?f=17&t=133558
http://debian.profijt.info/?page_id=54
https://www.youtube.com/watch?v=iwhatcxjSbQ
http://www.won48.com/software/debian...ng_Windows.pdf


All times are GMT -5. The time now is 09:26 AM.