I received a new ssd drive for Christmas. I want to replace the hdd in my notebook with it and move everything on the hdd to the new ssd drive. The hdd has 8 partitions. Can a simple dd command copy everything??
Sudo dd if=/mnt/sda of=/mnt/sdb
Or do I have to do partition by partition? Or use gparted?
Copy a hdd to a new ssd drive
- Blaze
- DEV Team
- Posts: 3885
- Joined: 28 Dec 2010, 11:31
- Distribution: ⟰ Porteus current ☯ all DEs ☯
- Location: ☭ Russian Federation, Lipetsk region, Dankov
- Contact:
Copy a hdd to a new ssd drive
Better to make these partition manual and copy all data via SATA-USB adapter
Linux 6.6.11-porteus #1 SMP PREEMPT_DYNAMIC Sun Jan 14 12:07:37 MSK 2024 x86_64 Intel(R) Xeon(R) CPU E3-1270 v6 @ 3.80GHz GenuineIntel GNU/Linux
MS-7A12 » [AMD/ATI] Navi 23 [Radeon RX 6600] [1002:73ff] (rev c7) » Vengeance LPX 16GB DDR4 K2 3200MHz C16
MS-7A12 » [AMD/ATI] Navi 23 [Radeon RX 6600] [1002:73ff] (rev c7) » Vengeance LPX 16GB DDR4 K2 3200MHz C16
- Ed_P
- Contributor
- Posts: 8369
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Copy a hdd to a new ssd drive
I have an Orico 2.5 inch hard drive enclosure and USB cable to use to copy data from the one drive to the other.
Ed
- Ed_P
- Contributor
- Posts: 8369
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Copy a hdd to a new ssd drive
DD's bs= option. Hard drives use 512 and the common recommendations for DD are 64 MB and 128 MB. For a drive with large files the large blocksize is useful because it reduces the number or reads and/or writes. But for small files it is a waste of bytes on the drive. A 1 KB script in a 128 MB block wastes 127 MB. 2KB, 10 KB, 1 MB even 10 MB files all take 128 MB.
So, what do you guys recommend for a drive's blksize? And do all the partitions on a drive have to have the same blksize? Can the EFI partition have a 1 MB blksize and the the OS partition 64 MB?
So, what do you guys recommend for a drive's blksize? And do all the partitions on a drive have to have the same blksize? Can the EFI partition have a 1 MB blksize and the the OS partition 64 MB?
Ed
-
- Full of knowledge
- Posts: 2071
- Joined: 17 Jun 2013, 13:17
- Distribution: Porteus 3.2.2 XFCE 32bit
- Location: Germany
Copy a hdd to a new ssd drive
Hmm..it seems to me that you are confusing the dds bs= option with disk sectors.
The block size (bs) parameter specifies the amount of memory used to read a block
from one hard disk before attempting to write that block to the other.
dd copies everything, including free space.
The disadvantages become extremely apparent when you have large disks
that aren't completely filled.
You're probably better off using something like Clonezilla.
The block size (bs) parameter specifies the amount of memory used to read a block
from one hard disk before attempting to write that block to the other.
dd copies everything, including free space.
The disadvantages become extremely apparent when you have large disks
that aren't completely filled.
You're probably better off using something like Clonezilla.
- Ed_P
- Contributor
- Posts: 8369
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Copy a hdd to a new ssd drive
Thank you donald. I was indeed confusing the dd bs= option with disk sectors.
But before I went to bed I ran my dd script and when I got up this morning it was done. Sometime later today I will replace the hdd with the sdd and we will see how successful I was.
My dd script for anyone interested.
Added in 6 hours 10 minutes 16 seconds:
And it works! I'm using it now. Looking forward to it's impact on playing FoE.
But before I went to bed I ran my dd script and when I got up this morning it was done. Sometime later today I will replace the hdd with the sdd and we will see how successful I was.
My dd script for anyone interested.
Code: Select all
#!/bin/bash
#https://forum.porteus.org/viewtopic.php?t=8473
# Color definitions # ups.sh
txtbld=$(tput bold) # Bold
txtred=${txtbld}$(tput setaf 1) # Bold Red
txtgreen=${txtbld}$(tput setaf 2) # Bold Green
txtcyan=${txtbld}$(tput setaf 6) # Bold Cyan
rst=$(tput sgr0) # Reset
function redpswd() {
echo -E "$1" $txtred
}
function cyan() {
echo -E "$1" $txtcyan
}
if [ `whoami` != "root" ]; then
cyan "Enter root's password"
su -c "sh $0 $1"
exit
fi
echo $rst
echo
fdisk -l /dev/sda
echo
fdisk -l /dev/sdb
echo
#echo Copy sda to sdb?
read -p "Copy sda to sdb? " ans
if [ "$ans" != "y" ] && [ "$ans" != "Y" ]; then
exit
fi
echo
date
echo
dd if=/dev/sda of=/dev/sdb bs=4K conv=noerror,sync status=progress #conv=noerror status=progress
echo
date
read
And it works! I'm using it now. Looking forward to it's impact on playing FoE.
Ed