LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 10-25-2017, 12:37 PM   #1
firenze465
Member
 
Registered: Oct 2017
Posts: 42

Rep: Reputation: Disabled
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!
 
Old 10-25-2017, 02:05 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,140

Rep: Reputation: 2307Reputation: 2307Reputation: 2307Reputation: 2307Reputation: 2307Reputation: 2307Reputation: 2307Reputation: 2307Reputation: 2307Reputation: 2307Reputation: 2307
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.
 
1 members found this post helpful.
Old 10-25-2017, 03:24 PM   #3
firenze465
Member
 
Registered: Oct 2017
Posts: 42

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by business_kid View Post
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?
 
Old 10-25-2017, 03:27 PM   #4
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
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)
 
1 members found this post helpful.
Old 10-25-2017, 03:46 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,592

Rep: Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880
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
 
1 members found this post helpful.
Old 10-26-2017, 03:01 AM   #6
andre@home
Member
 
Registered: Oct 2003
Distribution: 2x Debian 8.1 webdav servers
Posts: 93

Rep: Reputation: 44
Quote:
Originally Posted by michaelk View Post
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....
 
1 members found this post helpful.
Old 10-26-2017, 05:25 AM   #7
firenze465
Member
 
Registered: Oct 2017
Posts: 42

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by IsaacKuo View Post
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!
 
Old 10-26-2017, 05:36 AM   #8
firenze465
Member
 
Registered: Oct 2017
Posts: 42

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
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?
 
Old 10-26-2017, 05:57 AM   #9
firenze465
Member
 
Registered: Oct 2017
Posts: 42

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by andre@home View Post
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?
 
Old 10-26-2017, 12:33 PM   #10
andre@home
Member
 
Registered: Oct 2003
Distribution: 2x Debian 8.1 webdav servers
Posts: 93

Rep: Reputation: 44
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.
 
Old 10-26-2017, 01:39 PM   #11
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
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.
 
1 members found this post helpful.
Old 10-27-2017, 04:44 AM   #12
firenze465
Member
 
Registered: Oct 2017
Posts: 42

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by andre@home View Post
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.
 
Old 10-27-2017, 05:37 AM   #13
firenze465
Member
 
Registered: Oct 2017
Posts: 42

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by IsaacKuo View Post
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.
 
Old 10-27-2017, 07:27 AM   #14
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
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.
 
1 members found this post helpful.
Old 10-27-2017, 01:22 PM   #15
andre@home
Member
 
Registered: Oct 2003
Distribution: 2x Debian 8.1 webdav servers
Posts: 93

Rep: Reputation: 44
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
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Can't install debian onto usb Higgsboson Linux - Newbie 30 11-13-2016 07:24 AM
[SOLVED] Debian USB Install: "No Boot Sector on USB Device" on laptop juju Debian 8 04-24-2015 04:29 PM
Debian live usb install seising003 Debian 2 07-13-2012 08:15 AM
Debian USB install kushalkoolwal Debian 2 01-25-2009 06:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 07:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration