Andrew,

On 2020-04-22 19:22, andrew beck wrote:
Hey guys.

Just a quick question here

I recently heard some funny clanking noises in my old 2nd hand hard drive
on my VMC and thought I better change it out and get a SSD in there.

I have a bunch of stuff loaded onto the hardrive for probe basic gui and
other stuff and would like to clone the drive and keep everything.

I can manage a windows cloning I am just not sure if the process will work
on a linux system.  I am using a crucial brand SSD and can download the
drive cloning software (it is rebadged acronis cloning software)

anyway some help would be appreciated.


regards

Andrew

Linux comes with all software to manage system in any way needed.

There are different scenarios you can use to do what you need.

You can start with booting up from a CD or it's image on USB stick if the main drive is not booting up. Otherwise just add second drive and bootup. Find how is second drive recognized:
dmesg | less  <--- in x-terminal
look for lines SCSI, ATA and such to see what the second drive is recognized as.

To partition the disk I use fdisk command; see 'man fdisk' for details. Make sure you do not do it on original drive!!!

I happen to have two drives and mount the second one like this:
/dev/sdb1                             1.4T  877G  441G  67% /backup
/dev/sdb2                             672G  208G  451G  32% /virtual

Mount old and new drives and sync files across.

For example:
/dev/sda is old drive,
/dev/sdb is the new one.

Let's assume there is only one partition for the files on old drive /dev/sda1

You would make one partition on the second also. However, you need to add a swap partition about 2 to 5 times RAM size to make "Linux happy". Swap can be found this way:

swapon -s
Filename                   Type            Size    Used    Priority
/dev/sda3                  partition       8388604 0       -2

mkdir /mnt/sda1
mkdir /mnt/sdb1

mount /dev/sda1 /mnt/sda1
mount /dev/sdb1 /mnt/sdb1

In case there is more than one data partition you might want to do the same on the second drive. In any case, I would use a separate partition for /home so that work files are in one place separate from the OS itself.

When the partitions are mounted you may use rsync to sync files to the new drive partition. Example:
rsync -av /mnt/sda1/ /mnt/sdb1
rsync -av /mnt/sda2/ /mnt/sdb2    <--- for second partition.
and so on.
Pay attention to '/' (slash) at the end of source directory to ensure correct way of file sync.

rsync is great because you can transfer files across the network to other systems. Read man pages for details
man rsync

If you want to know how long it takes for task to complete use
time rsync -av /mnt/sda1/ /mnt/sdb1

Note, the above commands need to be executed as user root. Alternative is to prepend sudo to the above commands but I prefer becoming root this way:
sudo su -
and enter password you use for login. That's assuming root does not have special password. I always have one x-terminal tab dedicated to root for sysadmin work. Note that the prompt will change to # at the end.

One more thing, if the new drive has a partition on it, very likely, then your OS might automount it during login. You need to unmount it before you use fdisk to delete and create new Linux partitions on it.
Check with
df -h

Good luck,

--
Rafael Skodlar


_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to