• linux挂载u盘及卸载


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

    1.创建挂载点:

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

    [root@master mnt]# mkdir u
    
    • 1

    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)
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35

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

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

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

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

    [root@master mnt]# umount /dev/sdb1 	#指定设备名卸载
    [root@master mnt]# umount /mnt/u 	#指定挂载点卸载
    
    • 1
    • 2
  • 相关阅读:
    UnRaid虚拟机安装Uos家庭版并由Windows远程桌面访问的成功流程
    文生图算法评价
    在 RISC-V 设计中发现可远程利用的漏洞
    电商风控系统(flink+groovy+flume+kafka+redis+clickhouse+mysql)
    10、学习MySQL LIKE 子句
    java-net-php-python-jsp保险公司报销演示录像修改版2020计算机毕业设计程序
    SSE 服务端消息推送
    55跳跃游戏
    Ant Eclipse插件使用
    【Python机器学习】零基础掌握LinearDiscriminantAnalysis判别分析
  • 原文地址:https://blog.csdn.net/qq_44021627/article/details/133770041