Re: [Emc-users] cloning hard drive to new SSD

2020-05-02 Thread Nicklas Karlsson
> Hi guys just getting back with a report of what I did to try clone my hard
> drive.
> 
> I tried to clone it in linuxcnc first as described and failed.  then tried
> clone zilla,  then tried a few other programs to decrease the size.

Do not think cloning is a good idea since it is an exact binary copy, you 
probably need to copy the file or as you did below keep configuration files and 
reinstall.

> using G parted I reduced the size of the disc down to 40 gb and then used
> clone zilla to zone it to the SSD.  both programs seemed to work fine.  But
> I couldn't boot from that point.
> 
> at that point I just re wiped the SSD with my linuxcnc boot stick and gave
> up.  took me 30 mins to download everything I was missing and I was away
> making parts later that afternoon.
> 
> thanks everyone for taking time to help me out.  I learnt a lot of stuff
> but never actually succeeded.  and after a while I decided it was a waste
> of time anyway.  I could just keep my config files and re install.  The
> whole reason I was trying to clone was then I would keep the probe basic
> gui install files..
> 
> regards
> 
> Andrew


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


Re: [Emc-users] cloning hard drive to new SSD

2020-05-01 Thread andrew beck
haha.  yes

that install was only 3 months old anyway.  running the latest 2.8 iso.

I am using a custom mint iso loaded with qt5 and linuxcnc 2.8  it is
awesome.  and I can just boot anytime from my usb rather than upgrading
everytime from 2.7

regards

Andrew

On Sat, May 2, 2020 at 11:29 AM Jon Elson  wrote:

> On 05/01/2020 05:17 PM, andrew beck wrote:
> > at that point I just re wiped the SSD with my linuxcnc boot stick and
> gave
> > up.  took me 30 mins to download everything I was missing and I was away
> > making parts later that afternoon.
> >
> Well, that way you get a new version with some bug fixes and
> new features, too!
>
> Generally, most configs are mostly upward compatible,
> sometimes needing a conversion
> script to make the changes.
>
> Jon
>
>
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users
>

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


Re: [Emc-users] cloning hard drive to new SSD

2020-05-01 Thread Jon Elson

On 05/01/2020 05:17 PM, andrew beck wrote:

at that point I just re wiped the SSD with my linuxcnc boot stick and gave
up.  took me 30 mins to download everything I was missing and I was away
making parts later that afternoon.

Well, that way you get a new version with some bug fixes and 
new features, too!


Generally, most configs are mostly upward compatible, 
sometimes needing a conversion

script to make the changes.

Jon


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


Re: [Emc-users] cloning hard drive to new SSD

2020-05-01 Thread andrew beck
Hi guys just getting back with a report of what I did to try clone my hard
drive.

I tried to clone it in linuxcnc first as described and failed.  then tried
clone zilla,  then tried a few other programs to decrease the size.

using G parted I reduced the size of the disc down to 40 gb and then used
clone zilla to zone it to the SSD.  both programs seemed to work fine.  But
I couldn't boot from that point.

at that point I just re wiped the SSD with my linuxcnc boot stick and gave
up.  took me 30 mins to download everything I was missing and I was away
making parts later that afternoon.

thanks everyone for taking time to help me out.  I learnt a lot of stuff
but never actually succeeded.  and after a while I decided it was a waste
of time anyway.  I could just keep my config files and re install.  The
whole reason I was trying to clone was then I would keep the probe basic
gui install files..

regards

Andrew

On Sat, Apr 25, 2020 at 8:34 AM Chris Albertson 
wrote:

> All the advice to use "dd" is OK.   But it will spend hours copying many
> gigabytes of blank areas of the disk.I bet there is only a few
> megabytes of data you really need.
>
> The simple way is to make a bootable disk or SD card  (or better an SSD)
> from scratch.   Just the same way everyone installs from scratch.   Then
> boot that drive, mount the old disk and copy those files you need across.
>  This is MUCH faster.  Buy a cheap USB SSD, it is much faster and more
> reliable than an SD card.  Small ones are realy cheap now.
>
> But BEFORE you do anything at all BACKUP the important data off the failing
> drive.   Do this twice then verify you can read the backups then place the
> backup someplace out of reach.   No need to backup data you can download
> from the Internet.   Only backup the files you made yourself.
>
> Then think about how to automate the backup so you never have to worry
> about losing data.  Even SSDs can fail.
>
> Now that you have a safe backup make the new boot drive.   I would not
>  "clone" the old drive.
>
> On Wed, Apr 22, 2020 at 7:25 PM 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
> >
> > ___
> > Emc-users mailing list
> > Emc-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/emc-users
> >
>
>
> --
>
> Chris Albertson
> Redondo Beach, California
>
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users
>

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


Re: [Emc-users] cloning hard drive to new SSD

