I need to replace the HDD on a single disk system used as a pbx (CentOS-6 based FreePBX). The existing partition structure is:
ls -l /dev/sd*
brw-rw---- 1 root disk 8, 0 Apr 17 2018 /dev/sda
brw-rw---- 1 root disk 8, 1 Apr 17 2018 /dev/sda1
brw-rw---- 1 root disk 8, 2 May 25 14:12 /dev/sda2
parted /dev/sda print
Model: ATA ST3500418AS (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 525MB 524MB primary ext4 boot
2 525MB 500GB 500GB primary lvm
parted /dev/sda1 print
Model: Unknown (unknown)
Disk /dev/sda1: 524MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Number Start End Size File system Flags
1 0.00B 524MB 524MB ext4
parted /dev/sda2 print
Error: /dev/sda2: unrecognised disk label
I need to transfer the entire system to a new HDD. Ideally I would like to transfer the entire thing (boot-loader, OS, and filesystems) over the network to a larger disk temporarily installed on a separate host, that is not necessarily running CentOS, and then swap the drives. Is this possible?
I am guessing that with lvm
in the mix this is a non-starter. But in case it is not then this scenario is the ideal.
Is this possible and how is it best accomplished?
Further information:
df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/vg_voinet01-lv_root
64376668 5057112 56042756 9% /
tmpfs 1952596 0 1952596 0% /dev/shm
/dev/sda1 487652 55768 406284 13% /boot
/dev/mapper/vg_voinet01-lv_home
3159816 246372 2749604 9% /home
/dev/mapper/vg_voinet01-LogVol04
322407500 134244852 171778648 44% /var
/dev/mapper/vg_voinet01-lv_log
9545056 390052 8663484 5% /var/log
/dev/mapper/vg_voinet01-lv_spool
65924860 32354984 30214852 52% /var/spool
vgs;lvs
VG #PV #LV #SN Attr VSize VFree
vg_voinet01 1 6 0 wz--n- 465.27g 9.91g
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
LogVol04 vg_voinet01 -wi-ao---- 312.50g
lv_home vg_voinet01 -wi-ao---- 3.12g
lv_log vg_voinet01 -wi-ao---- 9.38g
lv_root vg_voinet01 -wi-ao---- 62.50g
lv_spool vg_voinet01 -wi-ao---- 64.00g
lv_swap vg_voinet01 -wi-ao---- 3.86g
To keep it simple I would use a cloning utility.
Most utility allow booting on a media and clone the disk to a new's one from there.