dd or tar? why?
i want to backup a:
1- boot sda1 2- / sda6 3- /home sda7 i did: Code:
boot from mint live usb but i want to do this with tar: i did: Code:
boot from mint live usb please advice me? |
dd works on the raw device (or with a single file, which is an image of a divice), it will not really take care about filesystem, files and dirs on that device, tar can only work with files.
What kind of advice do you need? |
thanks pan64,
so i understand you say tar is better for backup a (boot partition, root partition and home partition)? |
What is your real goal? What do you need?
tar can only handle files and not full partitions. |
Quote:
i want to shorten time to make a copy of Linux distro and recover it. dd or tar? |
in that case I suggest dd.
|
dd creates partition or drive image (including bootloader, MBR, partition table, MFT, filesystems).
tar creates an archive that consists of files that belongs to filesystem, only files, without partition/drive/filesystem information, bootloader images at MBR. Using dd you can restore system easily, but your partition layout should be the same as it was at dd image creation time. You shouldn't repartition your drive before restoring system from dd image. With tar archive you can restore system to any partition that has enough space to fit unpacked filesystem. However, you have to restore bootloader (if you changed partitions layout or if you restore a system to other drive). In general using tar is faster than using dd because tar worsk at filesystem level. Added: Take a look at this article, it was written for Gentoo, but it works for any Linux. http://www.gentoo-wiki.info/HOWTO_Custom_Stage4 I use it to backup my system. |
In general tar works faster because it doesn't copy unused blocks or metadata blocks. It only copies data, with file identification (name+permissions+attributes). This makes the archive MUCH smaller than is possible with dd.
The fastest way to "recover" a system is to use PXE with a customized initrd. The initrd can then create the partitions and filesystems needed, use an NFS mount to access the tar files, and restore the filesystems, reinstall the boot.... and if necessary, reboot/halt the system. That way all you have to do is issue the pxe boot request. |
thanks all, another question:
is dd make formate to the partition when extracting iso? |
That depends on what you mean.
dd of an entire disk (such as /dev/sda) will copy everything -boot block (if any), partition table, filesystems... everything. When copied to another disk (same size or larger) everything is copied back exactly the same. dd of a partition (such as /dev/sda1) will copy everything in /dev/sda1. It will NOT copy the boot block (if any) it will NOT copy the partition table. It WILL copy just the filesystem in /dev/sda1. This means that before that copy can be restored, the target disk must be partitioned (the same size or larger than the original partition), then the backup can be copied to that partition. If the partition is LARGER than the original, the filesystem must be retuned to set the new larger size (see the manpage/google on growfs, and you may have add that utility to use it) or the filesystem will just not use the larger size. |
Quote:
could dd make bad sector too when i use it too many? |
no, dd cannot make bad sector, but may find one.... (or more)
|
Quote:
If a bad sector IS found, the disk should replace it with a good sector... unless the list of replacements has been exhausted (in which case, the disk has to be replaced). |
All times are GMT -5. The time now is 12:22 AM. |