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 add a hard disk and modify a mount point in Ubuntu

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Editor to share with you how to add a hard disk and modify the mount point of Ubuntu. I hope you will get something after reading this article. Let's discuss it together.

1. Use fdisk-l to see the name of the added hard disk, where / dev/sdc1 is the representative, and sdc1 is the newly added hard disk.

2. Partition the disk with fdisk

3. Use mkfs.ext4 to format the disk into the ext4 file system. If you are using ssh to connect to the server, it is recommended to do this in screen. My 50g disk format took more than 40 minutes, so you don't have to worry about ssh disconnecting in screen.

4. Create a sdc1 under / media and mount the disk to sdc1.

5. I want to migrate all the projects under / usr to the new disk and copy all the items over.

Cp-ax / usr/* / media/sdc1

Time depends on the amount of data you have

6. Look at the UUID,ls-l / dev/disk/by-uuid of the disk and write down the uuid of the newly added disk.

7. Modify fstab, echo 'UUID= your UUID / usr ext4 defaults 0' > > / etc/fstab

8,mv / usr / usr.old

9 、 mkdir / usr

Just restart it.

All operations are under root permission, and / usr.old can be deleted after restart.

Finally, df-Th confirms the result.

After reading this article, I believe you have a certain understanding of "how to add hard drives and modify mount points in Ubuntu". If you want to know more about it, please follow the industry information channel. Thank you for your reading!

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