2020-04-24 Thread Chris Albertson
All the advice to use "dd" is OK.   But it will spend hours copying many
gigabytes of blank areas of the disk.I bet there is only a few
megabytes of data you really need.

The simple way is to make a bootable disk or SD card  (or better an SSD)
from scratch.   Just the same way everyone installs from scratch.   Then
boot that drive, mount the old disk and copy those files you need across.
 This is MUCH faster.  Buy a cheap USB SSD, it is much faster and more
reliable than an SD card.  Small ones are realy cheap now.

But BEFORE you do anything at all BACKUP the important data off the failing
drive.   Do this twice then verify you can read the backups then place the
backup someplace out of reach.   No need to backup data you can download
from the Internet.   Only backup the files you made yourself.

Then think about how to automate the backup so you never have to worry
about losing data.  Even SSDs can fail.

Now that you have a safe backup make the new boot drive.   I would not
 "clone" the old drive.

On Wed, Apr 22, 2020 at 7:25 PM 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
>
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users
>


-- 

Chris Albertson
Redondo Beach, California

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


Re: [Emc-users] cloning hard drive to new SSD

2020-04-23 Thread Jon Elson

On 04/23/2020 05:43 PM, andrew beck wrote:

hey jon

my old hard drive is 1000 gb the new SSD is 120 gb

So I definitely need to shrink the iso.  But the actual data on the old
hard drive is probably only about 3 gb


OK, step one is use fdisk to see the partition arrangement 
on the old drive.

Generally, the command would be :

sudo fdisk /dev/sda
(answer the password question)
p

and it will list out the partitions.  Some older Linux 
systems had a small boot partition first,
then an extended partition, and then the main Linux 
partition and a swap partition.

Write down or print the report.

Now, with the new drive set up on the same system, or on a 
usb hard drive dock,
find out what the drive name is and then copy the bootloader 
to the new drive.

Assuming the new drive is /dev/sdb:
sudo d|d if=/dev/sda of=/dev/sdb bs=512 count=1|

This will copy the partition table from the old drive, which 
is too big, so now use fdisk to remove

and correct the partition sizes.
In fdisk, the m command lists the commands.  d to delete old 
partitions first.


Then n for new, it will ask questions.  When you create the 
main partition (might be sda1 if no
boot partition or sda5 if a boot partition) calculate how 
much space to give it, leaving room

for the swap partition.

Use type=83 for Linux partitions, 82 for swap.

w writes out the partition table, but the machine may need 
to be rebooted before it

knows the partition table has been changed.

Run fdisk again to make sure the partition table is as it is 
supposed to be.  If good, continue,

otherwise try again.

Now, create the file systems.  So, assuming just one Linux 
partition at sdb1,


sudo mkfs /dev/sdb1
It will take a few minutes, reporting progress as it goes.
now, mount the new file system:

sudo mkdir /mnt/disk   (creates a place to mount the new 
file system to in the main file system)

sudo mount /dev/sdb1 /mnt/disk
cp -ra /  /mnt/disk

(r means recurse into subdirectories, a means preserve 
timestamps)


This will take a while, as it copies all files from old to 
new drive.


When done:

sudo umount /mnt/disk

This may take a while to buffer out the updates.
Now, you have to make the new drive bootable.  This is where 
we get into guru territory.
We copied the master boot record, but it doesn't know where 
the bootloader and kernel are in

the new files system.  So, we have to redo that.

Remove old drive, insert new drive as first drive, connect 
DVD drive and boot from live DVD.


select rescue mode, then do :
grub-install /dev/sda
update-grub

reboot!

I hope this works, I have done this a few times and always 
got it to work with a little effort.


Jon






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


Re: [Emc-users] cloning hard drive to new SSD

2020-04-23 Thread andrew beck
hey jon

my old hard drive is 1000 gb the new SSD is 120 gb

So I definitely need to shrink the iso.  But the actual data on the old
hard drive is probably only about 3 gb

regards

Andrew

On Thu, Apr 23, 2020 at 3:34 PM Jon Elson  wrote:

