Discussion:
What's the best and easy way to copy/move my old slow 320 GB SATA HDD's updated Debian bullseye v11.3 to an old fast 115 GB SSD (going to wipe it clean)?
(too old to reply)
Ant
2022-05-19 14:56:49 UTC
Permalink
Hello.

What's the best and easy way to copy/move my old slow 320 GB SATA HDD's
updated Debian bullseye v11.3 to an old fast 115 GB SSD (going to wipe
it clean)? Yes, SSD is smaller but my Debian's installation only uses
about 8 GB. I installed Debian use the whole 320 GB drive. I will still
be using the same 13 yrs. old PC.

Thank you for reading and hopefully answering soon. :)
--
Quiet cooler week so far, but will today be slammy? Celtics have better get burned by Miami Heat!
Note: A fixed width font (Courier, Monospace, etc.) is required to see this signature correctly.
/\___/\ Ant(Dude) @ http://aqfl.net & http://antfarm.home.dhs.org.
/ /\ /\ \ Please nuke ANT if replying by e-mail.
| |o o| |
\ _ /
( )
Ant
2022-05-19 19:16:42 UTC
Permalink
My current HDD's df and /etc/fstab can be found in
https://pastebin.com/raw/zAJM6Npc.
Post by Ant
Hello.
What's the best and easy way to copy/move my old slow 320 GB SATA HDD's
updated Debian bullseye v11.3 to an old fast 115 GB SSD (going to wipe
it clean)? Yes, SSD is smaller but my Debian's installation only uses
about 8 GB. I installed Debian use the whole 320 GB drive. I will still
be using the same 13 yrs. old PC.
Thank you for reading and hopefully answering soon. :)
--
Quiet cooler week so far, but will today be slammy? Celtics have better get burned by Miami Heat!
Note: A fixed width font (Courier, Monospace, etc.) is required to see this signature correctly.
/\___/\ Ant(Dude) @ http://aqfl.net & http://antfarm.home.dhs.org.
/ /\ /\ \ Please nuke ANT if replying by e-mail.
| |o o| |
\ _ /
( )
bad sector
2022-05-21 13:51:37 UTC
Permalink
Post by Ant
My current HDD's df and /etc/fstab can be found in
https://pastebin.com/raw/zAJM6Npc.
Post by Ant
Hello.
What's the best and easy way to copy/move my old slow 320 GB SATA HDD's
updated Debian bullseye v11.3 to an old fast 115 GB SSD (going to wipe
it clean)? Yes, SSD is smaller but my Debian's installation only uses
about 8 GB. I installed Debian use the whole 320 GB drive. I will still
be using the same 13 yrs. old PC.
This is partly why I moved to and ever since advocate the use of at least two bootable linux systems on every computer. There's already plenty of great replies to your post here but I'll throw mine in just for entertainment.

"I" would install a new minimal system on the ssd, same distro, OR preferably a new one of my choice. Devuan is a Debian fork, there are many others, some good for old iron, Suse is easy to use and includes an SU file-manager that's the best idea they ever had :-)

I would boot this new system and connect (usb adapter maybe) and mount the source one on the old disk to verify the occupancy. The real occupany is a must-know item. Next I'd shrink the fs to a reasonable nominal size like maybe 9gb. This shrinking bit is actually not essential but I like to keep my act clean.

Next I would create a new partition on the ssd that's big enough to receive the old system (with service-factor reserves i.e. 2x the anticipated need, so maybe 2*9gb i.e,. 18). Then I would 'dd' the old system partition to the new ssd partition created to host it (both must be unmounted when dd runs) then expand the copied target fs to the size of the hosting partition just copied to. Then I'd mount the new and expanded system to edit its /etc/fstab as required, unmount it, and use the booted new maintenance system I'm working from to re-deploy boot code to the same currently used ssd but this time including the migrated copy in the boot menu to arrive at my final objective AND a new maintenance system.

There might be bugs in this condensed guide but it's the basic idea.
--
Artix Linux , Kernel=5.17.6-artix1-1 on x86_64,
DM=ssdm, DE=KDE, ST=x11,grub2, GPT, BIOS-boot
Loading Image...
Ant
2022-05-21 19:24:22 UTC
Permalink
I booted gparted's ISO to resize my HDD's Debian's drive to 100 GB instead of 320
GB. And then, I booted Debian bullseye v11.3's netinstaller to do a basic
installation with its single partition with the same defaults like I did in HDD. I
didn't install its GUI. Just the basic stuff for quick and easy setups.

