Copy existing hdd to new larger hdd...

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
Pastcal
Level 3
Level 3
Posts: 107
Joined: Tue May 07, 2013 12:06 pm

Copy existing hdd to new larger hdd...

Post by Pastcal » Sat Feb 09, 2019 7:15 am

I've run out of space on an old laptop I keep around because it has a Win7 installation as well as LM. The LM part is more-or-less full. I'd like to put in a larger disk without a reinstall. Due diligence has brought me advice on using dd, g4u, clonezilla, gparted, etc etc.

What's the current thinking on this issue? Advice please, but speak slowly and clearly.

fabien85
Level 6
Level 6
Posts: 1442
Joined: Tue Mar 11, 2014 4:30 pm

Re: Copy existing hdd to new larger hdd...

Post by fabien85 » Sat Feb 09, 2019 7:43 am

First, the operation should be slow (except if both disks are SSD), and you should try to use the best connection you have. USB3 (or 3.1 or SATA) is good, USB2 will significantly slow down the cloning.
Second, you will probably need to reinstall grub to the new drive after cloning. There are instructions for that, it's ok.

gparted is the simplest to use, because you always work with a graphical interface. Cloning a partition is as simple as clicking on it, Partition > Copy (or ctrl+c), go to the ne drive in the drop list on the right, click on the empty unallocated space, then Partition > Paste (or ctrl+v), then go grab a coffee or tea.

dd works from command line only. It's good if you want to clone the whole disk in a single command, and/or if you want to clone the Master Boot Record (MBR) (I dont know how to clone the latter with gparted).

One thing that would be good to know is how your current drive is formatted (msdos/mbr or gpt), and whether the new drive is in the same format.
Please connect the new drive, run the following command and post here the result between code tags (button </> above the typing area) :

Code: Select all

sudo parted --list

Pastcal
Level 3
Level 3
Posts: 107
Joined: Tue May 07, 2013 12:06 pm

Re: Copy existing hdd to new larger hdd...

Post by Pastcal » Sat Feb 09, 2019 8:01 am

The current drive is very elderly, so probably MBR, but I'm at home so I can't check.

Charlie
Level 4
Level 4
Posts: 311
Joined: Sun Jul 09, 2017 10:09 am
Location: Eng-er-land

Re: Copy existing hdd to new larger hdd...

Post by Charlie » Sat Feb 09, 2019 5:08 pm

Pastcal wrote:
Sat Feb 09, 2019 8:01 am
The current drive is very elderly, so probably MBR, but I'm at home so I can't check.
Being lazy I use a hardware solution. An external dock with cloning ability.

Pastcal
Level 3
Level 3
Posts: 107
Joined: Tue May 07, 2013 12:06 pm

Re: Copy existing hdd to new larger hdd...

Post by Pastcal » Mon Feb 11, 2019 10:50 am

Progress! Of a sort...
I used dd from a Linux Mint live USB. :
dd if=/dev/sda of=/dev/sdc bs=64k conv=noerror,sync status=progress

Everything started up ok, but the disk is now somewhat err jumbled. Here's a screenie from 'Disks'. (attached)

Any advice on getting it into some kind of order. Ta.
Attachments
disks screenie.png

User avatar
WharfRat
Level 20
Level 20
Posts: 12366
Joined: Thu Apr 07, 2011 8:15 pm

Re: Copy existing hdd to new larger hdd...

Post by WharfRat » Mon Feb 11, 2019 10:54 am

dd will make an exact 'mirror' copy of the source disk to the destination.

If the destination is larger than the source then there will be unused space at the end.

So you will have to use gparted to move/resize/extend the partitions.
ImageImage

Pastcal
Level 3
Level 3
Posts: 107
Joined: Tue May 07, 2013 12:06 pm

Re: Copy existing hdd to new larger hdd...

Post by Pastcal » Tue Feb 12, 2019 5:53 am

Further progress, hurrah! I used gparted to resize the LM partition, BUT (you knew that was coming) I had to remove the swap partition first. Now I've go lots of space but no swap partition. For the sake of tidyness, how do I recreate the swap partition? Advice plz.

User avatar
WharfRat
Level 20
Level 20
Posts: 12366
Joined: Thu Apr 07, 2011 8:15 pm

Re: Copy existing hdd to new larger hdd...

Post by WharfRat » Tue Feb 12, 2019 9:08 am

Pastcal wrote:
Tue Feb 12, 2019 5:53 am
Further progress, hurrah! I used gparted to resize the LM partition, BUT (you knew that was coming) I had to remove the swap partition first. Now I've go lots of space but no swap partition. For the sake of tidyness, how do I recreate the swap partition? Advice plz.
Attach a gparted screenshot so we can see what the layout is now.
ImageImage

hcentaur13
Level 4
Level 4
Posts: 260
Joined: Sat May 18, 2013 5:13 pm

Re: Copy existing hdd to new larger hdd...

Post by hcentaur13 » Tue Feb 12, 2019 10:54 am

return to live system! You needs it because it is the only way you can modify the system when it is in use.

Open gparted
extend the extended partition to the size it shoul have. You can move the extended partition by that to give the other partitions more room if needed
Thereafter you can do the same with the logicakl drives in it.

You can experiment without something is really done until you says gparted it should do the work really!

The extended partition is only a container that holds the logical drive. So you must extend the container to get free room in it that can given to the logical drives. the firsrt logical drive can ony be extended when there is free space between it and before the next one.

Pastcal
Level 3
Level 3
Posts: 107
Joined: Tue May 07, 2013 12:06 pm

Re: Copy existing hdd to new larger hdd...

Post by Pastcal » Tue Feb 12, 2019 11:02 am

[/quote]

Attach a gparted screenshot so we can see what the layout is now.
[/quote]

Attached a 'Disks' screenie as Gparted won't install and the Gparted off the Systemrescue CD won't take screen shots.
Attachments
disk screenie 2.png

User avatar
WharfRat
Level 20
Level 20
Posts: 12366
Joined: Thu Apr 07, 2011 8:15 pm

Re: Copy existing hdd to new larger hdd...

Post by WharfRat » Tue Feb 12, 2019 3:02 pm

You will have to reduce partition 5 by 2G (that was the size of your original swap) then in the unused space create a partition and format it as swap.

After that you will have to add the UUID to /etc/fstab for the new swap partition.

Use sudo blkid|grep swap to identify the swap partition.
ImageImage

Post Reply

Return to “Newbie Questions”