Kitz ADSL Broadband Information
adsl spacer  
Support this site
Home Broadband ISPs Tech Routers Wiki Forum
 
     
   Compare ISP   Rate your ISP
   Glossary   Glossary
 
Please login or register.

Login with username, password and session length
Advanced search  

News:

Author Topic: Copy system disk using dd  (Read 4290 times)

sevenlayermuddle

  • Helpful
  • Addicted Kitizen
  • *
  • Posts: 5369
Copy system disk using dd
« on: February 05, 2017, 11:27:55 AM »

I am contemplating replacing the system disk in my CentOS server.   The disk is perfectly healthy and a good quality 'Enterprise' grade but has loud clicks and thuds that accompany each head movement, that are driving me nuts.   I gather such noise is sometimes the case with 'Enterprise' disks as the noise is not a problem in a commercial server room.

So... It is a 2TB disk.   I'm assuming I can just boot up from cd, then dd the unmounted old disk to a new one, as long as the new is at least as big?   It'll take a while, I know, but is it a good way to go?   There's a couple of things I am unsure about, which is embarassing as there was a time I should have known these things... :-[

1- My /etc/fstab entries are specified by uuid.  Will a copy using dd propagate the old disk's partition uuids to the new one?

2 - If the new disk is actually bigger than the old, can I simply modify the partitioning afterwards, to pick up the extra space, probably as an additional partition?

Grateful for any comments.


« Last Edit: February 05, 2017, 11:31:41 AM by sevenlayermuddle »
Logged

broadstairs

  • Kitizen
  • ****
  • Posts: 3697
Re: Copy system disk using dd
« Reply #1 on: February 05, 2017, 11:38:53 AM »

Not tried it but I think it will copy the UUID from what I've read which will cause issues so you would need to change the UUID after the copy on the new disk prior to booting the system, unless you physically remove the old disk I guess. Again not tried it but I would expect to be able to add partition to gain space, something you could try prior to reboot.

Stuart
Logged
ISP:Vodafone Router:Vodafone Wi-Fi hub FTTP

roseway

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 43467
  • Penguins CAN fly
    • DSLstats
Re: Copy system disk using dd
« Reply #2 on: February 05, 2017, 11:44:03 AM »

1. Yes. What I've done in these circumstances is to edit /etc/fstab to replace the UUID references with the equivalent /dev/xxx references before cloning the disk.

On the subject of cloning, something like Clonezilla might be a better option than dd from the command line (but that's only a feeling, based on what I've done a couple of time).

2. Yes, something like Gparted Live will expand partitions as required.
Logged
  Eric

sevenlayermuddle

  • Helpful
  • Addicted Kitizen
  • *
  • Posts: 5369
Re: Copy system disk using dd
« Reply #3 on: February 05, 2017, 12:00:57 PM »

Thanks Stuart, I will indeed hope to be installing the old disk too, with carefully chosen partitions that are rarely accessed, to mitigate the head noise.   I am aware I'll need to zap its partition table and repartition to bet new UUIDs, but you've made me think of a new issue... 

I wonder, will the cd booted environment in which I perform the dd copy get upset by the fact there are duplicate UUIDs, even if not mounted.   For example, If I type

ls -l /dev/disk/by-uuid

...then it shows me the UUID to device mapping, so the system is at least aware of unmounted UUIDs...

@Eric, also thanks.   I may play it safe by altering fstab as you suggest, and/or I will check out Clonezilla too.

Logged