LinuxQuestions.org
Review your favorite Linux distribution.
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 11-12-2016, 07:25 AM   #1
Higgsboson
Member
 
Registered: Dec 2014
Location: UK
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508

Rep: Reputation: 49
Can't install debian onto usb


I have installed debian jessie onto a USB but now can't get the OS to open.

I went through the debian installer process and may have done something wrong.
I have a 16gb usb and want a full debian OS on it. That way, I can have a new OS when I boot from USB.
On the debian installer I selected the whole 16gb for the boot partition - I don't want a seperate partition for the 'home' folder. I also chose not to have swap as I have 8GB RAM and won't need hibernation.

I then chose xfce as the GUI and everything began installing onto the USB.
Now the difficult part. The installer asked where I wanted GRUB?
Should the new GRUB install take over the MBR on my HDD (sda), should I 'manually load the OS' (I don't know what this means), or should I install GRUB onto the usb? I chose to install GRUB to the usb.
But now when I boot from usb, it shows a message it's loading the OS but then just hangs.

So I think I've done something wrong with choosing the location of where to install GRUB.
I suppose this is an issue about correctly using the debian installer which I'm afraid is not easy to use.
Any help would be appreciated.
 
Old 11-12-2016, 08:09 AM   #2
BW-userx
Senior Member
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Void Linux / Slackware 14.2
Posts: 3,332

Rep: Reputation: 575Reputation: 575Reputation: 575Reputation: 575Reputation: 575Reputation: 575
Should the new GRUB install take over the MBR on my HDD (sda),

Install grub for that install on your USB to the USB mbr so it will have its own to rely on.

it's loading the OS but then just hangs.

you are loading a full install of Linux off a USB it will take a while to boot up. it has to shove all of that into your ram and whatever it needs to do. How long did you wait before you gave up?

boot it, walk away and come back after a bit to see if it worked.

I have a full install of Void on one of my USBSticks, I used a live version to boot into then used its install process to install it onto another USB Stick, installed grub onto the same USB Stick, and well it works fine.

you might want to change your fstab on the USB stick adding noatime look it up and see what it does for your USB Stick.

Last edited by BW-userx; 11-12-2016 at 08:16 AM.
 
Old 11-12-2016, 08:54 AM   #3
colorpurple21859
Senior Member
 
Registered: Jan 2008
Location: florida
Distribution: slackware64-current, puppy, ubuntu
Posts: 1,967

Rep: Reputation: 274Reputation: 274Reputation: 274
Quote:
it shows a message it's loading the OS but then just hangs.
at the grub menu hit the letter e for edit and at the linux line delete quiet and/or splash if it exist.
 
Old 11-12-2016, 08:56 AM   #4
Higgsboson
Member
 
Registered: Dec 2014
Location: UK
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by BW-userx View Post
[B]
Install grub for that install on your USB to the USB mbr so it will have its own to rely on.
Yes, that's what I did. However, I don't think it worked for some reason.

Quote:
you are loading a full install of Linux off a USB it will take a while to boot up. it has to shove all of that into your ram and whatever it needs to do.
Why would it put everything into ram? The usb is simply an ssd. The OS should load faster.

Quote:
boot it, walk away and come back after a bit to see if it worked.
I waited for over 10mins and it's still just hanging.

Quote:
I have a full install of Void on one of my USBSticks, I used a live version to boot into then used its install process to install it onto another USB Stick, installed grub onto the same USB Stick, and well it works fine.
Yes, that's what I'm trying to do. But I think I'm having problems with where to install grub or something.

Quote:
you might want to change your fstab on the USB stick adding noatime look it up and see what it does for your USB Stick.
That's an idea. But I wanted the OS to boot up first. Is it ok to have the whole 16gb as the boot partition with no other partitions?
 
Old 11-12-2016, 09:02 AM   #5
Higgsboson
Member
 
Registered: Dec 2014
Location: UK
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by colorpurple21859 View Post
at the grub menu hit the letter e for edit and at the linux line delete quiet and/or splash if it exist.
Can I edit the grub file on the usb by mounting it?
 
Old 11-12-2016, 09:23 AM   #6
BW-userx
Senior Member
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Void Linux / Slackware 14.2
Posts: 3,332

Rep: Reputation: 575Reputation: 575Reputation: 575Reputation: 575Reputation: 575Reputation: 575
AH getting past the grub installing onto that USB Stick problem.

someone shared with me this and it worked. I was getting errors or a fail when ever I tired installing grub onto the Stick.

Code:
dd if=/dev/zero of=/dev/sdx bs=512 count=1
to clear the stick mbr then install Linux onto it. having it install grub onto the usb stick mbr ...

That's an idea. But I wanted the OS to boot up first. Is it ok to have the whole 16gb as the boot partition with no other partitions?

that is what I did, it seems only logical. trying to manage two partitions on such a small space seems silly to me.

mounting the usb stick - if it has its file system there YES you can get into it and do whatever your heart desires. auto mount it using the file manager even or through the terminal.

Code:
cd /run/media/userName/UsbMountPoint
sudo geany /etc/grub.d/filename
or how ever your system auto mounts. or you can do the mount /dev/sdxx /mnt cli
what ever works for you.

the steps I did where

1. dd my USB Stick
2. booted using a live install of the same Linux version
3. in setup/install when I got to where to install I selected /dev/sdd1 (or whatever it was)
4. installed grub onto /dev/sdd
5. reboot pulling the live out, and keeping the freshly installed pluged in, hit the keys I needed to select which to boot off of, then booted into my freshly installed Linux on USB Stick, then did the usual post install stuff needed to be done. then added that noatime to fstab and such.

Last edited by BW-userx; 11-12-2016 at 09:25 AM.
 
Old 11-12-2016, 09:32 AM   #7
ondoho
Senior Member
 
Registered: Dec 2013
Posts: 4,899

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
oops.

Last edited by ondoho; 11-12-2016 at 09:53 AM.
 
Old 11-12-2016, 09:39 AM   #8
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Back to Debian, and only Debian.
Posts: 1,158
Blog Entries: 7

Rep: Reputation: 327Reputation: 327Reputation: 327Reputation: 327
Quote:
Originally Posted by Higgsboson View Post
Should the new GRUB install take over the MBR on my HDD (sda), should I 'manually load the OS' (I don't know what this means), or should I install GRUB onto the usb? I chose to install GRUB to the usb.
You want it to install to the MBR of whatever device the USB flash drive was. If it was /dev/sda then that is what you'll want. Make sure you get this correct or it will install to the wrong drive.

Quote:
Can I edit the grub file on the usb by mounting it?
Yes, you can, but the changes will be permanent until you change them back - if at all desired (you're looking for <mount point>/boot/grub/grub.cfg). What colorpurple suggested will affect that boot only. Do what (s)he suggested, and if it is indeed locking up, you'll get the information as to where.

Just a tip: when I was running an install of GNU/Linux from a USB flash drive, depending on how that device sat in the USB port, I would get a kernel panic on boot. Re-seating the device may help, if such turns out to be your case.
 
Old 11-12-2016, 09:58 AM   #9
Higgsboson
Member
 
Registered: Dec 2014
Location: UK
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by BW-userx View Post
AH getting past the grub installing onto that USB Stick problem.
I see. So this is a known problem.

Quote:
Code:
dd if=/dev/zero of=/dev/sdx bs=512 count=1
to clear the stick mbr then install Linux onto it. having it install grub onto the usb stick mbr ...
This is a lot of info. I think I had already prepared to put full debian onto usb but didn't complete it. Now I've forgotten what to do.

I have a usb (extreme) and when I boot from it - it gives me the debian installer menu to install an OS. What is this anyway? It must have an iso file on it. I remember I used a dd command to put the installer onto it.

I have another usb (ultra) which I installed debian onto by booting the usb (extreme) which has the installer menu on it. Previously the usb (ultra) had debian live on it but now it's overwritten.

Quote:
the steps I did where

1. dd my USB Stick
What is this step? Is it deleting everything from the target usb preparing it for an install of a full debian OS?

Quote:
2. booted using a live install of the same Linux version
Can I use the usb (extreme) which already has a debian installer on it?

Quote:
3. in setup/install when I got to where to install I selected /dev/sdd1 (or whatever it was)
So sdd1 is your boot partition. Is that right?

Quote:
4. installed grub onto /dev/sdd
I believe that's what I did but that's the annoying thing.

Quote:
then added that noatime to fstab and such.
Why do that on your usb OS?
 
Old 11-12-2016, 10:21 AM   #10
BW-userx
Senior Member
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Void Linux / Slackware 14.2
Posts: 3,332

Rep: Reputation: 575Reputation: 575Reputation: 575Reputation: 575Reputation: 575Reputation: 575
Quote:
Originally Posted by Higgsboson View Post
I see. So this is a known problem.



This is a lot of info. I think I had already prepared to put full debian onto usb but didn't complete it. Now I've forgotten what to do.

I have a usb (extreme) and when I boot from it - it gives me the debian installer menu to install an OS. What is this anyway? It must have an iso file on it. I remember I used a dd command to put the installer onto it.
I know nothing about this extreme in which you speak of. unless that is what the USB brand name is calling it.

Quote:
Originally Posted by Higgsboson View Post
I have another usb (ultra) which I installed debian onto by booting the usb (extreme) which has the installer menu on it. Previously the usb (ultra) had debian live on it but now it's overwritten.
Quote:
Originally Posted by Higgsboson View Post
What is this step? Is it deleting everything from the target usb preparing it for an install of a full debian OS?
that is the
Code:
dd if=/dev/zero of=/dev/sdx bs=512 count=1
it writes zeros over the first 512 kb of the stick 1 time. to remove everything. clearing it.

Quote:
Originally Posted by Higgsboson View Post
Can I use the usb (extreme) which already has a debian installer on it?
as far as the type of USB Stick you are using for which ever one it shouldn't matter, I only advice using the fastest stick to install the full version of Linux onto it. that will increase boot times. (when you finally get this to work)


Quote:
Originally Posted by Higgsboson View Post
So sdd1 is your boot partition. Is that right?
yes the ssd1 was the example of the USB Stick partition I installed to. the sdd was the same sticks mbr to install grub to.

if you install grub onto your hard drive during this install it will do what?
what will that grub install change to effect how your system(s) will boot?

1. It will cause that usb stick to be placed first on the list to boot from.
if that stick is not present when the timeout comes then you'll get an error.

2. it is not a big deal. boot into your what should be the second on the list to boot from, being your hdd then just reinstall grub onto your base systems MBR over writing that old grub, it that one will over take the old one. Leaving you with your base system first on the list.

now how to fix the grub to get into your USB to fix that.

simple: keep it plugged in then run update grub, reboot. keeping it plugged in. then select it to boot into, then when your in that usb stick (try) installing grub onto its mbr. letting it update every system it sees. that is not a big deal, because of rule one. the USB will be first on the list to boot.

I have not tried that . but that is the logical sequence of events that will take place.

keep it simple. Just install grub to your USB Stick you installed the full version of Linux on.


Quote:
Originally Posted by Higgsboson View Post
I believe that's what I did but that's the annoying thing.
Why do that on your usb OS?

noatime is for cutting back on write to disk times, it helps save your USB from writes to it, causing it to wear out faster.

https://www.howtoforge.com/reducing-...s-with-noatime

http://tldp.org/LDP/solrhe/Securing-...hap6sec73.html

review:
the steps I did where

1. prep stick by using dd to zero out the mbr
Code:
dd if=/dev/zero of=/dev/sdx bs=512 count=1
2. boot which ever USB Stick has your live install.
3. in setup/install choose the USB Stick you what to install to, mount point /dev/sdxx
4. when installing grub Install it to the very same USB Stick device point (MBR) /dev/sdx

tricky part, it all has to do with timing.

5. reboot pulling the live out, and keeping the freshly installed plugged in, hit the keys I needed to select which to boot off of, then booted into my freshly installed Linux on USB Stick, then did the usual post install stuff needed to be done. then added that noatime to fstab and such.

OR
6. shut down your PC completely, then keep the freshly installed to USB Stick still plugged in. then turn on, hit whatever keys you need to to get to boot sequence. Select your boot from USB then go for it. cross fingers and hope it works.


Last edited by BW-userx; 11-12-2016 at 10:26 AM.
 
1 members found this post helpful.
Old 11-12-2016, 10:31 AM   #11
Higgsboson
Member
 
Registered: Dec 2014
Location: UK
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by goumba View Post
You want it to install to the MBR of whatever device the USB flash drive was. If it was /dev/sda then that is what you'll want. Make sure you get this correct or it will install to the wrong drive.
Ok, that's good to know.


Quote:
Yes, you can, but the changes will be permanent until you change them back - if at all desired (you're looking for <mount point>/boot/grub/grub.cfg). What colorpurple suggested will affect that boot only. Do what (s)he suggested, and if it is indeed locking up, you'll get the information as to where.
I removed 'quiet' from grub.cfg on the usb which appears about 6 times. There is no 'splash' on the file.
However, it still hangs when booting from the usb.

[/QUOTE]Just a tip: when I was running an install of GNU/Linux from a USB flash drive, depending on how that device sat in the USB port, I would get a kernel panic on boot. Re-seating the device may help, if such turns out to be your case.[/QUOTE]

Does this mean taking it out and putting it in again while there is a message saying the OS is loading?
 
Old 11-12-2016, 10:38 AM   #12
BW-userx
Senior Member
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Void Linux / Slackware 14.2
Posts: 3,332

Rep: Reputation: 575Reputation: 575Reputation: 575Reputation: 575Reputation: 575Reputation: 575
IF YOU ALREADY HAVE that Debian installed onto your USB and it is hanging. you could try this.

keep it plugged in. then from your base system, run update-grub it should pick up your USB Linux install. Then using your BASE SYSTEM grub boot list choose your USB STICK off of that listing and see if you can boot into it. then if yes you can try doing some damage control/ troubling shooting.


this is what my update-grub did,
Code:
userx@voided1.what~>> sudo update-grub
Generating grub configuration file ...
Found background: /usr/share/void-artwork/splash.png
Found linux image: /boot/vmlinuz-4.8.7_1
Found initrd image: /boot/initramfs-4.8.7_1.img
Found Slackware Linux (Slackware 14.2) on /dev/sda1
Found Windows 10 (loader) on /dev/sdb1
Found BunsenLabs GNU/Linux 8.5 (Hydrogen) (8.5) on /dev/sdb3
Found Void Linux 64 on /dev/sdd1
done
the high lighted is my USB STICK with the full Linux System install on it.

if it still hangs then that should tell you what?

Last edited by BW-userx; 11-12-2016 at 10:44 AM.
 
Old 11-12-2016, 12:00 PM   #13
Higgsboson
Member
 
Registered: Dec 2014
Location: UK
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by BW-userx View Post
the high lighted is my USB STICK with the full Linux System install on it.

if it still hangs then that should tell you what?
I have done a full re-install of the usb. I installed the root file system onto sdb1 and grub onto sdb.
However, it still hangs when booting from usb.

I have tried 'update-grub' and it's found grub on the usb.

When I select the usb from the grub menu, I get this:
Code:
error: no such device: (UUID number)
      error: hd5 cannot get C/H/S values
      error: you need to load the kernel first.
 
Old 11-12-2016, 12:24 PM   #14
BW-userx
Senior Member
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Void Linux / Slackware 14.2
Posts: 3,332

Rep: Reputation: 575Reputation: 575Reputation: 575Reputation: 575Reputation: 575Reputation: 575
Quote:
Originally Posted by Higgsboson View Post
I have done a full re-install of the usb. I installed the root file system onto sdb1 and grub onto sdb.
However, it still hangs when booting from usb.

I have tried 'update-grub' and it's found grub on the usb.

When I select the usb from the grub menu, I get this:
Code:
error: no such device: (UUID number)
      error: hd5 cannot get C/H/S values
      error: you need to load the kernel first.
i have no idea, but taking from that is says, error: no such device: (UUID number).
if you are using your main system grub to boot it, then unplug all of your USB ports, this should make whatever you plug into your first USB show it what?

depending on how many internal hdds you have plus partitions off of them, the next letter scheme.
You should know that much.

then go into your /boot/grub/ make a backup copy of grub.cfg. then edit grub.cfg looking for your USB entry. change the root=UUID=anvavavaer9249243g to root=/dev/xxx save , reboot, then see what that does for you.

it maybe none matching UUIDs .
blkid will give you uuid's with your USB plugged in then you can also before modding anything check to see if you can find the same UUID number in the grub.cfg corresponding to your usb stick entry. to see if that is actually the problem, no matching.

you basically just need to have within your grub.cfg the same "address" to your usb boot, and root on the USB Stick so it knows where to look to load it.

example
Code:
linux /boot/vmlinuz-huge-4.4.23 root=/dev/sda1 ro
as you see no UUID are being used.
I had to put my USB Stick back in grub.cfg
Code:
	menuentry 'Void GNU/Linux, with Linux 4.5.2_1 (on /dev/sdd1)'
...
.
.
.

	fi
		linux /boot/vmlinuz-4.5.2_1 root=UUID=1a938c27-9e99-4384-bdb2-e95d5f0d18f8 ro single
		initrd /boot/initramfs-4.5.2_1.img
make that high lighted look like this,
Code:
root=/dev/sdd1 ro single
then only having one usb port used, so your numbering scheme does not change, reboot then try getting in.

Last edited by BW-userx; 11-12-2016 at 12:32 PM.
 
Old 11-12-2016, 01:17 PM   #15
Higgsboson
Member
 
Registered: Dec 2014
Location: UK
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by BW-userx View Post

it maybe none matching UUIDs .
I have looked at grub.cfg and the UUID matches with the OS.

I did a search on the error message ubuntuforums.org and came across this: 'One is error in partition table which causes grub to fail on search to find correct partition to boot from and very large / (root) partition'.

The usb has only one partition which is /root. And it's 16gb in size.
Maybe I should have the root partition smaller or maybe a separate boot partition?
 
  


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] Debian USB Install: "No Boot Sector on USB Device" on laptop juju Debian 8 04-24-2015 04:29 PM
Debian USB install kushalkoolwal Debian 2 01-25-2009 06:33 PM
install usb printer in debian hellpos Linux - Hardware 0 08-03-2004 08:40 AM
How to install Debian from a USB CDROM kkempter Linux - Software 0 12-11-2003 08:04 PM


All times are GMT -5. The time now is 05:26 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration