[Gllug] repeat soft noise from hard drive

James Hawtin oolon at ankh.org
Thu Dec 11 19:22:18 UTC 2008


On Thu, Dec 11, 2008 at 06:38:07PM +0000, Jose Luis Martinez wrote:
> 2008/12/11 James Hawtin <oolon at ankh.org>:
> > When using dd you only need your replacement hard disk to be larger than the
> > current one, drives are so large thesese days they use LBA addressing and
> > that has nothing to do with the number of physical platters in the drives.
> 
> What about the partition table? dd would not play nice with that by
> default I think.
> 

I think it would not matter. Just make sure you reboot after you have dd'ed
the drive as the kernel does not know about the new partion table. Here are
a couple of partition tables from 2 different machines, your notice that
both the same number of heads etc. The size is read from the drive if it
were not discs without parition tables would not work.

Disk /dev/ide/host0/bus0/target0/lun0/disc: 60.0 GB, 60040544256 bytes
255 heads, 63 sectors/track, 7299 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

                                Device Boot    Start       End    Blocks
                                Id  System
/dev/ide/host0/bus0/target0/lun0/part1   *         1        63    506016
                                83  Linux
/dev/ide/host0/bus0/target0/lun0/part2            64      7299  58123170
                                8e  Linux LVM


Disk /dev/hda: 59.7 GB, 59740208640 bytes
255 heads, 63 sectors/track, 7263 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1              14        1318    10482412+   7  HPFS/NTFS
/dev/hda2            1319        7262    47745180    f  W95 Ext'd (LBA)
/dev/hda3   *           1          13      104391   83  Linux
/dev/hda5            1319        2623    10482381    7  HPFS/NTFS
/dev/hda6            2624        2815     1542208+  83  Linux
/dev/hda7            2816        7262    35720496   8e  Linux LVM

You may find some secondary controllers may use different size, the only
difference that would make (if you dd'ed the drive) is fdisk would moan
about partitions not being alined at sector boundaries... Its just an offset
in sectors anyway so it does not matter! That is the joy of LBA addressing.

If you still don't believe me, fdisk the new drive by hand to produce
partitions of the same size or larger than the orginal drive, then dd them
partition at a time.

Don't forget your if you dd paritions you will need to setup the active
partion again and boot block. You need to put the new disk into the final
location boot from a rescue mount file systems and chroot into the archecture.

grub
root (hd0,0)
setup (hd0)

is probably what your want to do I am assuming here the root/boot drive is
the first partition and you want to install the boot block on the MBR of the
drive, if you don't you need something else to put the boot block there
... otherwise the active parition will never be read.

> That is a good solution, if you have identical drives alternatively
> you do an fsck after the dd for each filesystem, that ensures there is
> no corruption in the newly created disk.
> 

Valid point, there is however something about dd'ing whole drives that
scares me! Mosting doing it the wrong way I expect. I have had 2 filesystems
that fsck could not fix. 

> 
> I lost you somewhere  there :-)

Probably best not worry about those bits then!

James
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list