Suppose I have a 32 GB USB flash drive (UFD) and an 8 GB UFD. I have a 5 GB partition at the start of the bigger UFD, and the rest is unallocated. The problem is to copy the partition and boot sector to the 8 GB UFD using dd or a similar tool. Is this achievable?
Asked
Active
Viewed 1,452 times
5
-
What file system is it? (Technically this is not necessary, but still I want to know.) – Konrad Gajewski Jul 18 '15 at 10:17
-
@Konrad It's HFS+ – Hameer Abbasi Jul 18 '15 at 11:48
1 Answers
2
If you're sure that the 32GB drive has only one 5GB partition, and that partition is at the start of the drive, or at least it starts under 3GB, dd if=/dev/sdx of=/dev/sdy
(where /dev/sdx
is the bigger drive, and /dev/sdy
is the smaller one), would be enough. To speed up the process or to limit the amount of bytes you copy from one drive to another, you can add bs
and count
operands (have a look at man dd
for more details).
If the 5GB partition ends beyond the exact capacity of your 8GB drive, you can either shrink the partition or move it closer to the start of your 32GB drive.
P.S.: I assumed you're using dd
under linux. It may or may not work the same under other OS.
petry
- 263
- 1
- 2
- 7