I tested both Debian installations, and they booted fine. I booted Clonezilla's ISO
and copied HDD's Debian to SSD successfully and quickly. I rebooted to SSD, but it
still booted to HDD. What happened and how to fix it? :(
Post by Ant
My current HDD's df and /etc/fstab can be found in
https://pastebin.com/raw/zAJM6Npc.
Post by Ant
Hello.
What's the best and easy way to copy/move my old slow 320 GB SATA HDD's
updated Debian bullseye v11.3 to an old fast 115 GB SSD (going to wipe
it clean)? Yes, SSD is smaller but my Debian's installation only uses
about 8 GB. I installed Debian use the whole 320 GB drive. I will still
be using the same 13 yrs. old PC.
Thank you for reading and hopefully answering soon. :)
--
Dang computer problems! Quiet cooler week with the recent very light rain. It's like winter again! Celtics have better get burned by Miami Heat at the end of the eastern conference!
Note: A fixed width font (Courier, Monospace, etc.) is required to see this signature correctly.
/\___/\ Ant(Dude) @ http://aqfl.net & http://antfarm.home.dhs.org.
/ /\ /\ \ Please nuke ANT if replying by e-mail.
| |o o| |
\ _ /
( )
Bit Twister
2022-05-21 23:40:46 UTC
Permalink
Post by Ant
I booted gparted's ISO to resize my HDD's Debian's drive to 100 GB instead of 320
GB. And then, I booted Debian bullseye v11.3's netinstaller to do a basic
installation with its single partition with the same defaults like I did in HDD. I
didn't install its GUI. Just the basic stuff for quick and easy setups.
I tested both Debian installations, and they booted fine. I booted Clonezilla's ISO
and copied HDD's Debian to SSD successfully and quickly. I rebooted to SSD, but it
still booted to HDD. What happened and how to fix it? :(
you have to run update-grub and /grub2-install and verify ssd's /etc/fstab has
the correct values for /
David W. Hodgins
2022-05-21 23:52:43 UTC
Permalink
Post by Ant
I booted gparted's ISO to resize my HDD's Debian's drive to 100 GB instead of 320
GB. And then, I booted Debian bullseye v11.3's netinstaller to do a basic
installation with its single partition with the same defaults like I did in HDD. I
didn't install its GUI. Just the basic stuff for quick and easy setups.
I tested both Debian installations, and they booted fine. I booted Clonezilla's ISO
and copied HDD's Debian to SSD successfully and quickly. I rebooted to SSD, but it
still booted to HDD. What happened and how to fix it? :(
Duplicate uuids. Remove the sata connector from the hdd, and connect it to the
ssd. Boot with just the ssd connected to confirm it works ok. Once that's
working, connect the hdd to the sata cable the ssd was previously connected to,
boot from an iso and erase the hdd. Then, if desired, partition the hdd to use
for bulk, slow storage.

Regards, Dave Hodgins.
Ant
2022-05-23 00:45:33 UTC
Permalink
Post by David W. Hodgins
Post by Ant
I booted gparted's ISO to resize my HDD's Debian's drive to 100 GB instead of 320
GB. And then, I booted Debian bullseye v11.3's netinstaller to do a basic
installation with its single partition with the same defaults like I did in HDD. I
didn't install its GUI. Just the basic stuff for quick and easy setups.
I tested both Debian installations, and they booted fine. I booted Clonezilla's ISO
and copied HDD's Debian to SSD successfully and quickly. I rebooted to SSD, but it
still booted to HDD. What happened and how to fix it? :(
Duplicate uuids. Remove the sata connector from the hdd, and connect it to the
ssd. Boot with just the ssd connected to confirm it works ok. Once that's
working, connect the hdd to the sata cable the ssd was previously connected to,
boot from an iso and erase the hdd. Then, if desired, partition the hdd to use
for bulk, slow storage.
So, there's no way to change their UUIDs so I can have two Debian
installations?
--
Dang computer problems! Quiet cooler week with the recent very light rain. It's like winter again! Celtics have better get burned by Miami Heat at the end of the eastern conference!
Note: A fixed width font (Courier, Monospace, etc.) is required to see this signature correctly.
/\___/\ Ant(Dude) @ http://aqfl.net & http://antfarm.home.dhs.org.
/ /\ /\ \ Please nuke ANT if replying by e-mail.
| |o o| |
\ _ /
( )
Bit Twister
2022-05-23 01:57:56 UTC
Permalink
Post by Ant
So, there's no way to change their UUIDs so I can have two Debian
installations?
You need to book mark the following url
https://www.google.com/advanced_search
Putting
how do i change partition uuid linux
in the first box gets meSWQWQ
About 498,000 results (0.60 seconds)
William Unruh
2022-05-23 15:44:45 UTC
Permalink
Post by Bit Twister
Post by Ant
So, there's no way to change their UUIDs so I can have two Debian
installations?
You need to book mark the following url
https://www.google.com/advanced_search
Putting
how do i change partition uuid linux
in the first box gets meSWQWQ
About 498,000 results (0.60 seconds)
That number is of course complete non-sense. It includes every page that
has the word "How" in it, every page that has the word "change" in it, etc.
And besides how in the world does anyone look throut half a million web
pages. If it is not in the first two pages ( about 40 returns) it is
hopeless. And what does SWQWQ mean?
Bit Twister
2022-05-23 18:43:47 UTC
Permalink
Post by William Unruh
Post by Bit Twister
Post by Ant
So, there's no way to change their UUIDs so I can have two Debian
installations?
You need to book mark the following url
https://www.google.com/advanced_search
Putting
how do i change partition uuid linux
in the first box gets meSWQWQ
About 498,000 results (0.60 seconds)
That number is of course complete non-sense. It includes every page that
has the word "How" in it, every page that has the word "change" in it, etc.
And besides how in the world does anyone look throut half a million web
pages. If it is not in the first two pages ( about 40 returns) it is
hopeless.
True to a point. Just skim the titles and Usually you find the answer
in the first or second page of hits.
Post by William Unruh
And what does SWQWQ mean?
Me trying to Save response, Window close, Quit, Window close, Quit with hot
keys Ctrl x, using shift key. :(

David W. Hodgins
2022-05-23 03:27:46 UTC
Permalink
Post by Ant
So, there's no way to change their UUIDs so I can have two Debian
installations?
I don't use Debian. Assuming it's using ext4 file systems, as root
# tune2fs -U newuuid /dev/sd?#
with the correct device specified.

You can either make up a new uuid or use uuidgen to generate one that you then
then use in the tune2fs command.

See "man tune2fs" for details.

If the drive is using a gpt partition table, it' more complicated as there are
both partition uuids and file system uuids. I don't know if there is a way to
alter a partition uuid.

Regards, Dave Hodgins
Bit Twister
2022-05-23 04:02:46 UTC
Permalink
Post by David W. Hodgins
Post by Ant
So, there's no way to change their UUIDs so I can have two Debian
installations?
I don't use Debian. Assuming it's using ext4 file systems, as root
# tune2fs -U newuuid /dev/sd?#
with the correct device specified.
You can either make up a new uuid or use uuidgen to generate one that you then
then use in the tune2fs command.
See "man tune2fs" for details.
If the drive is using a gpt partition table, it' more complicated as there are
both partition uuids and file system uuids. I don't know if there is a way to
alter a partition uuid.
gparted can/does allow it.

Hehehehe, Ant's problem comes back as soon as he powers up after hooking
up drive to change UUIDs :(

He is going have to boot with a rescuecd or live OS to make the sdb
partition changes and change sdb /etc/fstab
William Unruh
2022-05-23 15:55:03 UTC
Permalink
Post by Bit Twister
Post by David W. Hodgins
Post by Ant
So, there's no way to change their UUIDs so I can have two Debian
installations?
I don't use Debian. Assuming it's using ext4 file systems, as root
# tune2fs -U newuuid /dev/sd?#
with the correct device specified.
You can either make up a new uuid or use uuidgen to generate one that you then
then use in the tune2fs command.
See "man tune2fs" for details.
If the drive is using a gpt partition table, it' more complicated as there are
both partition uuids and file system uuids. I don't know if there is a way to
alter a partition uuid.
gparted can/does allow it.
Hehehehe, Ant's problem comes back as soon as he powers up after hooking
up drive to change UUIDs :(
He is going have to boot with a rescuecd or live OS to make the sdb
partition changes and change sdb /etc/fstab
All of which says that the advice to dd the old disk onto the new disk
is pretty useless advice for a newbie. It leads into a rabbit warren.
IF you want to replace an old drive (ie you will be throwing away the
old drive afterwards) then using dd is not too bad. If you want to keep
using it, it is bad advice. Not impossible, but liable to lead to
problems.
Create new partitions on the new drive. Copy over the data using rsync.
Use the distribution tools on the installation cdrom/usb to change the
/etc/fstab on the new drive to point to the new drive, and then to boot
from the new drive.
Ant
2022-05-23 01:06:47 UTC
Permalink
OK. I think I finally got it working now after reading everyone's suggestions (thanks!).

What I did from my memory over my weekend after many trials and errors:
1. Downloaded and burned https://downloads.sourceforge.net/gparted/gparted-live-1.4.0-1-amd64.iso and https://osdn.net/projects/clonezilla/downloads/76513/clonezilla-live-2.8.1-12-amd64.iso/ to two different CD-RW.
2. Made a back up of my original HDD's datas! Duh.
3. Booted gparted from the burned CD-RW. Resized my Seagate 320 GB HDD's Debian partition to about 106 GB. Went to 115 GB SSD, deleted all partitions, and made almost the whole drive as EXT4 FS. Made a new right extended 1 GB partition with a 1 GB swap partition.
4. Rebooted to my HDD to see if its Debian still works. It did. Thanks God!
5. Rebooted to Clonezilla's burned CD-RW and copied Seagate 320 GB HDD's Debian partition to SSD which took under four minutes since it was a small installation.
6. Rebooted to SSD, but it still went to my HDD! So, I found out it was because of the confusing UUIDs from Grub.
7. Physically disconnected HDD's SATA cable and retried. It worked. I was hoping to keep both connected just in case. :(
Post by Ant
My current HDD's df and /etc/fstab can be found in
https://pastebin.com/raw/zAJM6Npc.
Post by Ant
Hello.
What's the best and easy way to copy/move my old slow 320 GB SATA HDD's
updated Debian bullseye v11.3 to an old fast 115 GB SSD (going to wipe
it clean)? Yes, SSD is smaller but my Debian's installation only uses
about 8 GB. I installed Debian use the whole 320 GB drive. I will still
be using the same 13 yrs. old PC.
Thank you for reading and hopefully answering soon. :)
--
Dang computer problems! Quiet cooler week with the recent very light rain. It's like winter again! Celtics have better get burned by Miami Heat at the end of the eastern conference!
Note: A fixed width font (Courier, Monospace, etc.) is required to see this signature correctly.
/\___/\ Ant(Dude) @ http://aqfl.net & http://antfarm.home.dhs.org.
/ /\ /\ \ Please nuke ANT if replying by e-mail.
| |o o| |
\ _ /
( )
J.O. Aho
2022-05-19 19:50:48 UTC
Permalink
Post by Ant
Hello.
What's the best and easy way to copy/move my old slow 320 GB SATA HDD's
updated Debian bullseye v11.3 to an old fast 115 GB SSD (going to wipe
it clean)? Yes, SSD is smaller but my Debian's installation only uses
about 8 GB. I installed Debian use the whole 320 GB drive. I will still
be using the same 13 yrs. old PC.
Thank you for reading and hopefully answering soon. :)
As your main partition is larger than the SSD, will make it not possible
to use dd to make a clone.

Using rsync has the limitation that it will not be able to install the
boot loader.

One alternative is to use dd to clone the beginning of the HDD to the
SDD, you would then need to repartition the SSD, format your partition
that will be used on the SSD for / and then rsync the content from the HDD.

It's a lot easier if you go from a smaller disk to larger one, as then
you can dd the old one to the new and then extend partition.


I would recommend a fresh install and then rsync the /home from the HDD
to the SSD. This way you get all your personal configurations, if you
need system configurations then you need to pick the right files from /etc.
--
//Aho
Bit Twister
2022-05-19 20:00:37 UTC
Permalink
Post by J.O. Aho
Post by Ant
Hello.
What's the best and easy way to copy/move my old slow 320 GB SATA HDD's
updated Debian bullseye v11.3 to an old fast 115 GB SSD (going to wipe
it clean)? Yes, SSD is smaller but my Debian's installation only uses
about 8 GB. I installed Debian use the whole 320 GB drive. I will still
be using the same 13 yrs. old PC.
Thank you for reading and hopefully answering soon. :)
As your main partition is larger than the SSD, will make it not possible
to use dd to make a clone.
Problem with using dd is that it also may clone the UUID. I have no idea
which kernel will be booted by grub.

My experience is is the linux kernel will boot the last UUID/LABEL found
for the same UUID/LABEL. In this case the ssd would boot but the old /dev/sdb1
will be mounted on top of the ssd partition. :(
J.O. Aho
2022-05-20 06:02:08 UTC
Permalink
Post by Bit Twister
Post by J.O. Aho
Post by Ant
Hello.
What's the best and easy way to copy/move my old slow 320 GB SATA HDD's
updated Debian bullseye v11.3 to an old fast 115 GB SSD (going to wipe
it clean)? Yes, SSD is smaller but my Debian's installation only uses
about 8 GB. I installed Debian use the whole 320 GB drive. I will still
be using the same 13 yrs. old PC.
Thank you for reading and hopefully answering soon. :)
As your main partition is larger than the SSD, will make it not possible
to use dd to make a clone.
Problem with using dd is that it also may clone the UUID. I have no idea
which kernel will be booted by grub.
You can change the UUID after cloning, but then you need to edit the
fstab if the UUID is used for mounting.

For me this tends to be a no issue, as the device that has been cloned
usually will be retired or end up in another computer.
--
//Aho
Anton Ertl
2022-05-19 20:03:11 UTC
Permalink
Post by Ant
Hello.
What's the best and easy way to copy/move my old slow 320 GB SATA HDD's
updated Debian bullseye v11.3 to an old fast 115 GB SSD (going to wipe
it clean)? Yes, SSD is smaller but my Debian's installation only uses
about 8 GB. I installed Debian use the whole 320 GB drive. I will still
be using the same 13 yrs. old PC.
Create partitions on the SSD as desired, mkfs them, and then copy the
contents of the directory with e.g., rsync, tar or cpio.

Then (the hard part) install the boot loader on your SSD so that it
boots Linux. No tips for that from me, it tends to be a fight
involving chroot etc. and several attempts in recent years. It used
to be easier in the good old LILO days.

Followups set to alt.os.linux.debian.

- anton
--
M. Anton Ertl Some things have to be seen to be believed
***@mips.complang.tuwien.ac.at Most things have to be believed to be seen
http://www.complang.tuwien.ac.at/anton/home.html
J.O. Aho
2022-05-20 06:10:38 UTC
Permalink
Post by Anton Ertl
Post by Ant
Hello.
What's the best and easy way to copy/move my old slow 320 GB SATA HDD's
updated Debian bullseye v11.3 to an old fast 115 GB SSD (going to wipe
it clean)? Yes, SSD is smaller but my Debian's installation only uses
about 8 GB. I installed Debian use the whole 320 GB drive. I will still
be using the same 13 yrs. old PC.
Create partitions on the SSD as desired, mkfs them, and then copy the
contents of the directory with e.g., rsync, tar or cpio.
Then (the hard part) install the boot loader on your SSD so that it
boots Linux. No tips for that from me, it tends to be a fight
involving chroot etc. and several attempts in recent years. It used
to be easier in the good old LILO days.
I would recommend the Getnoo documentation on the chroot, this for it
includes /proc and /sys which seems to be required with Grub2 nowadays.

https://wiki.gentoo.org/wiki/Chroot

Of course you have to install the grub on the right disk, so that you
don't update the one on the old disk.
Post by Anton Ertl
Followups set to alt.os.linux.debian.
That is quite rude, then I won't be able to follow the thread at all, so
reverted your followup.
--
//Aho
Paul
2022-05-20 06:03:03 UTC
Permalink
Post by Ant
Hello.
What's the best and easy way to copy/move my old slow 320 GB SATA HDD's
updated Debian bullseye v11.3 to an old fast 115 GB SSD (going to wipe
it clean)? Yes, SSD is smaller but my Debian's installation only uses
about 8 GB. I installed Debian use the whole 320 GB drive. I will still
be using the same 13 yrs. old PC.
Thank you for reading and hopefully answering soon. :)
The presumption would be, that the real amount of data, fits on a
120GB SSD.

It sounds like it does.

You can use GParted, to shrink and move partitions on the 320GB drive.

Since this is risky, a backup of the drive should be made first.

You want the overall layout, to be a slight bit smaller than 115GB.
You can make it smaller than that if you like.

Once it's smaller than that, you can clone it with Macrium.
A Macrium Rescue CD can do the final step (clones EXT and swap).

*******

If you accepted some "defaults" during installation, you may
be the recipient of an Extended with a Logical partition for
slash in it.

To shrink that, you shrink the Logical first. That would be /dev/sda5 .

The envelope it lives in, is /dev/sda2, and you shrink the envelope
last. Once the envelope is small enough, it should no longer
extend past 115GB. And then you're ready for a clone.

The Macrium Rescue CD should handle

MBR
Primary and secondary GPT partition tables (if present)
Boot track
Partitions

I simulated the whole thing here, using the Mint on my laptop
as a source of an image. I put it in a VM and simulated the
whole thing. And the resultant "small disk" booted just fine.
I did not do any BLKID checks, but the BLKIDs must be the
same, since Macrium does not edit anyones /etc/fstab for them :-)
This means you don't run the 320GB and the 120GB drives
at the same time, after the clone is done. You would need to
change BLKIDs and /etc/fstab, as a separate venture, if you
want to do a thorough job.

The objective of doing it this way, is I did not want to
know anything about the files in the partitions. I just
wanted a recipe that would work at the partition level.

Paul
Loading...