LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   split utility in pipes: backup to FAT32 (4GB limit) (https://www.linuxquestions.org/questions/linux-software-2/split-utility-in-pipes-backup-to-fat32-4gb-limit-523058/)

Samsara 01-26-2007 12:56 PM

split utility in pipes: backup to FAT32 (4GB limit)
 
As a follow-up to my thread about dd, in which pwc101 suggested to use

dd if=/dev/hda | gzip > /mnt/hdb1/system_drive_backup.img.gz

("gzip -dc /mnt/hdb1/system_drive_backup.img.gz | dd of=/dev/hda" to restore)

Recap (skip this paragraph if you read my first thread): I need to backup an entire Windows drive with several partitions, including one formatted as Compaq rescue partition (that's what fdisk tells me), onto an external USB drive; the windows drive has a lot of free space on at least one of the partitions, so I asked how to avoid having an 80GB image, 30GB of which is empty.


I have now been painfully reminded that the FAT32 filesystem will only accept files of 4GB max., so I'll need to split the files.

Is it possible to split the files in transit? I guess I could split them first, and later compress them on the disk, although this will require more space initially.

At somewhat greater effort, I could try to reformat the drive to a different file format. I understand that FAT32 is the only one that OS X, Linux and Windows can all read _and_ write, but something that only Linux and OS X can work with is probably good enough for the job. Which one to use?

What are your thoughts? Split or reformat?


Thanks,

Samsara
.

ramram29 01-26-2007 04:08 PM

dd if=/dev/hda | gzip > /mnt/hdb1/system_drive_backup.img.gz- | split -b 2000MB

It will save the files as:

system_drive_backup.img.gz-aa
system_drive_backup.img.gz-ab

To restore use:

cat system-drive_backup* | gzip -dc | dd of=/dev/hda

Samsara 01-26-2007 06:13 PM

Sorry, but that syntax is definitely not correct. It does not lead to the desired result.

Samsara
.

ramram29 01-26-2007 11:25 PM

Below is the correct way:

To create the compressed image:

dd if=/dev/hda | gzip -c | split -b 2000m - system_drive_backup.img.gz.

It will create the 2GB files:

system_drive_backup.img.gz.aa
system_drive_backup.img.gz.ab

To restore:

cat system_drive_backup.img.gz.* | gzip -dc | dd of=/dev/hda

Mount an external USB drive or a remote NFS drive for the dumps. I would recommend first to empty out the unused blocks of your hard disk with zeros, using command:

dd if=/dev/zero of=filefullofzeros && rm filefullofzeros

Otherwize the dd command will dump the bits of even the files that where previously deleted.

Refer to document:

http://wiki.linuxquestions.org/wiki/...ns_using_split


All times are GMT -5. The time now is 12:33 AM.