linux挂载u盘及卸载

对于最小化安装的linux来说,其并没有向windows一样的方便的gui界面,所以需要用命令实现u盘的挂载与卸载

1.创建挂载点:

通常情况,挂载点的位置在/mnt目录下

[root@master mnt]# mkdir u

2.查询设备名:

[root@master mnt]# fdisk -l

Disk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 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
Disk label type: dos
Disk identifier: 0x000b0bb2

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      616447      307200   83  Linux
/dev/sda2          616448    41943039    20663296   8e  Linux LVM

Disk /dev/mapper/centos-swap: 549 MB, 549453824 bytes, 1073152 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


Disk /dev/mapper/centos-root: 20.6 GB, 20606615552 bytes, 40247296 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


Disk /dev/sdb: 130.0 GB, 130023424000 bytes, 253952000 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
Disk label type: dos
Disk identifier: 0x210f72f0

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048   253886463   126942208    7  HPFS/NTFS/exFAT
/dev/sdb2       253886464   253951999       32768   ef  EFI (FAT-12/16/32)

linux会自动为u盘这种即插即用设备自动分配用户名,所以执行fdisk -l命令后多出来的新设备就是u盘设备

3.挂载文件系统mount 参数 设备名 挂载点:

参数
-t fstype	指定挂载文件系统类型,-t auto可以实现自动挂载
-r	只读模式挂载
-w	默认选项,读写模式挂载
-o	设置挂载属性
-a	挂载/etc/fstab文件中记录的设备
[root@master mnt]# mount /dev/sdb1 /mnt/u

4.卸载文件系统umount 设备名/挂载点:

[root@master mnt]# umount /dev/sdb1 	#指定设备名卸载
[root@master mnt]# umount /mnt/u 	#指定挂载点卸载
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值