LINUX U盘挂载流程

挂载步骤
 
1. fdisk -l
 
    发现有问题:
 
    Disk /dev/sda doesn't contain a valid partition table
进行第二步操作,否则进入第三步操作
 
2. fdisk /dev/sda
 
跟着向导一步步做下去(如果不知道该输入什么,就输入“m”并回车,可以打印出菜单):
 
Command (m for help): m
 
Command action
 
   a   toggle a bootable flag
 
   b   edit bsd disklabel
 
   c   toggle the dos compatibility flag
 
   d   delete a partition
 
   l   list known partition types
 
   m   print this menu
 
   n   add a new partition
 
(后面的菜单省略,太长了)
 
这里我们要添加一个新的分区,所以输入“n”:
 
Command (m for help): n
 
Command action
 
   e   extended
 
   p   primary partition (1-4)
 
p
 
Partition number (1-4): 1
 
First cylinder (1-14098, default 1): (此处直接回车)
 
Using default value 1
 
Last cylinder or +size or +sizeM or +sizeK (1-14098, default 14098): (此处直接回车)
 
Using default value 14098
 
Command (m for help): p
 
Disk /dev/sdb: 115.9 GB, 115964116992 bytes
 
255 heads, 63 sectors/track, 14098 cylinders
 
Units = cylinders of 16065 * 512 = 8225280 bytes
 
 
 
   Device Boot      Start         End      Blocks   Id  System
 
/dev/sdb1               1       14098   113242153+  83  Linux
 
现在可以写入分区表了,所以输入“w”:
 
Command (m for help): w
 
The partition table has been altered!
 
Calling ioctl() to re-read partition table.
 
Syncing disks.
 
现在再fdisk -l,结果正常。
 
3. 创建挂载点:mkdir /mnt/usb        或者     mkdir -p /mnt/udisk   mkdir参数-p表示如文件夹已存在,则不新建,使用该文件夹
 
4. 挂载:mount /dev/sda /mnt/usb
 
5.显示硬盘挂载情况。   df -h
6 卸载 :         umount /mnt/usb
 
注意:
 
拔掉U盘前必须要先卸载 重新加载,
掉电 重启新建的USB文件夹会被删除,开机后需要重新建文件夹。
 
知识点:
 
sda是系统的第一块磁盘(sda1是第一个主分区,sda2第二个),sdb是系统的第二快磁盘(sdb1是第一个主分区,sdb2第二个)。
目前Linux内核对于这种磁盘设备的映射基本上取决于三个顺序:
一是磁盘驱动程序的加载;
二是主机PCI插槽的监测;
三是磁盘本身的监测,先来的当然是a,以此类推
 
 
 
第二步:使用fdisk命令对磁盘分区
输入m,查看帮助信息:
Command (m for help): m
Command action
a toggle a bootable flag #设置可启动标记
b edit bsd disklabel #设置一个bsd磁盘标记
c toggle the dos compatibility flag #设置dos兼容标记
d delete a partition #删除分区
g create a new empty GPT partition table #新建一个空的GPT分区表
G create an IRIX (SGI) partition table #新建一个SGI分区表
l list known partition types #列出已知分区类型
m print this menu #打印帮助信息
n add a new partition #添加一个新的分区
o create a new empty DOS partition table #新建一个空的DOS分区表
p print the partition table #打印分区表
q quit without saving changes #不保存退出
s create a new empty Sun disklabel #创建一个空的SUN磁盘标签
t change a partition ' s system id #修改分区ID
u change display/ entry units #修改显示单元(units)?
v verify the partition table #检验分区表
w write table to disk and exit #将修改保存到分区表
x extra functionality (experts only) #额外的功能(专家模式)
 
 
 
 
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值