> On 04/22/2020 09:22 PM, 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)
> >
> >
> Well, there are two basic procedures.  As long as the new
> drive is at least as large or larger than the old drive,
> then you can make an absolute clone in a few hours with the
> dd command.
>
> Best to boot off a live dvd, figure out the names of the two
> drives and then
>
> |dd  if=/dev/sdX of=/dev/sdY bs=64K conv=noerror,sync
>
> if= is the input disk, of= is the output disk.  Replace X and Y with
> the appropriate letters.Make REALLY sure you get
> these right, or you will end up wiping the old disk.
>
> To make sure, you can use fdisk /dev/sdX
> and then type p to see the partition tables and makes of the drives.
> That should tell you for sure which one has the linux file system,
> and which one probably has no partitions set up.
>
> The above procedure may not be real fast.
>
> If the new drive is larger, you can then expand the Linux file system to
> fill the disk.
>
> If the new disk is smaller, then this won't work.
>
>
> *** ONLY do the following if the new disk is smaller than the old one ***
>
> You have to create
> partitions with fdisk, make the file systems with mkfs and then copy
> all the files with :
>
> # mkdir /mnt/original
> # mkdir /mnt/copy
> # mount /dev/sdX#  /mnt/original
> # mount /dev/sdY#  /mnt/copy
> where X is for the original disk, Y is the copy, and # is the
> partition number
> # cp -rfa /mnt/original /mnt/copy
>  and repeat this for all partitions (you don't need to copy the
>  swapfile partition.  You create that with mkswap.
>
> Now, the big issue here is that since files have been moved around on the
> disk,
> the grub loader will not know where to find them.  So, you have to use the
> live DVD system to run grub to update the loader to know where things are.
> The procedure is a bit involved, so I won't detail it unless you need to
> go that route.
>
> Jon
>
> |
>
>
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users
>

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


Re: [Emc-users] cloning hard drive to new SSD

2020-04-23 Thread Sam Sokolik
I have used clonezilla for years and years.  I can't remember a situation
that it didn't 'just work'

(cloning windows, mac, linux and whatever else..)

sam

On Thu, Apr 23, 2020 at 3:06 PM Dave Cole  wrote:

> Look up R-Drive image.   It works with Windows and will clone just about
> anything.  Linux drives are no big deal.
> Its not free, but its not expensive either.
> I have two USB to IDE/Sata adapters that I used to clone drives.  Or you
> can use one adapter and save the image from one drive and restore it
> onto the other drive in two different sessions.   That way you can also
> keep a backup of the image on another drive.
>
> Dave
>
> On 4/22/2020 10:22 PM, 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
> >
> > ___
> > Emc-users mailing list
> > Emc-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/emc-users
>
>
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users
>

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


Re: [Emc-users] cloning hard drive to new SSD

2020-04-23 Thread Dave Cole
Look up R-Drive image.   It works with Windows and will clone just about 
anything.  Linux drives are no big deal.

Its not free, but its not expensive either.
I have two USB to IDE/Sata adapters that I used to clone drives.  Or you 
can use one adapter and save the image from one drive and restore it 
onto the other drive in two different sessions.   That way you can also 
keep a backup of the image on another drive.


Dave

On 4/22/2020 10:22 PM, 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

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



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


Re: [Emc-users] cloning hard drive to new SSD

2020-04-23 Thread R C




On 04/23/2020 12:10 PM, Rafael Skodlar wrote:


Bravo. I'm horrified reading recommendations to use dd for cloning 
files on storage devices. dd copies fragmented files as is so you are 
messing new drive for performance issues from the get go.




btw:  you can "practice" dd with a usb stick or two, if you don't care 
what's on  them.


take an empty usb stick,  copy some stuff on it,  copy that stick with 
dd to a file,  take the other stick, use dd to copy it on the other.



USB sticks show up as similar devices in/dev   as /dev/sdx where  x is 
some letter.



Make sure they (the USB sticks) are not mounted,  and do NOT use the 
other existing device files in /dev,  except for the ones that showed up 
new and represent the USB stick






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


Re: [Emc-users] cloning hard drive to new SSD

2020-04-23 Thread R C


On 4/23/20 11:10 AM, Rafael Skodlar wrote:

On 2020-04-23 07:56, R C wrote:

well, you can do it with dd, but the details are tricky at times.


You are not just "cloning" a disk, like you used to copy a disk. I 
drive has multiple things, like an MBR, and


partitions and such. Most of the time to just clone a disk, copy it 
if you will, works, but what one should really


do is copy partitions, figure out how big they need to be. And then 
there's things like layout etc etc.



What clonezilla etc do, is use the same stuff, pretty much dd, except 
they have some "logic" in their software on how


why mess with installing that when core utilities and a bit of bash 
can do the same.




For system/Linux people that's easy to say.  For others it's like 
standing at the edge of a cliff and get the advise,  well  just don't 
make another step.  I don't think i works that way.






to copy those partitions, MBR/fat and all that. Some drives don't 
care about alignment for example, and work not that


optimal, others might not work like that.

A "fail safe" way to do it is use sync or so.  There are different 
ways to do that though.  If you do not want to "hammer"


the drive that is failing, you still create an img/iso, mount that 
and then create a disk by partitioning/formating it, and after


that you use the mounted image with sync or so to move the files to 
your new disk.



dd works really well for copying devices, especially if they are the 
same or very similar, or for copying a device to a file/iso/img


or from an "image file" to a CD/DVD or SSD memory. Mostly used for 
RapsberryPi and such.


dd is just a tool, very versatile and powerful, but as with all 
tools, you need to know the details on how to use it and for what.


Bravo. I'm horrified reading recommendations to use dd for cloning 
files on storage devices. dd copies fragmented files as is so you are 
messing new drive for performance issues from the get go.


The best use for dd is in computer forensics and virtualization 
environments for the same purpose or "deep troubleshooting" to find 
out why a VM has issues.


I mentioned rsync to be one of the best and most effective utilities 
for cloning locally or remotely in my experience. One option 
"--dry-run" allows you to see what will happen without making a big 
mistake if you are not careful.


There is another way to copy/clone files I learned in my Sun 
OS/Solaris days.


Drive 1, /dev/sdb mounted /tmp/disk1
Drive 2, /dev/sdc mounted /tmp/disk2

(cd /tmp/disk1; tar cfp - *) | (cd /tmp/disk2; tar xvf -)

* assumes all directories but you can just name a few for the process.

tar utility was always on all Unix systems, rsync was not. There is 
one more utility worth mentioning: cpio
You can change file ownership during file copy/clone process which is 
some times necessary.


I miss days when utilities mt and rmt were needed for files 
manipulation! It's magic to watch tape reels spin one way or the 
other. No silly G-code needed to spin reels or have the drive suck 
tape into vacuum chambers  ;-)





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


