Home > Hosting > Server

What is the meaning of linux hard disk mount

2023-03-20 14:02:51

<p>The editor of this article will introduce the meaning of linux hard disk mounting in detail. The content is detailed, the steps are clear, and the details are handled properly. The idea of editing is slowly deepening, let&#39;s learn new knowledge together.</p><p><br/></p><blockquote><p>Linux hard disk mounting refers to attaching a device to an existing directory; mounting refers to making a storage device (such as hard disk, The process by which computer files and directories on a CD-ROM or shared resource are made accessible to users through the computer&#39;s file system.</p></blockquote><p><strong>Linux disk mount</strong></p><p>1. Mounting concept</p><p>Mounting (mounting) refers to the System The process of making computer files and directories on a storage device (such as a hard disk, CD-ROM, or shared resource) available to users through the computer&#39;s file system.</p><p>In the windows operating system: Mounting usually refers to assigning a drive letter to a disk partition (including a virtual disk partition).</p><p>In the Linux operating system: it refers to attaching a device (usually a storage device) to an existing directory.</p><p>2. View disk status (mounted information)</p><p><code>df -h<br/></code></p><p><br/></p><p>3. View the current disk partition status</p><p>If there is no output, this means that the user authority is not enough, you need to use root</p><p><code>fdisk -l<br/></code></p><p><img src="//img.freeonlinedomain.com/uploads/allimg/20230320/1-2303201414204Z.jpg" title="" alt="1.jpg"/></p><p>You can clearly see that there is still a lot of space in /dev/vdb that is not used</p><p>4. Partition</p><p><code>fdisk /dev/vdb<br/></code></p><p><img src="//img.freeonlinedomain.com/uploads/allimg/20230320/1-23032014151T07.jpg" title="" alt="2.jpg"/></p><p>View partition status</p><p><code>lsblk<br/><br/></code></p><p>5. Format</p><p><code>mkfs.xfs /dev/vdb1mkfs -t ext4 /dev/vdb1<br/><br/></code></p><p>7. Mount<br/></p><p>Mount the device /dev/vdb1 to /data Directory</p><p><code>mkdir /datamount /dev/vdb1 /data<br/></code></p><p>8. Check the situation after mounting</p><p><code>df-hfdisk -llsblk -f<br/></code></p><p><br/></p><p>9. Realize automatic mounting</p><p>Realize automatic mounting by modifying /etc/fstab After the addition is complete, execute mount -a to take effect</p><p><code>vim /etc/fstab# Add a line /dev/vdb1 /data &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ext4 defaults &nbsp; 0 0<br/></code></p><p>10. Restart verification</p><p>After mounting, be sure to restart and verify. If your mount does not disappear, you can proceed to the next installation, otherwise Everything you installed will be formatted</p><p>If you find that the mount disappears after restarting, check whether the configuration in vim /etc/fstab is consistent with the mount.</p><p><br/></p><p><br/></p>


Copyright Description:No reproduction without permission。

Knowledge sharing community for developers。

Let more developers benefit from it。

Help developers share knowledge through the Internet。

Follow us