how to make an image of /dev/sda1

faginbagin mythtv at hbuus.com
Sat Sep 20 04:19:05 UTC 2014


On 9/19/2014 10:19 PM, David Sexton wrote:
> Hi,
> 
> first mount the sd card
> mount /dev/sdb1 /mnt
> 
> and then
> 
> dd if=/dev/sda1 of=/mnt/mybackup
> 
> dd will copy the whole partition including blank space and so might not fit on your 4gb sd card.
> 
> If you can reinstall xp then it would be better to just backup your important documents
> 
> 
> David

If you installed XP onto an NTFS file system, ntfsclone is more efficient than dd. I also compress the image using gzip. To backup an NTFS file system, this is the shell script I use:

timestamp=`date '+%y%m%d'`
BACKUP_DEV=${BACKUP_DEV:-/dev/sda1}
BASE=`basename $BACKUP_DEV`
(ntfsclone --save-image -o- $BACKUP_DEV |gzip -c >ntfs-${BASE}-$timestamp.gz) 2>ntfs-${BASE}-$timestamp.out

And to restore:

timestamp=<timestamp-of-backup>
BACKUP_DEV=${BACKUP_DEV:-/dev/sda1}
BASE=`basename $BACKUP_DEV`
zcat ntfs-${BASE}-$timestamp.gz |ntfsclone --restore-image --overwrite $BACKUP_DEV -

HTH,
Helen



More information about the Ubuntu-accessibility mailing list