centos8 挂载移动硬盘

 

https://blog.csdn.net/u010048823/article/details/51306175

1.使用fdisk -l命令查看磁盘情况

  

复制代码
[root@localhost ntfs-3g_ntfsprogs-2017.3.23]# fdisk -l
Disk /dev/sda: 111.8 GiB, 120034123776 bytes, 234441648 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xa2735fba

Device     Boot   Start       End   Sectors   Size Id Type
/dev/sda1  *       2048   2099199   2097152     1G 83 Linux
/dev/sda2       2099200 234440703 232341504 110.8G 8e Linux LVM


Disk /dev/sdb: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x30a09f23

Device     Boot Start        End    Sectors  Size Id Type
/dev/sdb1  *     2048 3907027119 3907025072  1.8T  7 HPFS/NTFS/exFAT
复制代码

其中/dev/sdb为相应的移动硬盘

2.创建挂载目录:

  mkdir -p /mnt/udisk

3.挂载:

  mount -t ntfs-3g /dev/sdb1 /mnt/udisk/

  如下,挂载成功

[root@localhost ntfs-3g_ntfsprogs-2017.3.23]# mount -t ntfs-3g /dev/sdb1 /mnt/udisk/
The disk contains an unclean file system (0, 0).
The file system wasn't safely closed on Windows. Fixing.

4.查看是否挂载成功:

  df -h

  可以看到挂载成功

复制代码
[root@localhost ntfs-3g_ntfsprogs-2017.3.23]# df -h
Filesystem           Size  Used Avail Use% Mounted on
devtmpfs             1.8G     0  1.8G   0% /dev
tmpfs                1.8G     0  1.8G   0% /dev/shm
tmpfs                1.8G   18M  1.8G   1% /run
tmpfs                1.8G     0  1.8G   0% /sys/fs/cgroup
/dev/mapper/cl-root   50G  5.4G   45G  11% /
/dev/mapper/cl-home   57G  448M   57G   1% /home
/dev/sda1            976M  148M  761M  17% /boot
tmpfs                364M  4.0K  364M   1% /run/user/0
/dev/sdb1            1.9T  860G 1004G  47% /mnt/udisk
复制代码

其中dev/sdb1为挂载的移动硬盘

5.使用完后,记得取消挂载,否则容易造成数据丢失:

  umount /mnt/udisk/

  

复制代码
[root@localhost ntfs-3g_ntfsprogs-2017.3.23]# umount /mnt/udisk/
[root@localhost ntfs-3g_ntfsprogs-2017.3.23]# df -h
Filesystem           Size  Used Avail Use% Mounted on
devtmpfs             1.8G     0  1.8G   0% /dev
tmpfs                1.8G     0  1.8G   0% /dev/shm
tmpfs                1.8G   18M  1.8G   1% /run
tmpfs                1.8G     0  1.8G   0% /sys/fs/cgroup
/dev/mapper/cl-root   50G  5.4G   45G  11% /
/dev/mapper/cl-home   57G  448M   57G   1% /home
/dev/sda1            976M  148M  761M  17% /boot
tmpfs                364M  4.0K  364M   1% /run/user/0
复制代码

已经取消挂载