Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I usually have two identical USB sticks that I up date, by using one of them as backup, I moved from 16GB to 64GB USB3.0 recently, using two identical USB sticks same brand (Toshiba), I cloned the old 16GB to one of the USB 3.0, with no problem at all, I made a mortal mistake and formatted the second USB3.0 0n windows 7, then the trouble started, the firs USB 3.0 has a capacity of 58.18GB, while the second one that was formatted on Windows 7, has a capacity of 58.17GB, since this one is slightly smaller, I cannot clone to it using the following command,
dd if=/dev/source of=/dev/target bs=1M,
I have deleted the partition and reformatted on Linux several times but I always get the 58.17GB capacity, is there any way to correct this problem, besides buying another USB and staying away from Windows?
doing an fdisk -l, the result is almost identical except for the , start end sector, which may be where the problem lies, any reply would be appreciated, thanking you in advance.
Disk /dev/sdb: 58.2 GiB, 62474158080 bytes, 122019840 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: 0xf75f4e84
Device Boot Start End Sectors Size Id Type
/dev/sdb1 32 122019839 122019808 58.2G c W95 FAT32 (LBA)
Disk /dev/sdc: 58.2 GiB, 62461575168 bytes, 121995264 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: 0x4ffd93e7
Device Boot Start End Sectors Size Id Type
/dev/sdc1 32 121995263 121995232 58.2G c W95 FAT32 (LBA)
Nothing to do with formatting - Win or other. They are different sized USBs - look at the total sectors. Happens all the time.
dd'ing is a poor option anyway IMHO, but it's your kit, so your choice.
Edit: mmm - maybe I misunderstood somewhat. If you are just cloning the partition, rather than the entire device, simply make the partition slightly smaller so it fits both devices. 58.0 Gig say.
If you suspect that windows has hived off a few sectors for it's own nefarious purposes, anf you're so fond of dd, why not UNformat it?
Code:
dd if-/dev/zero of=/dev/sdX
I agree with syg00 that dd is a lousy way to do it. You end up rewriting a lot of zeroes, and can't access the files. Rsync is a lot faster and no less accurate.
I agree with syg00 and the drives are just different sizes. Starting with Windows 7 the native formatting tool only allows using FAT32 for drives <=32GB. You must be using a 3 party utility. HP used to have a Windows formatting utility available for downloading that would allow you to format any size drive as FAT32.
I agree that using rsync is a better option. If your cloning just the partition then although the MBR shows 58GB your filesystem is still 16GB unless you already resized it.
Thanks for the input;
but it did not solve the problem, I am sure formatting on windows 7 wreck the usb, I firs cloned on Linux, Debian with no problem, I used on Windows 7, it asked to format it, which I did, and cloned again on Linux, using same procedure, it failed, I managed to clone it reducing the image, on the source, but every time I open a file, I must type in pass word, as well, the usb gets mounted automatically on the manufacturer's name/label, Toshiba etc while it ignores the label that I gave it!
agree with syg00 that dd is a lousy way to do it. You end up rewriting a lot of zeroes, and can't access the files. Rsync is a lot faster and no less accurate.
I agree that using rsync is a better option. If your cloning just the partition then although the MBR shows 58GB your filesystem is still 16GB unless you already resized it.
rsync is not for cloning it copies and backs up, if a file has changed it can make a mess of it,
this one : dd if-/dev/zero of=/dev/sdX,, should be dd if-/dev/zero of=/dev/sdX bs=2014 or something similar.
rysnc is not that easy to use,
#rsync -gloptruc $srcdir $dstdir this a more proper way to copy ,
Distribution: Mainly Devuan with some Tiny Core, Fatdog, Haiku, & BSD thrown in.
Posts: 5,443
Rep:
Quote:
/dev/sdb1 32 122019839 122019808 58.2G c W95 FAT32 (LBA)
/dev/sdc1 32 121995263 121995232 58.2G c W95 FAT32 (LBA)
Clearly shows that there are fewer sectors available on the sdc1 disk.
I would try reducing the number of sectors available on the larger disk sdb1 down to the smaller disk size of sdc1 using fdisk - doing something like this always has a chance/danger of losing data, so it is your choice whether to try it or not.
However, my question is, do you really need a clone, or is it just data(?), which it sounds like it might be if you have gone from a 16GB to 64GB.
I've used Linux dump/restore or xfsdump/xfsrestore and it has worked wonderfully. However, these are for ext* or xfs file systems. Don't see in your post if FAT32 is needed? If FAT32 is not needed, perhaps format the USB sticks to use either ext or xfs filesystem and use dump/restore method.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.