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

Implementation of linux how to mount Mount disk and set Boot automatic mount

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

Share

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

Knowing that everyone's time is precious, I will write down the process commands directly, and you can configure them. If you want to study the principle, read on.

Fdisk-l # View mountable disk df-h # View mounted disk mkfs.ext4 / dev/vdb # initialize disk mount / dev/vdb / U01 # mount disk to / U01, ensure that / U01 is empty blkid # get the uuid and properties of the disk, boot mountvim / etc/fstab # boot mount with uuid The template is UUID=* / U01 ext4 defaults 1 1

Because the linux system sometimes does not have enough disk storage to expand, you can choose to mount the disk, which can be understood as a U disk.

The first step is to fdisk-l to see which disks are mountable.

You can see that there are two disks above. Then df-h to see which disks have been mounted.

Only one of the small ones is mounted, so we can mount that / dev/vdb large disk.

Mount / dev/vdb / u01

Note that the U01 folder must be empty, otherwise the contents of U01 cannot be displayed before it is mounted, so it is common to create a new folder for mount. In short, make sure it is empty.

At this time, if the disk has been mounted before, it will not be mounted. Report the following error.

We need to initialize disk mkfs.ext4 / dev/vdb

Then mount can mount / dev/vdb / U01

In this way, you have to set the boot automatic mount after mount, otherwise it will be troublesome to mount again after reboot.

We use uuid to boot mount.

Use blkid to get the uuid and attributes of the disk

Vim / etc/fstab

Configuration template: UUID=* / U01 ext4 defaults 1 1

If the disk has been expanded before, and you want the expanded disk to take effect, you need to restart the server first, remove the mounted folder (umount dir_name) from umount, and execute

E2fsck-f / dev/vdb # diagnosis and treatment data disk, return disk information resize2fs / dev/vdb # reset data disk size

Then restart the above mount. Don't worry, re-mount the data will not be lost.

The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.

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