Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Many laptops are delivered with Windows 7 recovery partition (but without CD or DVD) which takes place on the harddrive that could contain some Linux distribution or serve for data storage.

I don't want to format it because sister paid for this partition and has a license key. But she would like to backup it to some medium and use it in time she will need to use this system.

Is there a command in Linux that will backup this recovery partition or make a bootable DVD from this partition?

Note: The content of the partition is not so important. Important is to make a backup of this partition to some medium (best would be CD or DVD) and show how to restore from that medium.

share|improve this question
    
How big is the partition? Please post the output of fdisk -l /dev/sda or parted -l /dev/sda -- assuming /dev/sda is your disk. –  rozcietrzewiacz Nov 18 '11 at 13:10
    
I don't have the laptop at home now. –  xralf Nov 18 '11 at 13:28
add comment

1 Answer

up vote 1 down vote accepted

Using tar and gzip is probably your best bet. You could use dd to do a block-by-block copy of it but this will obviously give you a file exactly the same size as the partition.

Assuming the partition is /dev/sda2, something like:-

mkdir /mnt/recovery
mount -t ntfs /dev/sda2 /mnt/recovery
cd /mnt/recovery
tar -cvf - . | gzip -c >/path/to/store/recovery.tar.gz

should back it up, and:-

mkfs.ntfs /dev/sda2
mount -t ntfs /dev/sda2 /mnt/recovery
cd /mnt/recovery
tar xvf /path/to/sotre/recovery.tar.gz

to put it all back again.

share|improve this answer
    
This makes sense. And what if the partition /dev/sda2 does not exist before recovery? I have to create a partition that is little larger than the extracted archive? –  xralf Dec 1 '11 at 9:52
    
Yup - that should be fine. I was assuming the partition still existed but recreating one should be fine. –  Andy Smith Dec 1 '11 at 10:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.