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 mount data disk under Linux system

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly introduces "how to mount the data disk under the Linux system". In the daily operation, I believe that many people have doubts about how to mount the data disk under the Linux system. The editor consulted all kinds of materials and sorted out a simple and easy-to-use method of operation. I hope it will be helpful to answer the doubt of "how to mount the data disk under the Linux system". Next, please follow the editor to study!

After logging in to a series of Linux servers such as CentOS or Debian and Ubuntu by remote SSH, do the following

Reminder: the mount operation will empty the data, please make sure that the mount disk has no data or is not in use.

1. Step: list all disk commands:

Ll / dev/disk/by-path

two。 Tip: if you cannot confirm the name of the data disk device, use the df command to confirm the name of the system disk to rule out the wrong disk.

Step 2: format the hard disk command:

Fdisk / dev/sdb

Note: continue to type manually at the arrow mark in the figure

Step 3: create partition command:

Mkfs.ext4 / dev/sdb1

Step 4: Mount the partition

Command:

Mkdir / data

Command:

Mount / dev/sdb1 / data

Mount the hard drive sdb as / data

Step 5: write the information to fstab and let the system turn on automatic mount.

Command:

Echo "/ dev/sdb1 / data ext4 defaults 0" > > / etc/fstab

* * can be entered

Command:

Df-h

Check to see if the hard drive is mounted.

In addition to the above methods.

You can also use the pagoda to automatically mount the data disk:

Centos/Fedora:

Yum install wget-y & & wget-O auto_disk.sh http://download.bt.cn/tools/auto_disk.sh & & bash auto_disk.sh

Ubuntu:

Wget-O auto_disk.sh http://download.bt.cn/tools/auto_disk.sh & & sudo bash auto_disk.sh

Debian:

Wget-O auto_disk.sh http://download.bt.cn/tools/auto_disk.sh & & bash auto_disk.sh so far, the study on "how to mount a data disk under the Linux system" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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