LinuxQuestions.org

LinuxQuestions.org (http://www.linuxquestions.org/questions/index.php)
-   Linux - General (http://www.linuxquestions.org/questions/forumdisplay.php?f=1)
-   -   clone bootable USB stick (http://www.linuxquestions.org/questions/showthread.php?t=686964)

cccc 11-28-2008 07:21 PM

clone bootable USB stick
 
hi

howto create an image from the bootable USB stick and clone 1:1 including boot files ?

kind regards
cccc

Junior Hacker 11-28-2008 10:52 PM

Plug in both USB pen drives and type: fdisk -l as root in terminal to see what their device names are. If they appear as /dev/sdb and /dev/sdc, type in a terminal: dd if=/dev/sdb of=/dev/sdc conv=notrunc.
To make an image of the entire drive including MBR (boot files), type in terminal: dd if=/dev/sdb of=/path/to/destination/image.dd conv=notrunc. To restore the image to a new drive which is seen as /dev/sdb: dd if=/path/to/image.dd of=/dev/sdb conv=notrunc

phyzome 03-13-2010 10:40 AM

What about non-identical drives?
 
This is great for drives that have identical hardware and will have the same partition layout, etc., but what if I want to copy the boot partition of one USB stick to another USB stick that is not identical?

Specifically, I have two USB sticks that I want to have this partition layout:
  1. Large FAT32 partition taking up most of the drive
  2. Small bootable Ext3 partition at the end, containing GRUB2

Any thoughts on this?

jtag 03-14-2010 01:39 PM

If the second USB is larger you can use the same technique (dd).

bathory 03-14-2010 01:57 PM

@phyzome

You can use FSArchiver to copy filesystems on different size partitions

Regards

kengoudsward 02-03-2016 11:44 AM

Clonezilla
 
in theory, this can be done by Clonezilla as well, although I have not successfully proven this

jefro 02-03-2016 04:53 PM

Various older posts here back to 08.

Hello and welcome to LQ kengoudsward.

kengoudsward 02-03-2016 09:32 PM

thanks jefro
oh ya btw with dd, it works great if you have 2 exact same hardware USB sticks, but I found that if they are not the same, it might copy ok but the copy will not be bootable

jefro 02-04-2016 05:21 PM

Kind of depends on a number of things. Clones are subject to how the distro names things. If your grub or drive or other references are not generic then it could fail.

A few more steps involved in going from size to size usually.

Red Hat messed me on one time on exact same drive to drive clone. Network naming jumped. Not normally an issue but in this application I needed names to be exactly as on original.


A lot could change from when this post started in 2008 to now on linux.


All times are GMT -5. The time now is 04:57 AM.