Re: [Emc-users] cloning hard drive to new SSD

2020-04-23 Thread R C
correct  BUT  if you don't do that you won't have an exact copy,  and if 
you have "so so" sectors, you might not be able to fix that  on


a "regular" copied drive.  Also, some of these copy utilities do not 
know why something is in a different order.


(older copy protection worked like that,  part of the trick was to stick 
a key in a fragmented file, that you read "sparse"..  BUT  if someone 
copied that


key,  the copy process would exactly do what you describe, de-fragment 
it, and consequently destroy the key.




Oh and nothing to be horrified about,  just don't write to the  old 
drive,  dd for sure doesn' as long as the drive is used in the if.



Also,  you can mount the drive as root,  and work with it as non root  
and it won't write on it.   that's 2 layers right there.



If you just want copies of the files and not an exact copy of the drive 
..  why not just copy all the files/directories you need?


On 4/23/20 12:15 PM, Jon Elson wrote:

On 04/23/2020 12:10 PM, Rafael Skodlar wrote:


Bravo. I'm horrified reading recommendations to use dd for cloning 
files on storage devices. dd copies fragmented files as is so you are 
messing new drive for performance issues from the get go.


Yes, this is true.  But, if you copy the partitions with cp, rsync or 
whatever, you get a more efficient file system, but grub will not be 
able to immediately load the kernel.  You then have to re-run grub
to link to where the kernel is now placed in the file system. This is 
doable, but a bit complicated.


Jon


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



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


Re: [Emc-users] cloning hard drive to new SSD

2020-04-23 Thread Jon Elson

On 04/23/2020 12:10 PM, Rafael Skodlar wrote:


Bravo. I'm horrified reading recommendations to use dd for 
cloning files on storage devices. dd copies fragmented 
files as is so you are messing new drive for performance 
issues from the get go.


Yes, this is true.  But, if you copy the partitions with cp, 
rsync or whatever, you get a more efficient file system, but 
grub will not be able to immediately load the kernel.  You 
then have to re-run grub
to link to where the kernel is now placed in the file 
system.  This is doable, but a bit complicated.


Jon


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


Re: [Emc-users] cloning hard drive to new SSD

2020-04-23 Thread Rafael Skodlar

On 2020-04-23 07:56, R C wrote:

well, you can do it with dd, but the details are tricky at times.


You are not just "cloning" a disk, like you used to copy a disk. I drive 
has multiple things, like an MBR, and


partitions and such. Most of the time to just clone a disk, copy it if 
you will, works, but what one should really


do is copy partitions, figure out how big they need to be. And then 
there's things like layout etc etc.



What clonezilla etc do, is use the same stuff, pretty much dd, except 
they have some "logic" in their software on how


why mess with installing that when core utilities and a bit of bash can 
do the same.




to copy those partitions, MBR/fat and all that. Some drives don't care 
about alignment for example, and work not that


optimal, others might not work like that.

A "fail safe" way to do it is use sync or so.  There are different ways 
to do that though.  If you do not want to "hammer"


the drive that is failing, you still create an img/iso, mount that and 
then create a disk by partitioning/formating it, and after


that you use the mounted image with sync or so to move the files to your 
new disk.



dd works really well for copying devices, especially if they are the 
same or very similar, or for copying a device to a file/iso/img


or from an "image file" to a CD/DVD or SSD memory. Mostly used for 
RapsberryPi and such.


dd is just a tool, very versatile and powerful, but as with all tools, 
you need to know the details on how to use it and for what.


Bravo. I'm horrified reading recommendations to use dd for cloning files 
on storage devices. dd copies fragmented files as is so you are messing 
new drive for performance issues from the get go.


The best use for dd is in computer forensics and virtualization 
environments for the same purpose or "deep troubleshooting" to find out 
why a VM has issues.


I mentioned rsync to be one of the best and most effective utilities for 
cloning locally or remotely in my experience. One option "--dry-run" 
allows you to see what will happen without making a big mistake if you 
are not careful.


There is another way to copy/clone files I learned in my Sun OS/Solaris 
days.


Drive 1, /dev/sdb mounted /tmp/disk1
Drive 2, /dev/sdc mounted /tmp/disk2

(cd /tmp/disk1; tar cfp - *) | (cd /tmp/disk2; tar xvf -)

* assumes all directories but you can just name a few for the process.

tar utility was always on all Unix systems, rsync was not. There is one 
more utility worth mentioning: cpio
You can change file ownership during file copy/clone process which is 
some times necessary.


I miss days when utilities mt and rmt were needed for files 
manipulation! It's magic to watch tape reels spin one way or the other. 
No silly G-code needed to spin reels or have the drive suck tape into 
vacuum chambers  ;-)


