Ubuntu mount the hard disk Commands

Disclaimer: This article is a blogger original article, welcome to reprint and adoption. https://blog.csdn.net/HinstenyHisoka/article/details/71055656

Ubuntu new upgraded from 16 to 17 the results for flying, and then reloading the 17, the following is to mount a mechanical hard drive mounted outside the system to the operating system command is a directory used brief introduction;


First look at the system that can be hard to find information about the current

fdisk -lu

// 操作系统安装到这里的
/dev/sda1  *     2048 250068991 250066944 119.2G 8e Linux LVM // 另一块想要挂载的硬盘 /dev/sdb1 2048 976773167 976771120 465.8G 83 Linux 

 

Create an empty directory in the root directory, ready to mount above 500G hard to create this directory up

cd /

mkdir disk

 

Temporary mount about the hard drive, although you can access the directory by specifying a mounted volume mount restart the computer but the effect disappeared

// 注意参数'ext4'可以通过下面的命令'blkid' 查看
mount -vl -t ext4 /dev/sdb1 /disk
cd /disk
ll 

 

By the modified file '/ etc / fstab' to achieve the lasting effect of the mount, where the only hard disk object to ask for a specified mount by UUID hard, because when through the directory, then mounts the effect will be lost after the hard disk to access the directory changes

// 这里先通过'blkid'命令查看下硬盘本身信息
blkid
/dev/sda1: UUID="FL0BcO-2KYg-Vwgp-OuYT-2Sbf-cX36-fpOk2h" TYPE="LVM2_member" PARTUUID="7b381923-01" /dev/sdb1: UUID="c0e5ce7f-6f6d-450a-833e-59273c0ef5e8" TYPE="ext4" PARTUUID="497749a8-01" cd /etc cp fstab fstab_back vi fstab // 这里发现系统其他的硬盘分区的挂载方式也是用的目录形式,那先不管,只管追加我们的一行 UUID=c0e5ce7f-6f6d-450a-833e-59273c0ef5e8 /disk ext4 defaults 0 0 // 保存修改后重启电脑试试 reboot

Finally, Mount View results

cd /disk
ll
......

Guess you like

Origin www.cnblogs.com/sddai/p/11097028.html