LinuxQuestions.org
Help answer threads with 0 replies.
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 08-04-2016, 03:40 PM   #1
hilltownboy
Member
 
Registered: Jan 2008
Location: Ashfield, MA
Distribution: Debian 9 "Stretch", Arch
Posts: 115

Rep: Reputation: 15
Boot usb disk partition copied by dd?


With an operating system copied from a partition on sda (hd0 in grub) to a partition on sdb (external usb disk), can that system be made bootable?

My grub on sda will boot a system installed on an sdb partition, but it is not finding a system copied to another sdb partition by dd.

A rather indecisive googled comment suggests that it can't be done. There is lots of info on disk to disk coping but not on partition to bootable partition.
 
Old 08-04-2016, 03:57 PM   #2
Mitt Green
Member
 
Registered: May 2014
Location: Europe
Posts: 199

Rep: Reputation: 116Reputation: 116
You'll apparently have to modify fstab and bootloader configuration. Other than that I don't see why it won't work.
 
Old 08-04-2016, 05:21 PM   #3
Emerson
LQ Guru
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 6,317

Rep: Reputation: Disabled
In case this is MBR boot copying only the partition with dd will not boot - because the MBR is outside of partitions.
 
Old 08-04-2016, 05:48 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 19,514

Rep: Reputation: 3016Reputation: 3016Reputation: 3016Reputation: 3016Reputation: 3016Reputation: 3016Reputation: 3016Reputation: 3016Reputation: 3016Reputation: 3016Reputation: 3016
Exactly what command did you use to make this copy?

Grub may have a command "find" that may be used in some cases to find new installs.

A pretty easy way to correct it may be to install grub to this usb but syslinux is also useful but we still may need to know this command you used.

Last edited by jefro; 08-04-2016 at 09:29 PM.
 
Old 08-04-2016, 07:41 PM   #5
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 8,900

Rep: Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859
If this is MBR, copying a system from a partition on sda to a partition on sdb will require that you modify the boot file, grub.cfg if you are using Grub2. That is usually done by running grub-mkconfig or if you are using one of the Ubuntu's, sudo update-grub. There is no possible way the bootloader for either drive will be aware of the newly copied partition if you don't update grub. Not knowing which drive you are booting from or want to boot it from or whether it is UEFI or MBR means we can't be more specific.
 
Old 08-05-2016, 11:21 AM   #6
hilltownboy
Member
 
Registered: Jan 2008
Location: Ashfield, MA
Distribution: Debian 9 "Stretch", Arch
Posts: 115

Original Poster
Rep: Reputation: 15
Boot usb disk partition copied by dd?

Gentlemen, thanks for your help. To answer:
yancek: this is MBR, Grub2 on sda8 (debian jessie), modified by update-grub. When the grub screen appears, it shows the partitions on sdb (usb disk) as well as those on sda, but it does not boot the one copied by dd.

jefro: I didn't make a note of the dd command used. It was just a simple if to of with 4096 blocks.
My grub has no "find" command, but the grub "ls" command shows
Code:
grub> ls
(hd0) (hd0,msdos9) (hd0,msdos8) (hd0,msdos7) (hd0,msdos6) (hd0,msdos5) (hd0,msdos1) (hd1) (hd1,msdos4) (hd1,msdos2) (hd1,msdos1)
It does not show (hd1,6) which is the OS partition copied by dd.
I do not intend to boot from the dd partition, but to have my normal grub boot it.

Emerson: the MBR on sda boots (thru grub on sda8) all OS partitions on sda as well as the one installed (not copied) on sdb1.

Matt Green: I modified the fstab on the dd partition, replacing the UUID that dd copied from sda1 with the UUID assigned to the dd partition.
 
Old 08-05-2016, 11:47 AM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 19,524

Rep: Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135
The dd command would of overwritten the existing UUID with sda1's. Look at the output of the command lsblk. Are the UUIDs the same? To change sdb6 you need to use the tune2fs command which should match the one in /etc/fstab.

Does the new partition show up with all the other tools i.e. parted, fdisk etc...
 
Old 08-06-2016, 10:46 AM   #8
hilltownboy
Member
 
Registered: Jan 2008
Location: Ashfield, MA
Distribution: Debian 9 "Stretch", Arch
Posts: 115

Original Poster
Rep: Reputation: 15
Boot usb disk partition copied by dd?

michaelk: lsblk, blkid, fdisk, parted, as well as tune2fs -l UUID=<uuid of sdb6 partition> all show up sdb6. But Grub2 "ls" command does not find it. The attempt to load it via Grub2 says that it is not found and that the kernel has to be loaded first.

Curiously grub finds sdb2 and sdb4, neither of which are loadable systems. It will load the system on sdb1.
 
  


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] How To Resize an Existing Hard Disk Partition Using the Boot Disk TracyTiger Slackware 6 10-13-2014 12:48 PM
[SOLVED] Boot from removed raid disk with copied filesystem? whizje Linux - General 1 05-05-2012 11:47 AM
[SOLVED] centos 6.2 live cd copied to disk: no operating system on re-boot needsleep Linux - Newbie 3 04-05-2012 12:03 PM
USB flash disk partition disappeared as well as partition table openmind Linux - Newbie 3 02-17-2011 06:20 PM
No files are copied to disk capodan Slackware 2 05-19-2003 04:54 AM

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

All times are GMT -5. The time now is 10:49 PM.

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