Choose style:

Author Topic: Cloning Hard drives refresher course  (Read 975 times)

0 Members and 1 Guest are viewing this topic.

Offline alynur

  • Trusted User
  • Member
  • *****
  • Posts: 967
  • Karma: 54
  • Habitual Forum Browser
    • View Profile
  • Peppermint version(s): P 9 (64bit), P 9 R
Re: Cloning Hard drives refresher course
« Reply #15 on: March 20, 2019, 07:37:37 pm »
I think GParted would be faster but I don't normally copy such large partitions. If you're talking about trying to compress it onto a smaller drive, that would take even longer, even if you had a big enough USB drive.

If these are both actually SSDs rather than HDs then it will all be much quicker.


I was just reading about cloning, thinking about using clonezilla, and it was mentioned that both hard drives need to have the same sector sizes and that using dd command is more secure. The source SSD is 250gb and the target SSD is 500gb. Pin didn't mention if his discs were HDs or SSDs. I think I'll stick with the original plan but if I knew how to check the sector sizes of the new, blank SSD, I might give clonezilla a go. Decisions decisions. Worse case scenario, I can start from scratch with both SSDs.
What was I thinking?

Offline pin

  • Trusted User
  • Veteran
  • *****
  • Posts: 1755
  • Karma: 245
    • View Profile
Re: Cloning Hard drives refresher course
« Reply #16 on: March 21, 2019, 05:11:28 am »
Hi alynur!
I only have SSDs.
If a disk has no partitions on it, does it even make sense to talk about disk sectors?  :-\  :-\
I honestly don't know!!

Anyway, if you want to check your disk, you can use fdisk.
I've only done this on *BSD, and the command is

Code: [Select]
fdisk wd0

I guess that on Linux it should be

Code: [Select]
fdisk /dev/sda 
or whatever your new disk is called. Check https://linux.die.net/man/8/fdisk for the syntax if you want, but I've never had any issues with dd. Do let us know how it goes  ;)
« Last Edit: March 24, 2019, 02:26:32 pm by pin »
Just say NO to flatpak and snap!!

Offline alynur

  • Trusted User
  • Member
  • *****
  • Posts: 967
  • Karma: 54
  • Habitual Forum Browser
    • View Profile
  • Peppermint version(s): P 9 (64bit), P 9 R
Re: Cloning Hard drives refresher course
« Reply #17 on: March 21, 2019, 10:34:43 am »
Hi alynur!
I only have SSDs.
If a disk has no partitions on it, does it even make sense to talk about disk sectors?  :-\  :-\
I honestly don't know!!

Anyway, if you want to check your disk, you can use fdisk.
I've only done this on *BSD, and the command is

Code: [Select]
fdisk sd0



I guess that on Linux it should be

Code: [Select]
fdisk /dev/sda 
or whatever your new disk is called. Check https://linux.die.net/man/8/fdisk for the syntax if you want, but I've never had any issues with dd. Do let us know how it goes  ;)

Hi pin, I should have known you only have SSDs. I thought the minimum rewrite speed for SSDs was 3gb a minute. I guess it depends on cpu. Anyway, the above site you mentioned had this
Code: [Select]
fdisk doesn't understand GUID Partition Table (GPT) and it is not designed for large partitions. In particular case use more advanced GNU parted(8).

I think I can just run
Code: [Select]
sudo parted -ls
and get what I'm looking for, I ran that last night after my last post here and I was finally able to decipher the info given. I'll let you know what I do and how it turned out, thanks.
What was I thinking?

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 24908
  • Karma: 2751
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: Cloning Hard drives refresher course
« Reply #18 on: March 21, 2019, 12:26:01 pm »
"sectors" have nothing to do with "partitions".

What's the problem/confusion now ?
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline pin

  • Trusted User
  • Veteran
  • *****
  • Posts: 1755
  • Karma: 245
    • View Profile
Re: Cloning Hard drives refresher course
« Reply #19 on: March 21, 2019, 02:25:03 pm »
"sectors" have nothing to do with "partitions".

What's the problem/confusion now ?
Yes, that I know  :)
I was just wondering if an unpartitioned disk contains sectors or not  :-\
Sorry if that sounds dumb  ::)
Just say NO to flatpak and snap!!

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 24908
  • Karma: 2751
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: Cloning Hard drives refresher course
« Reply #20 on: March 21, 2019, 02:43:25 pm »
"sectors" have nothing to do with "partitions".

What's the problem/confusion now ?
Yes, that I know  :)
I was just wondering if an unpartitioned disk contains sectors or not  :-\
Sorry if that sounds dumb  ::)
Not really "sectors" as such, maybe I should have said dd copies "block by block" ;)

Sent from my SM-N960F using Tapatalk
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline pin

  • Trusted User
  • Veteran
  • *****
  • Posts: 1755
  • Karma: 245
    • View Profile
Re: Cloning Hard drives refresher course
« Reply #21 on: March 21, 2019, 03:08:00 pm »
That was what I thought, but couldn't find enough evidence to convince myself that it was so  :)
You see, @alynur is worried about mismatched sector sizes between origin and target. While, excuse me the wording, I don't think dd gives a f**k about it!! As it doesn't care if you already have a partition scheme or not  ;)

