您的位置:首页 > 运维架构 > Linux

Linux 格式化U盘为ext4格式以及修复分区表方法

2015-11-25 18:43 771 查看
1.首先执行sudo fdisk -l查看你的u盘的序号,通常是/dev/sdb之类的,U盘分区通常是/dev/sdb1

2.针对将要格式化的分区执行sudo
umount /dev/sdb1 # 必须先卸载该分区

3.sudo mkfs.ext4 /dev/sdb1 #
格式化为ext4分区

4.查看u盘序号时提示错误:

This doesn't look like a partition
table

Probably you selected the wrong device.

......

Partition table entries are
not in disk order

解决方案:

1.fdisk /dev/sdb ( 此处改为 u 盘的 Device Boot )

2.出现Command (m for help): p //显示U盘 目前状态

Command (m for help): d

Partition number (1-4): 4

Command (m for help): d

Partition number (1-4): 3

Command (m for help): d

Partition number (1-4): 2

Command (m for help): d

Command (m for help): p

Command (m for help): n

Command action

p primary partition (1-4) :p

Partition number (1-4): 1

Command (m for help): p

Command (m for help): x

Expert command (m for help): m

Command action

b move beginning of data in a partition

c change number of cylinders

d print the raw data in the partition table

e list extended partitions

f fix partition order

g create an IRIX (SGI) partition table

h change number of heads

m print this menu

p print the partition table

q quit without saving changes

r return to main menu

s change number of sectors/track

v verify the partition table

w write table to disk and exit

Expert command (m for help): f

Done.

Expert command (m for help): r

Command (m for help): p

Command (m for help): w // 保存你所做的工作并且退出。

以上就是对U盘进行重新分区,把 4 part 合为一个。

这时的U盘还没有格式化,执行上述格式化流程.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: