Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to migrate the home directory to a new partition under ubuntu

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to migrate the home directory to the new partition under ubuntu. The article is very detailed and has a certain reference value. Interested friends must read it!

When the user's home directory is getting larger and larger, you can consider migrating the home directory to a new partition. How do you do that?

When I installed the system, I divided / home into 20g of space according to the online tutorial. After using Ubuntu for a period of time, I found that the disk where / home was located was about to be full, but there was no room to expand before and after the disk where the / home directory was located, so I had no choice but to "move". Here is the whole process of "moving":

First of all, it is necessary to have a completely blank disk as the target disk and a u-disk boot disk, and format it with the partition software of the ubuntu system, using u

The disk starts the ubuntu system.

Mount the target disk (mine is / dev/sda9) to any directory (assuming / test)

Sudo mount / dev/sda5 / test

Copy all files under the home directory to the directory mounted on the target disk (be sure to add-a here, otherwise, the owner of the copied files will become root, and the path must be set correctly, otherwise it will cause an infinite loop in the login interface when restarting, unable to enter the graphical interface. )

Sudo cp-the directory where ar home is located / * / test

Go to the original system / etc directory to modify the fstab file (here, it is important to modify the fstab file of the original system, not the fstab of the system that booted the disk)

Backup first (backup is a good habit)

Sudo cp-a fstab fstab.old

View the uuid of the destination disk:

Sudo blkid | grep / dev/sda5

Edit the fstab file, and the two orange lines in the image below are the location where the home directory is mounted, and replace the uuid in the uuid file found in the previous step.

Sudo gedit fstab

Restart and find that the home directory has changed

The above is all the contents of the article "how to migrate home directories to new partitions under ubuntu". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report