Question about Linux USB flash drive cloning
Hello. I was wondering if someone could help with a question about cloning a USB drive with Linux on it. We have a drive that is 4GB and has 3 partitions on it with ext2 file systems in them. The drive is used for loading the OS for a commercial machine.
We bought a Startech USB cloner/duplicator with the intent of cloning the drive to another 4GB drive however the sizes aren't the same. The source is 3920MB and the destination is 3782MB so the duplicator won't start the clone. I don't know much about Linux. Is there a way to create these 3 partitions manually and resize/shrink the last partition to make it fit? Then we would copy the contents of each partition and make the drive bootable? Is this something that can be done? I have some knowledge of doing this in diskpart and using windows tools like bcdedit to set the boot configuration but I don't know anything about how Linux does these things. Thank you for any help you can give. |
Quote:
If your computer has a UEFI, you set the bootloader up on the EFI system partition and register it using efibootmgr, which is a sort of Linux equivalent to bcedit. I think GRUB is the bootloader most commonly used for this sort of thing nowadays but a lot of flash images boot with syslinux. |
Try using 8Gb drives as the destination. Or even bigger, USB drives are "commodity" these days, so you may find larger sizes are cheaper than 4Gb.
|
I agree with just using a bigger flash drive. The amount of effort versus cost does not make sense.
Typically drives are list using their size in GB but report their size in Gib. 4 GB = 3.7 GiB. |
Changing the partition sizes will be irrelevant - the cloner will presumably count sectors on the physical device. Bigger drive(s) is the answer - if you have to use (nominally) 4G go buy a bunch, and check the real size with say fdisk. Pick an appropriate one.
|
Kind of a dangerous test maybe.
The ext2 is not very safe. I might be tempted to use something like clonezilla to at least copy the data to a set of files on some other storage media. G4U of could might be used but not very user friendly. |
Used to use EXT2 file system on / and /home on internal non journaling ssd drive on clambook.
Live gparted > unmount > check was always good enough to fix improper unmount/shutdowns to where the system would not boot. |
Thank you all very much for the help. I greatly appreciate it. I am trying to find a drive to match so I probably won't need to try to make this work with parted or other commands.
Just as a curiosity though, is it possible to resize the last partition to shrink it to the size available on the smaller drive and then copy boot configuration and files from the 3 partitions to the new drive and have the new drive work the same and behave as if it was cloned? |
If I shrink partitions. I double check to make sure things are OK with a re-boot.
If it re-boots. You are golden. Then you can try your copy files. |
Gparted is a great tool to copy partitions but there is more to that. Usually there is a loader.
|
Quote:
Shrink the filesystem, then the partition, then when happy simply dd the device over specifying a block count. Don't get cute - copy a size that is slightly bigger than the total allocated on the source device, but will fit into the target device. Doesn't have to be exactly the target size. Give yourself a few megabyte leeway if you can. |
We had a cloner that was a linux box basically.
We also had a cloner with backwards storage and we deleted a few drives before we figured it out. |
All times are GMT -5. The time now is 09:14 PM. |