Linux - NewbieThis 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
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 know that dd is great tool. I also tried dd_rescue, but none of them meet my needs. What I want is to clone my 4GB stick, but without saving zeros. Now, I have bootable distro on it. It's about 270 MB, so dd'ing 4GB is wasting time and space. Assume that fs is not fragmented - is there any way (option or other tools) to do that or only way is to truncate file? Thanks.
dd will always copy every bit. The only slight way around it is to zip/compress the file. You have to first zero out the free space so that the compression will take huge chunks of disk space and compress it to the max.
Might see G4U. Basically an automated dd with compression.
lithos's suggestion of using clonezilla was a good choice. It is about as easy as it gets. It tends to use a file by file copy so the speed and size is optimum.
what fs is it? if its FAT you could use something like norton ghost, that works on 'file level'. or just clone MBR and copy files.
and if its 'fully defragmented' meaning free space is contiguous, why don't you try cloning just the first 300Mb. and do fsck on clone afterwards?
I had been looking for dd which can skip zeroes on writing. (assuming new drive is already wiped) but couldn't find it. It should be easy to write one. but there must be some minimum number of continuous zeroes in a block, larger than physical block size (and that can be over 128Kb) otherwise its pointless or even contra-productive..
You can't use dd to skip zero's. To sort of bypass that you use a compression program. The zero's still need to be read and still need to be written.
Clonezilla is always a file by file if it one of the file systems supported. Clonezilla supports like 10 types, all common linux and windows is supported. If the file system is not supported then clonezilla reverts to dd.
All these ideas may or may not work. I have had clones to smaller disks that simply would not work as I couldn't get all the data to be forced below some point. I have tried to fool dd and sometimes it works, sometimes not. Just depends if you can fix the file system after that and the partition information. It comes back usually to bite you.
dd to some compression may take some amount of time I agree even on fast systems. Other ways to clone exist. Most folks would consider a file based copy to save time.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.