fixunix
Tags Register FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

[off-topic] hard drive geometry issues and mirroring yourslackware+Win XP hard-drive with 'dd'? - Slackware

This is a discussion on [off-topic] hard drive geometry issues and mirroring yourslackware+Win XP hard-drive with 'dd'? - Slackware ; Hello I understand that this is not stricly a slackware issue, but whenever I visited it in the past this forum seemed to be filled with knowledgeable Linux users. So please bear with me. : ) In addition to my ...


Fix Unix > Linux > Help > Slackware > [off-topic] hard drive geometry issues and mirroring yourslackware+Win XP hard-drive with 'dd'?

Reply
 
LinkBack Tools
  #1  
Old 10-09-2008, 10:56 PM
Junior Member
 
Join Date: Sep 2009
Posts: 0
Default [off-topic] hard drive geometry issues and mirroring yourslackware+Win XP hard-drive with 'dd'?

Hello

I understand that this is not stricly a slackware issue, but whenever
I visited it in the past this forum seemed to be filled with
knowledgeable Linux users. So please bear with me. : )

In addition to my regular backup routine, I have recently mirrored my
laptop's hard-drive onto a partition on an external HD I had lying
around. I booted from the Slack install cd and typed

# dd if=/dev/hda of=/dev/sda1 bs=1M conv=nocreat

/dev/hda contains both a WinXP partition as well as my slackware
install. My goal is that I won't have to reconfigure my computer setup
(which is the result of years of hard labor and I am so happy with,
especially the Slack portion of it!) should something happen to the
machine itself.

Simple question: should something happen to my laptop and I get a new
one of the same model onto which I 'dd back' the data in /dev/sda1,
can I expect the computer to work properly? My concern is that if, eg,
the new laptop does not use the same exact hard-drive model (the
current hard-drive on it is not the one it came with), then it might
not work for some obscure reason of hard-drive geometry or something.

Is this a concern? Or will dd'ing the image of my current hard-drive
onto any other drive produce an effective copy of my current system?
(I understand I will have to deal with Win XP's "authorized copy"
mechanisms, but that is a different conversation altogether...)

Thanks in advance for any help

James
Reply With Quote
  #2  
Old 10-10-2008, 12:07 AM
Junior Member
 
Join Date: Sep 2009
Posts: 0
Default Re: [off-topic] hard drive geometry issues and mirroring your slackware+Win XP hard-drive with 'dd'?

On Thu, 09 Oct 2008 15:56:06 -0700, james.kirin39 wrote:

> Hello
>
> I understand that this is not stricly a slackware issue, but whenever
> I visited it in the past this forum seemed to be filled with
> knowledgeable Linux users. So please bear with me. : )
>
> In addition to my regular backup routine, I have recently mirrored my
> laptop's hard-drive onto a partition on an external HD I had lying
> around. I booted from the Slack install cd and typed
>
> # dd if=/dev/hda of=/dev/sda1 bs=1M conv=nocreat
>
> /dev/hda contains both a WinXP partition as well as my slackware
> install. My goal is that I won't have to reconfigure my computer setup
> (which is the result of years of hard labor and I am so happy with,
> especially the Slack portion of it!) should something happen to the
> machine itself.
>
> Simple question: should something happen to my laptop and I get a new
> one of the same model onto which I 'dd back' the data in /dev/sda1,
> can I expect the computer to work properly? My concern is that if, eg,
> the new laptop does not use the same exact hard-drive model (the
> current hard-drive on it is not the one it came with), then it might
> not work for some obscure reason of hard-drive geometry or something.
>
> Is this a concern? Or will dd'ing the image of my current hard-drive
> onto any other drive produce an effective copy of my current system?
> (I understand I will have to deal with Win XP's "authorized copy"
> mechanisms, but that is a different conversation altogether...)
>
> Thanks in advance for any help
>
> James
>

It might work. Then again it might not. The trouble comes with different
drive geometry, as you noticed.

Learning some real backup techniques can really pay off in the long run.
It isn't the hardest thing in the world, either (not by a long shot!).

The key things to learn about are:
1. Disk layout and structure in the PC world. Usually this means enough to
point to where each OS is installed. Also, it is necessary to use fdisk
(or equiv) to recreate partitions on a new device.