--
Rafael Skodlar


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


Re: [Emc-users] cloning hard drive to new SSD

2020-04-23 Thread R C

well, you can do it with dd, but the details are tricky at times.


You are not just "cloning" a disk, like you used to copy a disk. I drive 
has multiple things, like an MBR, and


partitions and such. Most of the time to just clone a disk, copy it if 
you will, works, but what one should really


do is copy partitions, figure out how big they need to be. And then 
there's things like layout etc etc.



What clonezilla etc do, is use the same stuff, pretty much dd, except 
they have some "logic" in their software on how


to copy those partitions, MBR/fat and all that. Some drives don't care 
about alignment for example, and work not that


optimal, others might not work like that.

A "fail safe" way to do it is use sync or so.  There are different ways 
to do that though.  If you do not want to "hammer"


the drive that is failing, you still create an img/iso, mount that and 
then create a disk by partitioning/formating it, and after


that you use the mounted image with sync or so to move the files to your 
new disk.



dd works really well for copying devices, especially if they are the 
same or very similar, or for copying a device to a file/iso/img



dd is just a tool, very versatile and powerful, but as with all tools, 
you need to know the details on how to use it and for what.





On 4/23/20 1:26 AM, Glenn Edwards wrote:

I posed this same request to the group a couple weeks back.  I was going to
wait until I was successful with two clones before I reported my results,
but here is what I tried and what worked.  All my problems with cloning
arose from making a bootable HD.  dd failed to make a bootable drive for me
and so did clonezilla, at first.  Finally I made the target drive bootable
by using a LiveCD to install Ubuntu.  Then I used clonezilla to clone and
went into expert mode to instruct it to stay away from the boot partition.
That finally worked for me and I will try it on another drive this
weekend.  Also, there are two versions of Clonezilla, for old and new
hardware, so make sure you pick the right one.  BTW, all the advice about
the target drive being larger than the source: believe it.
-- --
Glenn


On Wed, Apr 22, 2020 at 8:59 PM nkp  wrote:


I use Clonezilla for this.
Great-great program!
https://clonezilla.org


23.04.2020 06:37, R C пишет:

if the new disk is smaller, unlikely nowadays, you might be able to
shrink it  image you created (if you did), effectively

it just truncates the file/iso and leave the empty space out.



On 4/22/20 9:31 PM, Jon Elson wrote:

On 04/22/2020 09:22 PM, 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)



Well, there are two basic procedures.  As long as the new drive is at
least as large or larger than the old drive, then you can make an
absolute clone in a few hours with the dd command.

Best to boot off a live dvd, figure out the names of the two drives
and then

|dd  if=/dev/sdX of=/dev/sdY bs=64K conv=noerror,sync

if= is the input disk, of= is the output disk.  Replace X and Y with
the appropriate letters.Make REALLY sure you get
these right, or you will end up wiping the old disk.

To make sure, you can use fdisk /dev/sdX
and then type p to see the partition tables and makes of the drives.
That should tell you for sure which one has the linux file system,
and which one probably has no partitions set up.

The above procedure may not be real fast.

If the new drive is larger, you can then expand the Linux file system to
fill the disk.

If the new disk is smaller, then this won't work.


*** ONLY do the following if the new disk is smaller than the old one
***

You have to create
partitions with fdisk, make the file systems with mkfs and then copy
all the files with :

