Questions on replacing my laptop's 1TB hard drive with a 2 TB one

Fedora Version info

[sysadmin@localhost:/home/sysadmin]$ uname -a
Linux localhost.localdomain 6.4.15-200.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Sep  7 00:25:01 UTC 2023 x86_64 GNU/Linux

[sysadmin@localhost:/home/sysadmin]$ cat /etc/fedora-release
Fedora release 38 (Thirty Eight)
[sysadmin@localhost:/home/sysadmin]$

My HP Omen laptop has the following specs:

256GB NVME SSD drive (But only 238 GB available)
1TB Mechanical SATA drive (2.5 inch internal HDD)

Its a dual boot configuration. The laptop originally came with Windows 10 Home OEM installed and later I installed Fedora and currently I have Fedora 38 as the dual boot.

I purchased a Sandisk 2TB SSD (2.5 inch) and I want to upgrade my current 1 TB mechanical drive to the Sandisk’s 2TB one.
After physically replacing my current 1 TB mechanical drive with Sandisk’s 2TB, I will copy the all the data from the 1 TB disk to the newly attached 2 TB disk. I bought a SATA to USB enclosure (SABRENT) for this copy.

I have few questions on this upgrade.

I use Logical Volume Mananagement for my Fedora.

For faster performance, Windows OS came installed in the NVME drive. I installed Fedora OS in the same NVME drive too.

Fedora assigned the name /dev/sda for the 1 TB SATA mechanical disk.

For my personal data, I created a VG named fedora_homevg out of my mechanical SATA partition (/dev/sda3) as shown below.

And /dev/mapper/fedora_homevg-home is mounted on mount point /home .

/home/sysadmin/Ddrive is where I keep all my important data (Movies, Pictures, music files, documents, …etc)

Question1. Should the new 2 TB disk be partitioned by Windows first ?

When I detach the current 1TB disk and attach the 2 TB disk, should I boot into Windows 10 first and create the NTFS partitions first ? Or it does not matter ?

Question2. When I detach the current 1TB disk and attach the 2 TB disk, won’t fedora complain about the missing the VG fedora_homevg which was made using PV /dev/sda3 from the old 1 TB disk ?

Any other important things I should be mindful about ? All recommendations on best practices are appreciated.

Disk info from Fedora and Windows shown below

----- In Fedora

[sysadmin@localhost:/home/sysadmin]$ df -PTh
Filesystem                     Type      Size  Used Avail Use% Mounted on
devtmpfs                       devtmpfs  4.0M     0  4.0M   0% /dev
tmpfs                          tmpfs      16G   19M   16G   1% /dev/shm
tmpfs                          tmpfs     6.3G  2.2M  6.3G   1% /run
/dev/mapper/fedora_rootvg-root ext4      100G   39G   57G  41% /
/dev/nvme0n1p6                 ext4      974M  281M  626M  31% /boot
/dev/nvme0n1p5                 vfat      511M   18M  494M   4% /boot/efi
/dev/mapper/fedora_homevg-tmp  ext4      7.8G   69M  7.3G   1% /tmp
/dev/mapper/fedora_homevg-home ext4      649G  553G   63G  90% /home
tmpfs                          tmpfs     3.2G  196K  3.2G   1% /run/user/1000
[sysadmin@localhost:/home/sysadmin]$ 
[sysadmin@localhost:/home/sysadmin]$ 
[sysadmin@localhost:/home/sysadmin]$ 
[sysadmin@localhost:/home/sysadmin]$ sudo pvs
  PV             VG            Fmt  Attr PSize   PFree
  /dev/nvme0n1p7 fedora_rootvg lvm2 a--  102.00g 4.00m
  /dev/sda3      fedora_homevg lvm2 a--  668.00g 4.00m
[sysadmin@localhost:/home/sysadmin]$ 
[sysadmin@localhost:/home/sysadmin]$ 
[sysadmin@localhost:/home/sysadmin]$ sudo lvs
  LV   VG            Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  home fedora_homevg -wi-ao---- 660.00g                                                    
  tmp  fedora_homevg -wi-ao----   8.00g                                                    
  root fedora_rootvg -wi-ao---- 102.00g                                                    
[sysadmin@localhost:/home/sysadmin]$ 

[sysadmin@localhost:/home/sysadmin]$ lsblk
NAME                   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda                      8:0    0 931.5G  0 disk 
├─sda1                   8:1    0 248.8G  0 part 
├─sda2                   8:2    0  12.7G  0 part 
└─sda3                   8:3    0   668G  0 part 
  ├─fedora_homevg-home 253:1    0   660G  0 lvm  /home
  └─fedora_homevg-tmp  253:2    0     8G  0 lvm  /tmp
