A few days ago, a colleague would install an Oracle database on the CentOS. Need to add a disk to the existing system, this is not very rare problem results are not written to the Fstab file, reboot the disk and then reload, this record the solution.
1. First edit virtual machine-add
2. Select the type of device you want to add-hard drive
3. Create a new disk (my requirement is a new disk)
4. Select the size of the disk according to your requirements (this is the experimental environment 5GB is enough)
5. Select the Virtual device node (I am the default, you can look at the first picture of the hard drive 1 is scsi (0:0) new Hard drive 2 is scsi (0:1) No problem, the independent option of the persistent non-persistent is for the snapshot, the settings will be very clear, not to say more.
6. Here to see if the choice is in line with your needs , does not conform to the last step can be changed.
7 Start Virtual machine console , or remote SSH connection to your virtual machine
8. Use
Fdisk-l
See if you have added the disk
9. Use
Fdisk/dev/sdb
Partition to Disk
M: Show All Commands
P: Display partition status
N: Set a new partition
E: Yes (extend) extended partition
P: that is (primary) main partition, we choose P here
1-4: Is the partition number, 1 to 4 can be
First/last cylinder: Start/end cylinder (I only need a zone to enter directly, if divided into multiple areas to be counted well)
W: Saving
10. Use
Fdisk-l
Check your new score (the last one/dev/sdb1)
11. Specify the file operating system for your partition (duration will be formatted longer)
12. Use
mount/dev/sdb1/test/
Mount to the directory you need
13. See the Fstab file and the sdb1 uuid under etc
Blkid/etc/sdb1
14. Open Fstab file to sdb1 the file format written in the previous line, do not move other things otherwise easy to open the machine.
15. Since then, the Mount disk has been completed. reboot can be restarted. Use
Df-h
Check it out.
The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.