# mkdir /mnt/original
# mkdir /mnt/copy
# mount /dev/sdX#  /mnt/original
# mount /dev/sdY#  /mnt/copy
where X is for the original disk, Y is the copy, and # is the
partition number
# cp -rfa /mnt/original /mnt/copy
 and repeat this for all partitions (you don't need to copy the
 swapfile partition.  You create that with mkswap.

Now, the big issue here is that since files have been moved around on
the disk,
the grub loader will not know where to find them.  So, you have to
use the
live DVD system to run grub to update the loader to know where things
are.
The procedure is a bit involved, so I won't detail it unless you need to
go that route.

Jon

|


___
Emc-users mailing list
Emc-users@lists.sourceforge.net

Re: [Emc-users] cloning hard drive to new SSD

2020-04-23 Thread Marshland Engineering
I use Macrium Reflect on Windows. It backups everything, windows, Linux, boot
partitions etc and can even restore to a smaller drive. Been using it for
years and works very well.  Worth having a PC in the background just for this.

Cheers Wallace



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


Re: [Emc-users] cloning hard drive to new SSD

2020-04-23 Thread Gregg Eshelman via Emc-users
Or download the System Rescue CD, boot it, launch the GUI (how to do that is on 
the screen, just type startx then hit enter) and use the GUI version of GPartEd 
(GNU Partition Editor). The drive you clone to still has to be exactly the same 
size or larger because it can't simultaneously clone and resize on the fly like 
most Windows partition tools can.
 
To clone to a smaller drive in Linux you first have to resize the origin 
drive's partition down so it'll fit the destination drive. That can be an iffy 
thing if the origin drive is failing or must be preserved for forensic/evidence 
purposes.

On Wednesday, April 22, 2020, 9:33:59 PM MDT, Jon Elson 
 wrote:  
 On 04/22/2020 09:22 PM, 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)
>
>
Well, there are two basic procedures.  As long as the new 
drive is at least as large or larger than the old drive, 
then you can make an absolute clone in a few hours with the 
dd command.

Best to boot off a live dvd, figure out the names of the two 
drives and then

|dd  if=/dev/sdX of=/dev/sdY bs=64K conv=noerror,sync

if= is the input disk, of= is the output disk.  Replace X and Y with
the appropriate letters.Make REALLY sure you get
these right, or you will end up wiping the old disk.

To make sure, you can use fdisk /dev/sdX
and then type p to see the partition tables and makes of the drives.
That should tell you for sure which one has the linux file system,
and which one probably has no partitions set up.

The above procedure may not be real fast.

If the new drive is larger, you can then expand the Linux file system to
fill the disk.

If the new disk is smaller, then this won't work.


*** ONLY do the following if the new disk is smaller than the old one ***

You have to create
partitions with fdisk, make the file systems with mkfs and then copy
all the files with :

# mkdir /mnt/original
# mkdir /mnt/copy
# mount /dev/sdX#  /mnt/original
# mount /dev/sdY#  /mnt/copy
    where X is for the original disk, Y is the copy, and # is the partition 
number
# cp -rfa /mnt/original /mnt/copy
        and repeat this for all partitions (you don't need to copy the
        swapfile partition.  You create that with mkswap.

Now, the big issue here is that since files have been moved around on the disk,
the grub loader will not know where to find them.  So, you have to use the
live DVD system to run grub to update the loader to know where things are.
The procedure is a bit involved, so I won't detail it unless you need to
go that route.

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


Re: [Emc-users] cloning hard drive to new SSD

2020-04-23 Thread Gregg Eshelman via Emc-users
For Linux the tool to use is dd in a terminal window. Google how to clone disk 
with linux dd

On Windows there's the free AOMEI Partition Assistant, or their free Backupper. 
I know Partition Assistant can copy non-Windows partitions, and under the 
advanced settings it has a box to check for adjusting alignment for SSD. 
Another one is EaseUS Partition Master, which has a free version.
 
On Wednesday, April 22, 2020, 8:25:54 PM MDT, 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  
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] cloning hard drive to new SSD

2020-04-23 Thread Glenn Edwards
I posed this same request to the group a couple weeks back.  I was going to
wait until I was successful with two clones before I reported my results,
but here is what I tried and what worked.  All my problems with cloning
arose from making a bootable HD.  dd failed to make a bootable drive for me
and so did clonezilla, at first.  Finally I made the target drive bootable
by using a LiveCD to install Ubuntu.  Then I used clonezilla to clone and
went into expert mode to instruct it to stay away from the boot partition.
That finally worked for me and I will try it on another drive this
weekend.  Also, there are two versions of Clonezilla, for old and new
hardware, so make sure you pick the right one.  BTW, all the advice about
the target drive being larger than the source: believe it.
-- --
Glenn


On Wed, Apr 22, 2020 at 8:59 PM nkp  wrote:

