Please help! I want to keep my job

JSD

Member
Feb 19, 2003
15
0
151
1) The main drive failed it does not boot.
2) We don't have backup
3) We put a new fresh drive as primary and the damaged as secondary
4) We mounted all partitions of the old drive and they are visible.

What do we have to copy from old drive to new drive in order to have all the account created??? is this possible?
 

shaun

Well-Known Member
PartnerNOC
Verifed Vendor
Nov 9, 2001
702
1
318
San Clemente, Ca
cPanel Access Level
DataCenter Provider
Twitter
I've had to deal with this just a few times on customer servers :rolleyes:

I will usually start out with a fsck block scan on the bad drive. I then mount the partitions of that drive to /mnt/olddrive. Depending on the drive's partitioning you may need to mount multiple partitions under /mnt/olddrive (ex: /mnt/olddrive/usr /mnt/olddrive/var). I then chroot to /mnt/olddrive, cd to /var/cpanel/users, run for i in *;do /scripts/pkgacct $i;done. Once thats done i exit the chroot, copy over the /mnt/olddrive/home/cpmove-* files and restore them...

There are a few ways to do this... I've also done things like mv all the public_html's out of the way before i package the account so that it goes fast, restore them and them just cp -af the public_html's back inplace...