Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
using linux. Is there a way to get my system the way I want it and then make an "image" of it on a separate hard drive that I can later use to re-image the windows partition on my system hard drive?
You can use the dd command to do that. You can even pipe the output of the dd command through tar or gzip or bzip to compress the image. If the drive is 1/3 full, for example, the compressed image file will be similarly smaller. If you want to save the image to an external drive, keep in mind that some file system such as fat32 have a 2 GB limit on filesize. In that case, you could also pipe the output through the split command.
One of the big epiphanies with Linux is discovering the simplicity of utilities such as dd---and how the SW industry was able to package them and actually SELL them....
You can use the dd command to do that. You can even pipe the output of the dd command through tar or gzip or bzip to compress the image. If the drive is 1/3 full, for example, the compressed image file will be similarly smaller. If you want to save the image to an external drive, keep in mind that some file system such as fat32 have a 2 GB limit on filesize. In that case, you could also pipe the output through the split command.
Hmmm OK this sounds possible - thanks for all the replies. I have a 30 Gb partition that is my "C" Drive for windows - the rest of the HD is storage (160 total). I'm going to be storing my back up on a networked hard drive, so file system shouldn't be a problem. One thing though - once I have my backup, how will I be able to retrieve it when needed? Is there a way to install from that backed up image?
Hmmm OK this sounds possible - thanks for all the replies. I have a 30 Gb partition that is my "C" Drive for windows - the rest of the HD is storage (160 total). I'm going to be storing my back up on a networked hard drive, so file system shouldn't be a problem. One thing though - once I have my backup, how will I be able to retrieve it when needed? Is there a way to install from that backed up image?
If you use a utility like dd to make backups by cloning the whole disk, then restoring is simply a reversal of the process.
Be careful---dd is the ultimate power tool. One typo and it will wipe out your whole system without even blinking.
With 2 identical drives, you can clone like so:
dd if=/dev/hda of=dev/hdb bs=4096 clones a to b
reverse the hda and hdb to go the other way.
To image to a file:
dd if=/dev/hda of=</path/filename> bs=4096 (There needs to be room for the file)
If you use a utility like dd to make backups by cloning the whole disk, then restoring is simply a reversal of the process.
Be careful---dd is the ultimate power tool. One typo and it will wipe out your whole system without even blinking.
With 2 identical drives, you can clone like so:
dd if=/dev/hda of=dev/hdb bs=4096 clones a to b
reverse the hda and hdb to go the other way.
To image to a file:
dd if=/dev/hda of=</path/filename> bs=4096 (There needs to be room for the file)
So does it matter that the partition is NTFS format? In other words, I'd be backing up an NTFS partition, which shouldn't be a problem, but then on the re-install end I'd be writing to an NTFS partition ... does that make sense?
So would it be acceptable to boot linux (from a 2nd HD (sda)) and then use dd to image only the 1 30 GB partition of my other HD (sdb), then can I still use dd to put that image back if it's NTFS file system? I thought NTFS write capabilities were not there yet ....
thanks for the link, also - I will read it thoroughly.
Another note: I am not 100% sure about using dd to clone just one partition. If this DOES work, then the restore process has to include being sure that the partition is put where the partition table expects to find it. Perhaps the link I posted answers this.
Otherwise: Google or "man dd"
If you use split to divide up the image before storing on the network drive, you can use the cat command with a wild card to join the fragments when restoring. If you don't have an if= argument, dd takes the stream from stdin. Another advantage of splitting up the image is that you can use par2create to add redundancy in case one of the segments gets damaged or deleted.
Actually, you can simply cat out the entire partition in the first place instead of using dd.
EX: cat /dev/hdc >/mnt/network-drive/hdc-Nov01-06.img
This works using simple commands because in Unix ( and Linux ) everything is a file.
The reverse would be
cat /mnt/network-drive/hdc-Nov01-06.img.* | gunzip | dd of=/dev/hdc bs=4096
SMB shares may have limit on the lengths of files that can be transferred. I'm not certain about that but you should check it out with Google. Also, if the shared folder is on a fat32 partition, then the 2 GB limit holds.
Read the dd manpage or info page or the coreutils manual. You can send the dd command the SIGUSR1 signal and it will respond with the progress so far on stderr. For very large streams that may take hours, this is better than simply cat'ing to or from the partition.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.