> I use Clonezilla for this.
> Great-great program!
> https://clonezilla.org
>
>
> 23.04.2020 06:37, R C пишет:
> > if the new disk is smaller, unlikely nowadays, you might be able to
> > shrink it  image you created (if you did), effectively
> >
> > it just truncates the file/iso and leave the empty space out.
> >
> >
> >
> > On 4/22/20 9:31 PM, Jon Elson wrote:
> >> On 04/22/2020 09:22 PM, 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)
> >>>
> >>>
> >> Well, there are two basic procedures.  As long as the new drive is at
> >> least as large or larger than the old drive, then you can make an
> >> absolute clone in a few hours with the dd command.
> >>
> >> Best to boot off a live dvd, figure out the names of the two drives
> >> and then
> >>
> >> |dd  if=/dev/sdX of=/dev/sdY bs=64K conv=noerror,sync
> >>
> >> if= is the input disk, of= is the output disk.  Replace X and Y with
> >> the appropriate letters.Make REALLY sure you get
> >> these right, or you will end up wiping the old disk.
> >>
> >> To make sure, you can use fdisk /dev/sdX
> >> and then type p to see the partition tables and makes of the drives.
> >> That should tell you for sure which one has the linux file system,
> >> and which one probably has no partitions set up.
> >>
> >> The above procedure may not be real fast.
> >>
> >> If the new drive is larger, you can then expand the Linux file system to
> >> fill the disk.
> >>
> >> If the new disk is smaller, then this won't work.
> >>
> >>
> >> *** ONLY do the following if the new disk is smaller than the old one
> >> ***
> >>
> >> You have to create
> >> partitions with fdisk, make the file systems with mkfs and then copy
> >> all the files with :
> >>
> >> # mkdir /mnt/original
> >> # mkdir /mnt/copy
> >> # mount /dev/sdX#  /mnt/original
> >> # mount /dev/sdY#  /mnt/copy
> >>where X is for the original disk, Y is the copy, and # is the
> >> partition number
> >> # cp -rfa /mnt/original /mnt/copy
> >> and repeat this for all partitions (you don't need to copy the
> >> swapfile partition.  You create that with mkswap.
> >>
> >> Now, the big issue here is that since files have been moved around on
> >> the disk,
> >> the grub loader will not know where to find them.  So, you have to
> >> use the
> >> live DVD system to run grub to update the loader to know where things
> >> are.
> >> The procedure is a bit involved, so I won't detail it unless you need to
> >> go that route.
> >>
> >> Jon
> >>
> >> |
> >>
> >>
> >> ___
> >> Emc-users mailing list
> >> Emc-users@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/emc-users
> >
> >
> > ___
> > Emc-users mailing list
> > Emc-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/emc-users
>
>
>
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users
>

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


Re: [Emc-users] cloning hard drive to new SSD

2020-04-22 Thread nkp

I use Clonezilla for this.
Great-great program!
https://clonezilla.org


23.04.2020 06:37, R C пишет:
if the new disk is smaller, unlikely nowadays, you might be able to 
shrink it  image you created (if you did), effectively


it just truncates the file/iso and leave the empty space out.



On 4/22/20 9:31 PM, Jon Elson wrote:

On 04/22/2020 09:22 PM, 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)


Well, there are two basic procedures.  As long as the new drive is at 
least as large or larger than the old drive, then you can make an 
absolute clone in a few hours with the dd command.


Best to boot off a live dvd, figure out the names of the two drives 
and then


|dd  if=/dev/sdX of=/dev/sdY bs=64K conv=noerror,sync

if= is the input disk, of= is the output disk.  Replace X and Y with
the appropriate letters.Make REALLY sure you get
these right, or you will end up wiping the old disk.

To make sure, you can use fdisk /dev/sdX
and then type p to see the partition tables and makes of the drives.
That should tell you for sure which one has the linux file system,
and which one probably has no partitions set up.

The above procedure may not be real fast.

If the new drive is larger, you can then expand the Linux file system to
fill the disk.

If the new disk is smaller, then this won't work.


*** ONLY do the following if the new disk is smaller than the old one 
***


You have to create
partitions with fdisk, make the file systems with mkfs and then copy
all the files with :

# mkdir /mnt/original
# mkdir /mnt/copy
# mount /dev/sdX#  /mnt/original
# mount /dev/sdY#  /mnt/copy
   where X is for the original disk, Y is the copy, and # is the 
partition number

# cp -rfa /mnt/original /mnt/copy
and repeat this for all partitions (you don't need to copy the
swapfile partition.  You create that with mkswap.

Now, the big issue here is that since files have been moved around on 
the disk,
the grub loader will not know where to find them.  So, you have to 
use the
live DVD system to run grub to update the loader to know where things 
are.

The procedure is a bit involved, so I won't detail it unless you need to
go that route.

Jon

|


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



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




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


Re: [Emc-users] cloning hard drive to new SSD

2020-04-22 Thread R C
if the new disk is smaller, unlikely nowadays, you might be able to 
shrink it  image you created (if you did), effectively


it just truncates the file/iso and leave the empty space out.



On 4/22/20 9:31 PM, Jon Elson wrote:

On 04/22/2020 09:22 PM, 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)


