Ubuntu Disk Planning: Migrate /home to the second block SSD
1. Background and goals
My ThinkPad T570 has two SSDs:
- SDA (238G): The F drive of the original Windows 10 has Ubuntu installed.
- SDB (953G): The original Windows 10 data disk (C/D/E) is all NTFS partitions.
Target: Clear the second large-capacity SSD, format it as Linux Ext4 file system and mount as /home partition. In this way, all personal files (desktop, download, document, configuration, etc.) will be stored on a large-capacity disk in the future, and the system disk will never be full.
2. View the current disk layout (command line)
open the terminal (Ctrl+Alt+T), enter the following commands to view the disks and partitions:
lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINT
The output example is as follows:
sda 238.5G disk
├─sda1 1G part vfat /boot/efi
└─sda2 237.4G part ext4 /
sdb 953.9G disk
├─sdb1 260M part vfat
├─sdb2 16M part
├─sdb3 300.1G part ntfs
├─sdb4 290G part ntfs
├─sdb5 10G part vfat
├─sdb6 352.5G part ntfs
└─sdb7 1000M part ntfs
can see:
sdais the system disk, already installed ubuntu (/ / *And/boot/efi).sdbIt is a data disk, and there are still 7 windows partitions (NTFS, EFI, recovery partitions, etc.) remaining on it.
What we will do next isEmpty sdb whole plate, create another Ext4 partition as /home.
3. Optional: Backup files that need to be kept on SDB
If you are sdb There are still old photos, documents, etc. that need to be retained, please copy to your home directory first:
mkdir ~/old_backup_from_sdb
Then use the graphical file manager to open /run/media/your username/, find the required files, copy to ~/old_backup_from_sdb.
If
sdbThere is no file required on it, and the backup can be skipped.
4. Use the GParted partition tool (graphics)
GParted is a graphical partition editing software, which is more intuitive than the command line and is very suitable for beginners.
4.1 Installing GParted
sudo apt update
sudo apt install gparted -y
4.2 Start gParted
sudo gparted
After entering your password, the GParted main window will open. The first thing you see is the system disk /dev/sda status, such as Figure 1 shown.

4.3 Switch to the second hard disk /dev/sdb
In the drop-down menu in the upper right corner of the GParted window, select /dev/sdb(The capacity is about 953.87 GIB). At this point you will see /dev/sdb All the original Windows partitions, such as Figure 2 shown.

4.4 Delete all old partitions
Do the following for each partition in sequence:
- Right-click the partition → select Unload(if the partition is already mounted).
- After uninstalling, right-click again → select Delete.
After you have executed ‘Uninstall → Delete’ on multiple partitions, gparted will list all the operations to be performed, such as Figure 3 shown.

After right-clicking, you may find that some partitions cannot be deleted and need to be uninstalled first, such as Figure 4 shown.

⚠️ Frequently Asked Questions: When deleting, it prompts ‘Uninstallable, the target is busy’
When uninstalling some partitions (such as /dev/sdb6) may pop up Figure 5 Error shown: ‘Unable to uninstall, the target is busy’.

This is because the program is using that partition (usually the file manager has opened it). Please check the taskbar or file manager window to find and close the corresponding volume, such as Figure 6 A window called ‘379 GB volume’ is displayed, just close it.

If it still doesn’t work, you can force uninstall in the terminal:
sudo umount /dev/sdb6
Then go back to GParted to continue uninstalling and deleting.
Repeat the above steps until /dev/sdb All partitions are deleted. The final entire disk will be displayed as ‘Unassigned’, such as Figure 7 shown.

4.5 Create a new ext4 partition
Right-click the ‘Unassigned’ area → New, will pop up 8 the dialog shown.

Fill in the following parameters:
| Options | Value |
|---|---|
| previous available space | 1 MIB (default, unchangeable) |
| new size | Keep the maximum value (e.g. 976761 MIB) |
| free space after | 0 mib |
| Align to | mib |
| file system | Ext4 |
| rollaway | home(Custom can be customized, it is recommended to use English) |
| partition name | Leave a blank |
Click on Add to → Then click the green checkmark on the toolbar Application. At this point gParted will ask again whether to confirm, such as Figure 9 shown.

