[SOLVED] Trying to boot from USB, but boots from hard drive

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
HarryZ
Level 1
Level 1
Posts: 40
Joined: Sun Feb 26, 2017 4:20 am

[SOLVED] Trying to boot from USB, but boots from hard drive

Post by HarryZ »

Aloha everyone.

I have a dual-boot machine: Mint 18.1 and Windows 7.1 (installed first). It took a while to get the programs I want and the network drive connections I need on the Mint system, but with some help from the good folks here, I got it done. Then I decided that I wanted that Mint system available on a USB stick, so I used Clonezilla (I think) to copy the Linux partitions over to the USB stick. It works great, but there is an issue I cannot figure out.

There have been a couple of times I wanted to use the USB stick on the machine that I used to create it. During boot, I press F11 to bring up the one-time-boot menu and I select the USB drive to boot from. Subsequently I get the Grub2 screen and select Mint. But, even though I thought I was booting from the USB stick, what seems to boot up after I select Mint in the Grub menu is the Mint on the hard drive! This is indicated by the Boot Repair program. (Is there another way to do this?)

I'm assuming this is due to cloning the hard drive to the USB stick, but I have no idea how to fix this.

Any suggestions?

Mahalo,

Harry Z
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Trying to boot from USB, but boots from hard drive

Post by catweazel »

HarryZ wrote: Thu Jun 21, 2018 12:01 am I used Clonezilla ... what seems to boot up after I select Mint in the Grub menu is the Mint on the hard drive!
That's to be fully expected. You've cloned the HDD to the USB drive so your USB behaves as if it's loading from the HDD because that's where GrUB points to.

https://askubuntu.com/questions/145241/ ... m-a-livecd

See that. You don't need to boot from a live cd, just boot into your normal Mint then follow the instructions to chroot into the root of your USB drive.

Also see this: http://www.vijaytechnology.com/2011/06/ ... ubuntu-cd/

Same thing.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
User avatar
Flemur
Level 20
Level 20
Posts: 10096
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Trying to boot from USB, but boots from hard drive

Post by Flemur »

HarryZ wrote: Thu Jun 21, 2018 12:01 amI used Clonezilla (I think) to copy the Linux partitions over to the USB stick. It works great, but there is an issue I cannot figure out.

Subsequently I get the Grub2 screen and select Mint. But, even though I thought I was booting from the USB stick, what seems to boot up after I select Mint in the Grub menu is the Mint on the hard drive! This is indicated by the Boot Repair program. (Is there another way to do this?)
You might be having problems with duplicate UUIDs; Clonzilla clone = the USB partitions have the same UUIDs as the HD partitions they were copied from.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
HarryZ
Level 1
Level 1
Posts: 40
Joined: Sun Feb 26, 2017 4:20 am

Re: Trying to boot from USB, but boots from hard drive

Post by HarryZ »

catweazel wrote: Thu Jun 21, 2018 2:17 am
HarryZ wrote: Thu Jun 21, 2018 12:01 am I used Clonezilla ... what seems to boot up after I select Mint in the Grub menu is the Mint on the hard drive!
That's to be fully expected. You've cloned the HDD to the USB drive so your USB behaves as if it's loading from the HDD because that's where GrUB points to.

https://askubuntu.com/questions/145241/ ... m-a-livecd

See that. You don't need to boot from a live cd, just boot into your normal Mint then follow the instructions to chroot into the root of your USB drive.

Also see this: http://www.vijaytechnology.com/2011/06/ ... ubuntu-cd/

Same thing.
Mahalo @catweazel for the quick response. I'm still pretty much a novice with Linux, so I decided to follow the more specific step-by-step instructions in your second link. Unfortunately, I ran into a problem and would appreciated some additional guidance.

Booted my machine withOUT the USB drive to ensure I booted from the hard drive. After logging on, I inserted the USB stick. Per the instructions, ran a 'sudo fdisk /l' command to identify the various devices and partitions. My Mint partition on the USB stick is sdb1 as indicated in this output:

Code: Select all

harryz@LinuxBench ~ $ sudo fdisk -l
[sudo] password for harryz: 
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xa2fe96eb

Device     Boot      Start        End    Sectors   Size Id Type
/dev/sda1  *          2048     206847     204800   100M  7 HPFS/NTFS/exFAT
/dev/sda2           206848 1098465271 1098258424 523.7G  7 HPFS/NTFS/exFAT
/dev/sda3       1098465278 1953523711  855058434 407.7G  5 Extended
/dev/sda5       1098465280 1202444287  103979008  49.6G 83 Linux
/dev/sda6       1937002496 1953523711   16521216   7.9G 82 Linux swap / Solaris


Disk /dev/sdb: 59.6 GiB, 64019759104 bytes, 125038592 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xb0b02cac

Device     Boot     Start       End   Sectors  Size Id Type
/dev/sdb1            2048 103981055 103979008 49.6G 83 Linux
/dev/sdb2       103981056 120502271  16521216  7.9G 82 Linux swap / Solaris
The next step (Step 4 in the directions) is to do a 'sudo mount /dev/sdb1 /mnt' command. This completed with no error messages.

Step 5 is to do a 'sudo mount –bind /dev /mnt/dev' command. This produces a long output that starts like this:

Code: Select all

harryz@LinuxBench ~ $ sudo mount –bind /dev /mnt/dev

Usage:
 mount [-lhV]
 mount -a [options]
 mount [options] [--source] <source> | [--target] <directory>
 mount [options] <source> <directory>
 mount <operation> <mountpoint> [<target>]

Mount a filesystem.
There is a lot more after this, but I believe that this indicates an issue with the command. Unfortunately, I'm not conversant enough with Linux to understand what went wrong. If I look at /mnt, there is a /dev subdirectory with a bunch of stuff in it.

Your assistance is greatly appreciated.

Mahalo,

Harry Z
Sir Charles

Re: Trying to boot from USB, but boots from hard drive

Post by Sir Charles »

@HarryZ
Flemur wrote: Thu Jun 21, 2018 1:00 pm You might be having problems with duplicate UUIDs; Clonzilla clone = the USB partitions have the same UUIDs as the HD partitions they were copied from.
This is a very plausible explanation. I ran into a similar problem recently after having cloned a partition where resided LM 18.3 to another partition to be used as a testing OS. Both ended up having the same UUID thus leading to boot issues. If you like you could boot up your LM on the hard drive, connect your USB and run the following command in a terminal and compare the UUID for the partitions:

Code: Select all

sudo blkid -o list
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Trying to boot from USB, but boots from hard drive

Post by catweazel »

HarryZ wrote: Thu Jun 21, 2018 4:45 pm

Code: Select all

harryz@LinuxBench ~ $ sudo mount –bind /dev /mnt/dev
Use --bind, two dashes, or -B, single dash. The instructions are wrong. My apologies. I should have seen that.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
User avatar
Flemur
Level 20
Level 20
Posts: 10096
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Trying to boot from USB, but boots from hard drive

Post by Flemur »

Marziano wrote: Thu Jun 21, 2018 5:46 pmBoth ended up having the same UUID thus leading to boot issues.
The last time I actually "cloned" a partition, I ended up with the OS ("/") partition and its clone (w/same UUID) both mounted to "/" as shown in gparted. I've never cloned a partition since, and can't see the point of it most of the time vs just copying files.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
HarryZ
Level 1
Level 1
Posts: 40
Joined: Sun Feb 26, 2017 4:20 am

Re: Trying to boot from USB, but boots from hard drive

Post by HarryZ »

catweazel wrote: Fri Jun 22, 2018 1:42 am
HarryZ wrote: Thu Jun 21, 2018 4:45 pm

Code: Select all

harryz@LinuxBench ~ $ sudo mount –bind /dev /mnt/dev
Use --bind, two dashes, or -B, single dash. The instructions are wrong. My apologies. I should have seen that.
Did the procedure again using --bind and things seemed to work. But, after completing everything, the system still boots from the hard drive instead of the USB stick.

I checked the UUID per another post, and the UUID of both the LM partition on the USB stick and the hard drive are the same.

I cloned the system as I had done some customization of LM and wanted the same customizations on the USB stick. If there is another way to duplicate / clone the LM on the hard drive to the USB stick that will alleviate this problem, that would be fine with me.

Mahalo for your continued assistance.

Harry Z
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Trying to boot from USB, but boots from hard drive

Post by catweazel »

HarryZ wrote: Fri Jun 22, 2018 8:23 pm the UUID of both the LM partition on the USB stick and the hard drive are the same.
http://www.sudo-juice.com/how-to-change ... partition/

Don't forget to edit the fstab on the flash drive and update the UUID. Of course, the easiest way to do what you've spent all this time doing is simply to install to the flash drive. After installing, perform an update then use Aptik to bring the flash drive installation up to date with the same applications on your main machine.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
HarryZ
Level 1
Level 1
Posts: 40
Joined: Sun Feb 26, 2017 4:20 am

Re: Trying to boot from USB, but boots from hard drive

Post by HarryZ »

catweazel wrote: Fri Jun 22, 2018 8:36 pm
HarryZ wrote: Fri Jun 22, 2018 8:23 pm the UUID of both the LM partition on the USB stick and the hard drive are the same.
http://www.sudo-juice.com/how-to-change ... partition/

Don't forget to edit the fstab on the flash drive and update the UUID. Of course, the easiest way to do what you've spent all this time doing is simply to install to the flash drive. After installing, perform an update then use Aptik to bring the flash drive installation up to date with the same applications on your main machine.
Mahalo for the link on how to generate and change the UUID for the flash drive. Only obstacle was figuring out how to edit fstab on the flash drive, but I eventually figured it out.

Rebooted after making the changes and selected Linux Mint. Boot failed with some error messages that I assume were coming from grub. Decided to re-do all the steps from your first post and now I can boot from the flash drive! Mahalo nui loa (thank you very much) to you, and to all the other folks who chipped in with advice. Much appreciated!

Now, on to the actual task that I started on... Moved my dual boot system (Mint & Win 10) to an SSD and will be using that flash drive to fix grub on the new hard drive.

Harry Z.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Trying to boot from USB, but boots from hard drive

Post by catweazel »

HarryZ wrote: Mon Jun 25, 2018 11:22 pm Much appreciated!
You're most welcome.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
Locked

Return to “Installation & Boot”