Well, there are two basic procedures.  As long as the new drive is at 
least as large or larger than the old drive, then you can make an 
absolute clone in a few hours with the dd command.


Best to boot off a live dvd, figure out the names of the two drives 
and then


|dd  if=/dev/sdX of=/dev/sdY bs=64K conv=noerror,sync

if= is the input disk, of= is the output disk.  Replace X and Y with
the appropriate letters.Make REALLY sure you get
these right, or you will end up wiping the old disk.

To make sure, you can use fdisk /dev/sdX
and then type p to see the partition tables and makes of the drives.
That should tell you for sure which one has the linux file system,
and which one probably has no partitions set up.

The above procedure may not be real fast.

If the new drive is larger, you can then expand the Linux file system to
fill the disk.

If the new disk is smaller, then this won't work.


*** ONLY do the following if the new disk is smaller than the old one ***

You have to create
partitions with fdisk, make the file systems with mkfs and then copy
all the files with :

# mkdir /mnt/original
# mkdir /mnt/copy
# mount /dev/sdX#  /mnt/original
# mount /dev/sdY#  /mnt/copy
   where X is for the original disk, Y is the copy, and # is the 
partition number

# cp -rfa /mnt/original /mnt/copy
    and repeat this for all partitions (you don't need to copy the
    swapfile partition.  You create that with mkswap.

Now, the big issue here is that since files have been moved around on 
the disk,
the grub loader will not know where to find them.  So, you have to use 
the
live DVD system to run grub to update the loader to know where things 
are.

The procedure is a bit involved, so I won't detail it unless you need to
go that route.

Jon

|


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



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


Re: [Emc-users] cloning hard drive to new SSD

2020-04-22 Thread R C

do you have access to a unix box?  because there it's really easy to do.


Take the drive you want to "copy", connect it to a inix box and make 
sure it is not mounted.


Look up whatthe device isin, /dev.   with most drive it should be 
something like /dev/sdb  or sdc etc.  you can see it when you plug it 
in  AND


you can actually check it by mounting typically the first partition and 
check what's on it.



with the unmounted drive,  let's say it's /dev/sdx you do something like:


dd if=/dev/sdx of=/path/to/where/you/want/it/my-old-disk.iso bs=1M

and unplug the drive.

Now you have a disk image,  and you still have your unmodified drive,  
so you can try the next step until you have it right.



Take the new drive, hook it up make sure it is not mounted AND bigger 
(or at least the same size as your old drive.)



Let's say it's  /dev/sdy this time around when plugged in. then:


dd if=/path/to/where/you/want/it/my-old-disk.iso of=/dev/sdy BS=1M


and there it is.   If the drive is bigger you are left with unused 
space,  you can either make another partition, or you can expand one


of the partitions you put on there.  If you create another partion, 
you'll end up with something that looks like you have another drive, 
logically, not physically of course.




Ron

On 4/22/20 8:22 PM, 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

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



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


Re: [Emc-users] cloning hard drive to new SSD

2020-04-22 Thread Rafael Skodlar

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   TypeSizeUsedPriority
/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


Re: [Emc-users] cloning hard drive to new SSD

2020-04-22 Thread Jon Elson

On 04/22/2020 09:22 PM, 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)


Well, there are two basic procedures.  As long as the new 
drive is at least as large or larger than the old drive, 
then you can make an absolute clone in a few hours with the 
dd command.


Best to boot off a live dvd, figure out the names of the two 
drives and then


|dd  if=/dev/sdX of=/dev/sdY bs=64K conv=noerror,sync

if= is the input disk, of= is the output disk.  Replace X and Y with
the appropriate letters.Make REALLY sure you get
these right, or you will end up wiping the old disk.

To make sure, you can use fdisk /dev/sdX
and then type p to see the partition tables and makes of the drives.
That should tell you for sure which one has the linux file system,
and which one probably has no partitions set up.

The above procedure may not be real fast.

If the new drive is larger, you can then expand the Linux file system to
fill the disk.

If the new disk is smaller, then this won't work.


*** ONLY do the following if the new disk is smaller than the old one ***

You have to create
partitions with fdisk, make the file systems with mkfs and then copy
all the files with :

# mkdir /mnt/original
# mkdir /mnt/copy
# mount /dev/sdX#  /mnt/original
# mount /dev/sdY#  /mnt/copy
   where X is for the original disk, Y is the copy, and # is the partition 
number
# cp -rfa /mnt/original /mnt/copy
and repeat this for all partitions (you don't need to copy the
swapfile partition.  You create that with mkswap.

Now, the big issue here is that since files have been moved around on the disk,
the grub loader will not know where to find them.  So, you have to use the
live DVD system to run grub to update the loader to know where things are.
The procedure is a bit involved, so I won't detail it unless you need to
go that route.

Jon

|


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