2. The boot method is use on the box. I use the grub loader, almost
exclusively. The bootloader must be reinstalled if a backup is
restored to a new disk.

3. The filesystems in use on the box. Learn about appropriate tools
to use to backup data from individual partitions. I use ntfsclone for
Windows' NTFS partitions and simple tar with gzip for Linux partitions. If
you are using EAs and ACLs, then supplement tar backup with a capture
using getfattr, getfacl.

This is a recent thread where I made some similar comments:
http://groups.google.com/group/comp....e2cc343e390526

(points to start of thread).

dd works as a backup tool. The backups you have created with this tool
are likely usable in a restore scenario. They may require some "fixed
up" work if the geometry does not match, though. The contents of each
partition can be isolated from this "blob" using device mapper objects
(hint: use blocksize and offset parameters). By saving the partiton data
directly you can omit this somewhat tricky problem.

--
Douglas Mayne
Reply With Quote
  #3  
Old 10-10-2008, 01:47 AM
Junior Member
 
Join Date: Sep 2009
Posts: 0
Default Re: [off-topic] hard drive geometry issues and mirroring your slackware+Win XP hard-drive with 'dd'?

On Thu, 9 Oct 2008 15:56:06 -0700 (PDT), james.kirin39@gmail.com wrote:

>Hello
>
>I understand that this is not stricly a slackware issue, but whenever
>I visited it in the past this forum seemed to be filled with
>knowledgeable Linux users. So please bear with me. : )
>
>In addition to my regular backup routine, I have recently mirrored my
>laptop's hard-drive onto a partition on an external HD I had lying
>around. I booted from the Slack install cd and typed
>
># dd if=/dev/hda of=/dev/sda1 bs=1M conv=nocreat


This is not a good idea, you almost have it.

Copying /dev/hda also copies the partition table. A better method is
to allow for restoring onto a larger drive. Do this by copying by
partition.

You can also reduce the size of the backup files by zeroing filesystem
freespace prior to taking the backup. For windoze I use a thing called
Shredder to perform a 'simple' one pass erase of free-space, don't use
the default free-space scramble data option.

For linux you can, on a mounted partition do:

dd if=/dev/zero of=/mount/zero_filename; sync; rm zero_filename

To take a backup of *unmounted* partitions:

dd if=/dev/sdXY bs=1M | gzip > /some/backup/dir/backup_file.gz

To backup the MBR

dd if=/dev/sdX bs=512 count=1 of=/some/backup/dir/backup_MBR

Copy the geometry to a text file for fdisk new HDD:

fdisk -l /dev/sdX > /some/backup/dir/backup_fdisk-l

To restore a filesystem:

zcat /some/backup/dir/backup_file.gz | dd of=/dev/sdXY

>not work for some obscure reason of hard-drive geometry or something.


Geometry for recent drives below some large GB size is:

Disk /dev/hda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Thus restoring to a new HDD is now a case of doing an fdisk on the new
HDD to have restore partitions of the same size as original partitions.
>
>Is this a concern? Or will dd'ing the image of my current hard-drive
>onto any other drive produce an effective copy of my current system?


Unlikely unless you have identical HDD size, some vary by few cylinders
for same model. Better to backup/restore by partition unless you're
imaging (ghosting) a set of identical machines.

>(I understand I will have to deal with Win XP's "authorized copy"
>mechanisms, but that is a different conversation altogether...)


No necessarily, the restored windoze OS wont know it's been reinstalled
unless you restore to a different box which is unlikely to work.

If you're restoring to the same hdd windoze wont even know what's
happened, as all you've done it take the filesystem backwards in time
to when the backup was made.

Grant.
--
http://bugsplatter.id.au/
Reply With Quote
Reply

Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Premade external hard drive or internal hard drive with enclosure? unix Storage 3 09-09-2008 12:22 AM
BIOs Warns Hard Drive Failing, but Drive Passes Test unix Storage 16 12-10-2007 03:25 AM
Replacing iMac G5 hard drive - heat issues? unix Storage 2 10-08-2007 11:36 AM
External Hard Drive Backup, Rotating Hard Drives Weekly unix Veritas Backup Exec 0 09-05-2002 03:23 PM
Can a "Storage Media Device" be a hard drive or hard drive partition? unix Veritas Backup Exec 1 06-05-2000 04:00 PM


All times are GMT. The time now is 09:42 AM.