# How to replace an old hard disk



## michaelrmgreen (Jan 6, 2010)

I 'life' my hard disks, replacing them routinely at 3 years.

Being a lazy person this is what I do:

1. Download and burn to a CD the g4u iso from http://www.feyrer.de/g4u/

2. Run the CD. At the prompt type 'disks'. Check to see what the disk is called (wd0)

3. Fit a second hard disk to the system.

4. Run the CD again, type 'copydisk wd0 wd1' (as appropriate). Total time for 80Gb copy 4754 seconds, about 80 minutes. 


5. Switcharoo the disks.

6. Enjoy new life of disk.


----------



## SirDice (Jan 6, 2010)

Replace them every three years? Why? I have 10 year old disks that still work 

As long as you keep an eye out for bad sectors and the SMART statistics you'll know soon enough when it's time to replace the drive.


----------



## michaelrmgreen (Jan 6, 2010)

Alright SirDice. What's the weather like in the Netherlands, grim I bet! 

I change the hard disks to minimise the chances of having to do an unplanned restore. I know some disks will have a long life but some won't, and I don't trust S.M.A.R.T. to keep me in the loop.

Just over cautious I guess. Still the HOW-TO still works, and see how simple it was. Just the job for dim, lazy people like me!


----------



## SirDice (Jan 6, 2010)

michaelrmgreen said:
			
		

> What's the weather like in the Netherlands, grim I bet!


Cold and grim indeed. It started snowing again so the drive home is going to be somewhat challenging :e 



> I change the hard disks to minimise the chances of having to do an unplanned restore. I know some disks will have a long life but some won't, and I don't trust S.M.A.R.T. to keep me in the loop.


Fair enough.


----------



## phoenix (Jan 6, 2010)

You can also just run rsync while the system is running to copy from one disk to another.  Just be sure to use -H (--hard-links) on a FreeBSD system, or the copied drive usage will be many, many times larger.    If this is a boot drive, though, there's a couple of extra steps that need to be done (install the boot blocks, for instance).


----------



## Beastie (Jan 6, 2010)

michaelrmgreen said:
			
		

> 5. Switcharoo the disks.


Is that the Japanese version of an English word?

Or is it this? :O


----------



## SirDice (Jan 6, 2010)

Beastie said:
			
		

> Is that the Japanese version of an English word?
> 
> Or is it this? :O



The old Switcheroo


----------



## xy16644 (Jan 10, 2010)

This is also great if you want to upgrade to a larger capacity disk. Yes?

How does this work if your disks are mirrored?


----------



## michaelrmgreen (Jan 11, 2010)

>This is also great if you want to upgrade to a larger
>capacity disk. Yes?
Yes and no. The 'extra' would have to be set up manually as a seperate file system.

>How does this work if your disks are mirrored?
Not sure. Try it anyway.


----------



## Ruler2112 (Jan 11, 2010)

Booting from a Linux LiveCD such as the System Rescue CD (a fantastic tool IMO) and running [cmd=]dd if=/dev/sda of=/dev/sdb bs=1M[/cmd] also achieves an exact clone of a drive to another.

I've done just this on windoze boxes where the drive was full and the person didn't want to lose anything.  Clone the drive to a bigger one, then use gparted (also on that CD) to expand the partition to fill the drive.  No reinstalling, futzing around with the stupid activation crap, and no settings/applications/documents were lost (including his massive pron collection :OOO ).

I've not heard of g4l - going to have to check that out.  Never can have too many toys to play with.  





I'd have to agree with some of the people here with your replacement policy of 3 years.  It's been my experience that a drive is more likely to fail in it's first 3 months than in the next 5 years.  Not absolute, but generally after a drive has been used for a while, it doesn't die very often.  If you're worried about data loss, read up on RAID-1 and RAID-5 - they'd do better to provide redundancy than simply replacing the drive every n years.


----------



## michaelrmgreen (Jan 12, 2010)

Alright Ruler2112. Thanks for the information about System Recue CD, I'll definitely be checking that out. Especially if it helps salvage massive porn collections.

I agree that my 'lifeing' policy is not ideal, but it is very simple. And cheap! I do 'prepare' the disks before installation by running them in a Widnows system in order to find the early failures. 

In my view this is the simplest route to reducing the chance of having to do an unplanned restore. Observation leads me to believe that RAID has problems all its own.


----------



## SPlissken (Feb 15, 2010)

Ruler2112 said:
			
		

> Booting from a Linux LiveCD such as the System Rescue CD (a fantastic tool IMO) and running [cmd=]dd if=/dev/sda of=/dev/sdb bs=1M[/cmd] also achieves an exact clone of a drive to another.



Is this apply to a disk with several partitions ?


----------



## Beastie (Feb 15, 2010)

If sda and sdb are the same as ad0/da0 and ad1/da1 (as I think they are), then yes it applies to the entire disk. Any disk.

It can also be done with FreeBSD's livefs.


----------



## Ruler2112 (Feb 15, 2010)

SPlissken said:
			
		

> Is this apply to a disk with several partitions ?



For certain.  It doesn't even necessarily need to support the file systems inside the partitions as it does a bit-wise copy of the entire disk to another.

And yes, /dev/sda in Linux is the first drive (IDE used to be /dev/hda, but they're now run through a SCSI emulation system in most modern distros including the SRCD), analogous to /dev/ad0 in BSD.


----------



## ccc (Aug 7, 2010)

Has someone already tried to clone *F*reeBSD using *G4l*?

https://sourceforge.net/projects/g4l/


----------



## johnd (Apr 17, 2012)

I didn't give it a try so far, but recoverdisk(1) sounds interesting.

From the manpage:

```
clone a hard disk
recoverdisk /dev/ad3 /dev/ad4
```


----------



## ccc (Apr 19, 2012)

johnd said:
			
		

> i didn't give it a try so far, but recoverdisk(1) sounds interesting.
> 
> From the manpage:
> 
> ...



Thanks.


----------



## ccc (May 27, 2012)

Has anyone already tried to migrate a hard disk using recoverdisk?


----------



## wblock@ (May 27, 2012)

It appears to be a smarter dd(1).  Binary block copies are a poor way to copy a drive.  You can't change partition sizes, and space on a bigger new drive is wasted.  Just use dump(8) and restore(8) (see Backup Options For FreeBSD) or ZFS send/receive.


----------