Click on Application, wait a few seconds, the new partition is created.
4.6 Record the UUID of the new partition
Right click on the new /dev/sdb1 → Information, will pop up Figure 10 window shown.

copy it UUID, for example:
d24cf7c9-f6a9-49dd-bf37-62ed9bb0ffb0
Important: Please save this UUID to a temporary text file (for example, use
vi uuid.txtrecord), which will be used in the next steps.
5. Migration /home to new partition
5.1 Mount the new partition to the temporary directory
sudo mkdir -p /mnt/newhome
sudo mount /dev/sdb1 /mnt/newhome
5.2 Copy the current /home all data
sudo rsync -avxP /home/ /mnt/newhome/
-a: Archive mode (retention permissions, timestamps, etc.)-v: show details-x: do not cross file system boundaries-p: Display progress and support breakpoint resumable upload
Copy time depends on /home The amount of data in it, usually a few minutes to ten minutes.
5.3 Replacement /home for new partition
sudo mv /home /home.old # 把旧的 /home 改名为备份
sudo mkdir /home # 创建新的空 /home 目录
sudo mount /dev/sdb1 /home # 临时挂载新分区到 /home
5.4 Set up automatic mount at boot
Edit /etc/fstab file:
sudo vi /etc/fstab
if you are not familiar with
Vi, can usenano:sudo nano /etc/fstab.
Move the cursor to the end of the file, press o(Create a new line and enter insert mode), enter the following content (please set uuid=... Replace with the UUID you recorded yourself):
UUID=d24cf7c9-f6a9-49dd-bf37-62ed9bb0ffb0 /home ext4 defaults 0 2
Save and exit:
Vi: pressESC, enter:wqCarriernano: pressCtrl+OEnter to save, pressctrl+xQuit
5.5 Test Mount Configuration
sudo mount -a
df -h /home
If the output shows /dev/sdb1 And the capacity is about 938G (or close to 953G), indicating that the configuration is correct.
6. Restart and clean up
6.1 Restart the computer
sudo reboot
If it prompts ‘Operation Inhibited’ when restarting, you can use forced restart:
sudo systemctl reboot -i
6.2 Verify the mount
After restarting and logging in, run again:
df -h /home
should still show /dev/sdb1.
6.3 Delete old /home.old Backup (release the system disk space)
sudo rm -rf /home.old
please confirm new
/homeDelete is performed after it works normally (the desktop, documents, etc. are all there).
7. The final effect
- system disk
/dev/sda2(root directory/ / *): only stores the system and software, and occupies very small (e.g. 14G) - data disk
/dev/sdb1(mount point/home): Stores all user files, with a capacity of nearly 1TB - The disk layout is simple, without any garbage partitions
Eight, Xiaobai’s common problems and solutions
8.1 How to use the paste command to the terminal?
- Shortcut keys:
Ctrl + Shift + V(notCTRL+V) - middle mouse button: After selecting the text, press the scroll wheel to paste
8.2 sudo gedit /etc/fstab Prompt not found command?
The new version of ubuntu is no longer pre-installed gedit, please use Vi Or nano, as described above.
8.3 When deleting partitions, it keeps prompting ‘target busy’?
- Close all file manager windows (Nautilus)
- Execute at the terminal
sudo umount /dev/sdbx(x is the partition number) - If it still doesn’t work, restart the computer and then execute it
sudo gparted
8.4 sudo mount -a Report an error?
- Inspection of
/etc/fstabWhether the uuid in it is written in pairs (note the letter case, the short horizontal line) - Use
sudo blkid /dev/sdb1Confirm the correct UUID, then re-edit fstab
9. Follow-up optimization (optional, I did not perform the following operations)
- Turn on SSD automatic TRIM(Improve life):
sudo systemctl enable fstrim.timer --now
- Check if swap is normal:
swapon --show
free -h
- Organize the home directory: will be backed up in
~/old_backup_from_sdbfile in~/documentation,~/developAfter waiting for the directory, delete the backup folder.
10. Summary
Through the above steps, you have successfully planned the second SSD as an independent /home partition. The whole process does not require external hard disk backup (the old /home reserved /home.old), even if the operation error is wrong, it can be reversed. Now you can rest assured to /home Store movies, games, code and other items in it, and you don’t have to worry about the root partition full.