[kwlug-disc] Need a new SSD ...
Khalid Baheyeldin
kb at 2bits.com
Sat Apr 15 17:06:27 EDT 2023
So Samsung EVO it is, and rolling the dice. The unopened WD SSD was
returned.
Since the failing disk is using CSM (BIOS compatibility mode) and the
laptop is
UEFI capable, I decided that rather than continuing with the CSM, it is
better to
go with UEFI.
That involved some hoops, but the job is now done (details later in this
message).
The copying had to be done on an older PC, so that I can attach two SATA
devices at the same time.
This time, I am grateful that S.M.A.R.T sent me emails alerting me to the
two bad sectors. Up to that point, my experience with SSDs have been
sudden and total death, multiple times ...
List of commands follows ...
# Partition the disk as follows:
- fat32 partition, about 50MB if you only have Linux
- Change the fat32 partition type to EF00
- The rest of the disk should be for your Linux system
1 2048 98303 47.0 MiB EF00 EFI system partition
5 100352 976771071 465.7 GiB 8300 Linux filesystem
# Connect the new disk and the old disk to a computer
# with two SATA devices
# Boot from Finnix, or any other rescue Linux USB/DVD
# In case we need to install packages from the repos,
# we need a working internet connection
# Check that you have an IP address
ifconfig
# ... and that we can resolve hosts
ping google.com
# Find out what the device names are for the disks
lsblk
# Check and fix any partition warnings
gdisk /dev/sda
# Copy the old disk to the new one
time pv < /dev/sdb1 > /dev/sda5
# We create a directory to mount stuff on prior to
# chroot
mkdir /mnt/r
# We mount the new disk partition to it
mount /dev/sda5 /mnt/r
# We bind the special file systems
mount --bind /dev /mnt/r/dev
mount --bind /dev/pts /mnt/r/dev/pts
mount --bind /proc /mnt/r/proc
mount --bind /sys /mnt/r/sys
mount --bind /run /mnt/r/run
mkdir /mnt/r/boot/efi
# We change root
chroot /mnt/r
# We mount the fat32 partition
mount /dev/sda1 /boot/efi
# Install grub-efi instead of grub-pc
apt install grub-efi
# Run grub-install to build the EFI partition
grub-install --target=x86_64-efi /dev/sda5
# Make sure that UEFI has been installed
ls -l /boot/efi/EFI/
# Boot the laptop
resize2fs /dev/sda5
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20230415/13a4dc3a/attachment.htm>
More information about the kwlug-disc
mailing list