In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the knowledge of "how to change the default mount hard disk by LINUX". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
How to change the default data disk directory on a brand new CVM or server? I have the obsessive-compulsive disorder of operating computer, and sometimes I need to change the default in order to work.
Data disk directory, let's take a look at how to operate it.
I am used to first to a DF-H to see which is the current data disk directory. Ha ha
We should check the partition of the hard drive first. Take a look at the path of the data disk, for example: / dev/mapper/Xvdbgroup-xvdb1
View partition information fdisk-l
This command can clearly see that the data disk / dev/mapper/Xvdbgroup-xvdb1 has 96.5GB, so which directory do we need to mount it to? Let's go on next.
1. Disk space usage of the file system: df-h
This command can also see which directory / dev/mapper/Xvdbgroup-xvdb1 is now mounted as shown in the above figure, so what if we want to mount it to the HOME directory?
What are you doing? So first of all, we have to make sure that the home directory exists. If it exists, we don't have to move it. If it doesn't exist, we have to create a HOME directory.
two。 Create the HOME directory mkdir / home
To mount to home, unmount the existing www directory mount first
3. Uninstall the mounted home directory umount / www on the hard disk
So the www directory is uninstalled, and you can run the df-h command to see if the www directory still exists.
Next we're going to mount the home directory.
4. Mount to the home directory mount / dev/mapper/Xvdbgroup-xvdb1 / home
Running this command will mount / dev/mapper/Xvdbgroup-xvdb1 to the home directory and run df-h to see if it already exists.
At this point, the home directory is your data disk, but we need to mount it automatically, otherwise the home directory will not be mounted automatically after the machine is rebooted, so move on.
5. Edit the fstab file to modify or add so that it can be mounted automatically after restart
Vi / etc/fstab
Modify this file add or modify this line in this file and change www to your existing mount directory.
/ dev/mapper/Xvdbgroup-xvdb1 / www ext4 auto 0 0
After this step, save and exit, restart your machine reboot, try to restart the machine and then run df-h to see if it is the mount directory you want.
This is the end of the content of "how to change the default mount hard drive by LINUX". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.