LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-09-2020, 01:00 AM   #1
larstrier
Member
 
Registered: Dec 2019
Distribution: Debian
Posts: 46

Rep: Reputation: 18
Installing debian 10 onto usb


This page from debian.org says 'Debian CD and DVD images can now be written directly to a USB stick, which is a very easy way to make a bootable USB stick'.

If this is true then I should be able to have debian on usb by simply using the following commands:
Code:
# cp debian.iso /dev/sdX
# sync
This is fantastic. Unfortunately the links on the page do not send me to the location for the 'hybrid' debian-10-usb-with-persistance .iso file.
Does anyone know where I can find the appropriate .iso file please? (I will need the non-free version which I think exists)

If it is THIS easy to have debian on usb (which I don't believe) then surely people should be making tutorials of this everywhere to promote Linux distros.
Thank you everyone for reading.

Last edited by larstrier; 07-09-2020 at 01:02 AM.
 
Old 07-09-2020, 03:12 AM   #2
markd81
LQ Newbie
 
Registered: Jul 2020
Location: Netherlands
Distribution: Debian
Posts: 17

Rep: Reputation: 3
Debian has some unofficial non-free firmware live iso's to download from here.
 
1 members found this post helpful.
Old 07-09-2020, 03:58 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 14,923
Blog Entries: 9

Rep: Reputation: 4214Reputation: 4214Reputation: 4214Reputation: 4214Reputation: 4214Reputation: 4214Reputation: 4214Reputation: 4214Reputation: 4214Reputation: 4214Reputation: 4214
^ Yep.
Quote:
Originally Posted by larstrier View Post
This page from debian.org says 'Debian CD and DVD images can now be written directly to a USB stick, which is a very easy way to make a bootable USB stick'.
Also please understand that this is not the same as "Installing". You're creating an installation medium.
 
Old 07-09-2020, 04:11 AM   #4
captain_sensible
Member
 
Registered: Apr 2010
Posts: 259

Rep: Reputation: 84
i think with ventoy you can go one better https://ventoy.net/en/index.html

https://github.com/ventoy/Ventoy/releases

I just drag and dropped a few iso's and have the choice to boot from any one. It doesn't work with all iso
but quite some useful ones. Also it allows persistence via a 1 gig .img file. Again it doesn't work with all. Some tweaks also need to be done but for instance i got Mint Cinnamon 64 bit working with persistence using the img file with label casper-rw. Also slackware current install dvd iso boots fine
 
Old 07-09-2020, 06:06 AM   #5
larstrier
Member
 
Registered: Dec 2019
Distribution: Debian
Posts: 46

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by markd81 View Post
Debian has some unofficial non-free firmware live iso's to download from here.
Thank you that was exactly the link I was looking for.

I downloaded the .iso file, used the cp command from the debian.org page (above) and it worked!
On booting from the usb the debian-installer loaded and I went through the install process for Debian 10.

My only problem is I can't get past the 'partition' section.
I first choose to partition the whole disk (usb) and the installer creates 2 default partitions:
1. A large primary boot partition labelled 'f' and
2. A small logical swap partition labelled 'F'.

This looks fine to me and I continue on to the next stage.
But the installer says it failed to partition the usb.
I tried deleting the swap partition - but that only resulted in the same partition being labelled 'free space'.

Since I'm using a hybrid debian .iso file for a usb - I'm wondering if I'm supposed to partition the usb differently somehow.
 
Old 07-09-2020, 06:11 AM   #6
larstrier
Member
 
Registered: Dec 2019
Distribution: Debian
Posts: 46

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by ondoho View Post
^ Yep.

Also please understand that this is not the same as "Installing". You're creating an installation medium.
Does this mean I'm creating the debian-installer onto the usb?

In which case am I supposed to use the debian-installer to install onto a different target usb?
 
Old 07-09-2020, 07:00 AM   #7
colorpurple21859
Senior Member
 
Registered: Jan 2008
Location: florida panhandle
Distribution: slackware64-current, fedora,Xubuntu, others
Posts: 4,494

Rep: Reputation: 800Reputation: 800Reputation: 800Reputation: 800Reputation: 800Reputation: 800Reputation: 800
Quote:
Does this mean I'm creating the debian-installer onto the usb?

In which case am I supposed to use the debian-installer to install onto a different target usb?
Yes, that is what it means
If your want a live iso, with persistance and not a true install, you will need a second partition on the usb for storage. I don't think that can be done from the running usb

Last edited by colorpurple21859; 07-09-2020 at 07:04 AM.
 
1 members found this post helpful.
Old 07-09-2020, 07:29 AM   #8
larstrier
Member
 
Registered: Dec 2019
Distribution: Debian
Posts: 46

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by colorpurple21859 View Post
Yes, that is what it means
If your want a live iso, with persistance and not a true install, you will need a second partition on the usb for storage. I don't think that can be done from the running usb
Ok that makes sense.

Thank you very much everyone.
 
Old 07-09-2020, 11:02 AM   #9
larstrier
Member
 
Registered: Dec 2019
Distribution: Debian
Posts: 46

Original Poster
Rep: Reputation: 18
Still having problems with this Debian 10 install.
I used the usb with debian-installer to install Debian 10 onto a seperate usb.
Everything seemed to go smoothly until the last step - where to install grub?

The debian-installer asks whether to install grub bootloader onto the master boot record of my hard disk.
Since the OS is on a portable usb I set the grub bootloader to install onto my target usb instead.
But now after successfully completing the install the target usb will not boot.
What am I doing wrong?

Do I need to re-install grub onto the target usb?
Or do I need to do the install again - only this time installing grub bootloader onto the mbr of my hard disk?
 
Old 07-09-2020, 11:37 AM   #10
colorpurple21859
Senior Member
 
Registered: Jan 2008
Location: florida panhandle
Distribution: slackware64-current, fedora,Xubuntu, others
Posts: 4,494

Rep: Reputation: 800Reputation: 800Reputation: 800Reputation: 800Reputation: 800Reputation: 800Reputation: 800
Quote:
Do I need to re-install grub onto the target usb?
yes that would be a better solution.
The short version:
If you are going to use it on uefi systems the usb will need a 200MB fat32 partition mounted at the usb /boot/efi.
To reinstall grub boot the installer mount the usb roofs partition, mount the efi partition to the usb boot/efi, use mount --bind to mount /dev /proc /sys /run to the same directories of the usb, chroot <mount point of usb>
for efi run
Code:
grub-install --target=x86_64-efi-efi --removable
, for legacy
Code:
grub-install --target=i386-pc /dev/sd?
where ? will the usb letter.
Run update-grub to get a grub menu
I think debian will only install grub-efi or grub-i386pc you will have to use apt to install the missing grub-target.

Last edited by colorpurple21859; 07-09-2020 at 12:01 PM.
 
Old 07-09-2020, 07:52 PM   #11
larstrier
Member
 
Registered: Dec 2019
Distribution: Debian
Posts: 46

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by colorpurple21859 View Post
for legacy
Code:
grub-install --target=i386-pc /dev/sd?
where ? will the usb letter.
Run update-grub to get a grub menu
I think debian will only install grub-efi or grub-i386pc you will have to use apt to install the missing grub-target.
Thank you for your reply.
This is a little bit complicated as I don't know anything about programming.
I have BIOS.

Should I install grub from a working debian OS onto the target usb? Or do I boot debian-installer to do that?

Is it easier if I go through the whole install process again and install grub to the mbr of my harddisk?
In which case, will the usb boot on any other device?
 
Old 07-09-2020, 08:10 PM   #12
colorpurple21859
Senior Member
 
Registered: Jan 2008
Location: florida panhandle
Distribution: slackware64-current, fedora,Xubuntu, others
Posts: 4,494

Rep: Reputation: 800Reputation: 800Reputation: 800Reputation: 800Reputation: 800Reputation: 800Reputation: 800
Quote:
Should I install grub from a working debian OS onto the target usb? Or do I boot debian-installer to do that?
A working debian OS will be easier. To install on a bios system. plug in the usb and as root run
Code:
 parted -l
to determine what /dev your usb is and the partitions are. assuming the usb is /dev/sdb and the root partition is /dev/sdb2, for example purposes only(yours may be different and change acordingly) as root
Code:
mount /dev/sdb2 /mnt
grub-install --boot-directory=/mnt/boot /dev/sdb
find the UUID of the /dev/sdb2 with
Code:
lsblk -f
copy the /boot/grub/grub.cfg from debian over to the usb boot/grub.
edit the first debian menu entry and change uuids to match the uuid of /dev/sdb2 and kernel versions numbers of the kernels in the usb /boot.
Boot the usb and run update-grub

Last edited by colorpurple21859; 07-09-2020 at 08:27 PM.
 
1 members found this post helpful.
Old 07-09-2020, 08:16 PM   #13
colorpurple21859
Senior Member
 
Registered: Jan 2008
Location: florida panhandle
Distribution: slackware64-current, fedora,Xubuntu, others
Posts: 4,494

Rep: Reputation: 800Reputation: 800Reputation: 800Reputation: 800Reputation: 800Reputation: 800Reputation: 800
The usb should boot on other similar bios systems and uefi systems that have legacy/csm enabled.
 
1 members found this post helpful.
Old 07-09-2020, 10:05 PM   #14
larstrier
Member
 
Registered: Dec 2019
Distribution: Debian
Posts: 46

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by colorpurple21859 View Post
A working debian OS will be easier. To install on a bios system. plug in the usb and as root run
Code:
 parted -l
to determine what /dev your usb is and the partitions are. assuming the usb is /dev/sdb and the root partition is /dev/sdb2, for example purposes only(yours may be different and change acordingly) as root
Code:
mount /dev/sdb2 /mnt
grub-install --boot-directory=/mnt/boot /dev/sdb
After running 'parted -l' I get this:
Code:
Model: Samsung Flash Drive (scsi)
Disk /dev/sdg: 64.2GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type      File system     Flags
 1      1049kB  56.1GB  56.1GB  primary   ext4
 2      56.1GB  64.2GB  8048MB  extended
 5      56.1GB  64.2GB  8048MB  logical   linux-swap(v1)
I'm guessing the root partition is sdg2. But when I try to mount it I get the following error message:
Code:
# mount /dev/sdg2 /mnt
mount: wrong fs type, bad option, bad superblock on /dev/sdg2,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.
 
Old 07-09-2020, 10:42 PM   #15
colorpurple21859
Senior Member
 
Registered: Jan 2008
Location: florida panhandle
Distribution: slackware64-current, fedora,Xubuntu, others
Posts: 4,494

Rep: Reputation: 800Reputation: 800Reputation: 800Reputation: 800Reputation: 800Reputation: 800Reputation: 800
sdg1 is the partition it has an ext4 filessystem
Code:
mount /dev/sdg1 /mnt
grub-install --boot-directory=/mnt/boot /dev/sdg
sdg2 is an extented partition that the swap partition resides inside of.
An extended partition allows an msdos type disk to have more than 4 partitions

Last edited by colorpurple21859; 07-09-2020 at 10:50 PM.
 
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
LXer: Microsoft sneaks onto Android while Android sneaks onto Windows LXer Syndicated Linux News 0 03-01-2016 04:15 AM
[SOLVED] How Do I Install deDECTED onto Kali-Linux or Audacity onto BT5R2 mervselm Linux - Newbie 1 09-07-2014 06:14 PM
Installing Debian onto USB Flash Media Cotun Linux - General 2 04-04-2010 09:26 AM
Installing Debian onto external usb hard drive sublyme718 Linux - Newbie 2 02-28-2009 12:50 PM
Installing Debian 4.r4 onto USB Stick FROM boot DVD charliebrown_au Linux - Newbie 2 09-17-2008 04:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:10 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