Featured image of post Mount a new hard drive at the /home path and transfer existing data to it.

Mount a new hard drive at the /home path and transfer existing data to it.

πŸ“Œ Introduction

The following steps allow you to mount a new hard drive to the /home path and successfully move the old data to the new storage space.

ι€ιŽδ»₯δΈ‹ηš„ζ­₯ι©Ÿε°‡ε―δ»₯ε°‡ζ–°ηš„η‘¬η’ŸζŽ›θΌ‰εˆ° /home θ·―εΎ‘δΈŠοΌŒδΈ¦ι †εˆ©ε°‡θˆŠηš„θ³‡ζ–™η§»ε‹•εˆ°ζ–°ηš„ε„²ε­˜η©Ίι–“θ£‘ι’γ€‚

πŸ“ Steps

1. unmount /dev/sdb

sudo mkfs.ext4 /dev/sdb

2. mount to new path

sudo mkdir /mnt/newstorage
sudo mount /dev/sdb /mnt/newstorage

3. copy old data (sda) to sdb

sudo rsync -av /home/ /mnt/newstorage/

4. get sdb UUID

sudo blkid

5. update fstab file

append this string to /etc/fstab

UUID=<Your-sdb-UUID> /home ext4 defaults 0 2

6. reboot

sudo reboot

Β 

Licensed under CC BY-NC-SA 4.0
Last updated on Apr 19, 2024 15:12 CST