zram0                  252:0    0     8G  0 disk [SWAP]
nvme0n1                259:0    0 238.5G  0 disk 
├─nvme0n1p1            259:1    0   260M  0 part 
├─nvme0n1p2            259:2    0    16M  0 part 
├─nvme0n1p3            259:3    0 132.2G  0 part 
├─nvme0n1p4            259:4    0   980M  0 part 
├─nvme0n1p5            259:5    0   512M  0 part /boot/efi
├─nvme0n1p6            259:6    0     1G  0 part /boot
└─nvme0n1p7            259:7    0   102G  0 part 
  └─fedora_rootvg-root 253:0    0   102G  0 lvm  /
[sysadmin@localhost:/home/sysadmin]$ 


[sysadmin@localhost:/home/sysadmin]$ lsblk -f
NAME                   FSTYPE      FSVER    LABEL            UUID                                   FSAVAIL FSUSE% MOUNTPOINTS
sda                                                                                                                
├─sda1                 ntfs                 DATA             7064634064630864                                      
├─sda2                 ntfs                 RECOVERY         827464BC7464B497                                      
└─sda3                 LVM2_member LVM2 001                  wHNz2E-c0od-5U1F-VtsV-we1F-KQZG-FVUTHD                
  ├─fedora_homevg-home ext4        1.0                       bc38b4bc-2776-4903-8b7c-8752678a8b77     62.9G    85% /home
  └─fedora_homevg-tmp  ext4        1.0                       215a3cd6-f958-464b-9349-0b8d54c6bc2e      7.3G     1% /tmp
zram0                                                                                                              [SWAP]
nvme0n1                                                                                                            
├─nvme0n1p1            vfat        FAT32                     DE2A-9102                                             
├─nvme0n1p2                                                                                                        
├─nvme0n1p3            ntfs                 Windows          267A39187A38E5E9                                      
├─nvme0n1p4            ntfs                 Windows RE tools 08AEE9C7AEE9ACFE                                      
├─nvme0n1p5            vfat        FAT32                     C3E4-C3A7                               493.6M     3% /boot/efi
├─nvme0n1p6            ext4        1.0                       203287c4-c9d1-4d72-ba6a-98acb1adc9eb    625.3M    29% /boot
└─nvme0n1p7            LVM2_member LVM2 001                  RF3oiO-mM3O-AD2Z-lXEd-PNnN-MKuu-bhbkn7                
  └─fedora_rootvg-root ext4        1.0                       4f403c4a-fc50-46dd-aa47-176fecb7acab     56.3G    39% /
[sysadmin@localhost:/home/sysadmin]$

— Windows 10 disk info.
DATA (D:) drive is made from the partitions of 1 TB SATA mechanical drive.

This seems quite possible.
The problem will be that you MUST have both drives attached when you begin because you have an LVM partition on the 1TB drive that contains the user home directories (/home).

It should suffice to swap the drives then have the external drive attached at the time you boot as far as the linux part is concerned.

You will need to use windows to create an appropriate partition on the new drive before moving the data from D: to the new drive, then copy the data from sda1 (currently D:). The name will likely change in linux when the drives are swapped, though it probably will remain D: for windows (at least for the first boot before the new partition is created). I am not sure about sda2 (windows recovery) since that is purely a windows thing.

You would then create an LVM partition on the new drive to replace the old one (but it cannot have the same LV name in the same VG) It can be a PE that is part of the same VG, though for simplicity I would also use a new VG name (maybe something like “fedora_homevg1” where you then could have LVs named “home” and “tmp” as you do now).

Once the VG is created and the LVs are created, formatted, and mounted; then copying the data over is simple with rsync. After copying the data over then editing fstab to point to the new LV for mounting /home and rebooting should be very easy.

Note that you probably should not be logged in as a user on that file system while it is being copied. Changes while the copy is in progress may cause corruption, so booting from a live media or logging in as root to do the copy would be best.

1 Like

Thanks Jeff !
So, I open my laptop and replace the 1 TB SATA disk with the new 2 TB disk and attach the old 1 TB SATA drive to SATA to USB enclosure (link below).

Then I attach the SATA to USB enclosure to the USB port of my laptop and boot the laptop.

I will do it tomorrow. Will post the update on how it went.

Just out of curiosity, why not place the new drive in the external drive connect it via usb and just dd the image from the old to the new. Then simply replace and boot.

2 Likes

Just an update on how I did the upgrade.

I used the following steps. Thanks for the advice from Jeff V and Stephen Snow.

This approach is based on the following video, but I did the cloning using dd first and then used gparted to manipulate the partitions of /dev/sdb (which will become /dev/sda after the SSD replacement). The man in the video had to shrink the partitions first using gparted bcoz of his use case

Step1. Attach the new 2 TB SSD to the Sabrent SATA to USB enclosure.

Step2. From gparted’s Live USB bootable OS, use dd command to clone the entire image of /dev/sda (1 TB mech drive) to new 2TB drive in the Sabrent enclosure.

Step3. From gparted’s GUI interface, extend /dev/sda3 (Linux ext4 partition) and /dev/sda1 (Windows NTFS)

Step4. Open the laptop and replace the 1 TB disk with the new 2 TB one.

Step5. Run pvresize on /dev/sda3 and then run lvextend on /dev/mapper/fedora_homevg-home