I must say, I really like dd, it does what you tell it to do without asking a second time, ...for the better or worst  :D
Just say NO to flatpak and snap!!

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 24908
  • Karma: 2751
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: Cloning Hard drives refresher course
« Reply #22 on: March 21, 2019, 03:17:48 pm »
Sorry my mistake, I shoulda read this topic more closely :-[

Exactly, dd will copy block by block .. so sector sizes on the target will reflect whatever was on the source (as they get reproduced too).

As you elegantly put it - dd doesn't give a f**k, it just copies EXACLTY the source (sectors/partitions/data/everything .. even bad blocks) .. dd is NOT copying "data", it's cloning blocks.

Basically it's copying a bunch of 'zero's and 'ones' .. it doesn't care what they represent, it just copies them in the same order.
« Last Edit: March 21, 2019, 03:23:32 pm by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline alynur

  • Trusted User
  • Member
  • *****
  • Posts: 967
  • Karma: 54
  • Habitual Forum Browser
    • View Profile
  • Peppermint version(s): P 9 (64bit), P 9 R
Re: Cloning Hard drives refresher course
« Reply #23 on: March 21, 2019, 03:36:21 pm »
This I understand. In a thread I was reading about using clonezilla, the poster mentioned that if the sector sizes didn't match problems would appear, he didn't say what problems. He went on to say that if not sure then use dd.
What was I thinking?

Offline pin

  • Trusted User
  • Veteran
  • *****
  • Posts: 1755
  • Karma: 245
    • View Profile
Re: Cloning Hard drives refresher course
« Reply #24 on: March 21, 2019, 04:08:44 pm »
Crystal clear now  :)
Thx alynur, now I understand where it all came from.

Good dding  :D
Just say NO to flatpak and snap!!

Offline alynur

  • Trusted User
  • Member
  • *****
  • Posts: 967
  • Karma: 54
  • Habitual Forum Browser
    • View Profile
  • Peppermint version(s): P 9 (64bit), P 9 R
Re: Cloning Hard drives refresher course
« Reply #25 on: March 21, 2019, 07:06:03 pm »
Ha! just went through a 4 hour power outage!
What was I thinking?

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 24908
  • Karma: 2751
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: Cloning Hard drives refresher course
« Reply #26 on: March 21, 2019, 07:15:00 pm »
Ouch :(
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline alynur

  • Trusted User
  • Member
  • *****
  • Posts: 967
  • Karma: 54
  • Habitual Forum Browser
    • View Profile
  • Peppermint version(s): P 9 (64bit), P 9 R
Re: Cloning Hard drives refresher course
« Reply #27 on: March 23, 2019, 12:38:52 pm »
Well that was fun. I thought I would try the quickest method first and work towards the slowest method as each method failed. First after identifying that both hard drives have sector sizes of 512g, I used clonezilla which was installed in my usb P9 instillation. That was lightning fast! Only took 6 minutes to complete. But, clonezilla screwed up, it didn't clone either of my o/s partitions, I have P 9 and Lubuntu installed. It did copy the efi partition and the DATA partition. Oh, I should have mentioned that after completing with clonezilla, I replaced the hard drives, set the old one apart, and when I tried to boot up, I got a blank screen and then a grub screen. so I thought i would try reinstalling P 9's bootloader into the device and that's where I got a message that it couldn't mount sda2 and then I started gparted and noticed that the two o/s partitions had unrecognizable file types. Well hell, so I tried the disc method and copied both o/s partitions and the efi partition restored them into the new hard drive. That worked but boot times were horrific. Now that I think of it, that could have been because I didn't copy and restore the swap partition, didn't think of that last night, damn it! Anyway, I tried a Timeshift restore of P9 but that didn't help the boot time any. So I figured I would do a fresh install of P9 and that fixed the boot time but after doing Timeshift and Aptik restores, it wouldn't boot, don't remember what the message was, it was late or early depending how you look at it, about 3 AM. So I thought "oh hell, I might as well" so I opened the computer again and hooked up the old hard drive up again with it in the primary hard drive position, cable position, and booted up my usb and ran the dd code,. Since it doesn't show what it's doing, I figured I would check it when I get up, this was about 3:15AM. I had a really hard time going to sleep, probably due to the two gallons of coffee I drank the prior afternoon, and at 3:45, I checked on it and it was done. Wow, less than half an hour. I turned it off and went back to bed. at 4AM, I got up and opened the computer, took the old hard drive out, put the primary cable back on the new hard drive, repositioned the computer and fired it up. BAM, it was up and running in seconds! Rebooted into Lubuntu and it too was up and running in seconds. Everything works, symlinks,everything. I'm done, course I have to make new partitions so I can start playing with different distributions again. It's all your fault pin, you scared me with that 20 hours stuff. Don't know why clonezilla screwed up. Don't remember how I installed it. Anyway, one more notch of experience on my Peppermint belt. Thanks guys.  :)
What was I thinking?

Offline pin

  • Trusted User
  • Veteran
  • *****
  • Posts: 1755
  • Karma: 245
    • View Profile
Re: Cloning Hard drives refresher course
« Reply #28 on: March 23, 2019, 12:45:18 pm »
Sorry about that  ;)
Although, I must say I'm surprised it went so fast  :o
Just say NO to flatpak and snap!!

Offline alynur

  • Trusted User
  • Member
  • *****
  • Posts: 967
  • Karma: 54
  • Habitual Forum Browser
    • View Profile
  • Peppermint version(s): P 9 (64bit), P 9 R
Re: Cloning Hard drives refresher course
« Reply #29 on: March 23, 2019, 05:44:06 pm »
Sorry about that  ;)
Although, I must say I'm surprised it went so fast  :o

Ha ha, it was in jest. I too was surprised, I was expecting it to still be running in the morning when I got up. Now I know. I would like to know what happened to clonezilla though. I just swapped the "old SSD" into my laptop and now I have to find that thread talking about changing computer name. Thanks pin, dd command rocks!  :)
What was I thinking?