Ubuntu下格式化并分区u盘
2012-12-28 15:33
399 查看
1.命令行
[plain] view
plaincopy
sudo fdisk -l
查看你的设备的符号,显示结果通常如下:
[plain] view
plaincopy
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000c4c5b
Device Boot Start End Blocks Id System
/dev/sda1 * 1 60065 482466816 83 Linux
/dev/sda2 60065 60802 5917697 5 Extended
/dev/sda5 60065 60802 5917696 82 Linux swap / Solaris
Disk /dev/sdb: 1954 MB, 1954545664 bytes
255 heads, 63 sectors/track, 237 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00069760
找到你的设备的盘符,我的是 /dev/sdb
[html] view
plaincopy
sudo umount /dev/sdb
[html] view
plaincopy
sudo fdisk /dev/sdb
在终端显示内容如下:
[html] view
plaincopy
Command (m for help):
输入m得到帮助信息:
[html] view
plaincopy
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
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
开始分区
如果你的设备已经有分区,先删除你的分区:
[html] view
plaincopy
Command (m for help): d 删除命令
Partition number (1-4): 1 删除地几个分区
[html] view
plaincopy
如果有多个分区,接着执行命令d,输入分区号
创建新分区:
[html] view
plaincopy
Command (m for help): n 创建分区命令
Command action
e extended
p primary partition (1-4)
p 选择分区的类型 e:扩展分区 p:主分区
Partition number (1-4): 1 分区号 1:第一个分区
First cylinder (1-237, default 1): 1
Last cylinder, +cylinders or +size{K,M,G} (1-237, default 237): +512M 分区的大小
创建第二个分区:同上
[html] view
plaincopy
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (67-237, default 67):
Using default value 67
Last cylinder, +cylinders or +size{K,M,G} (67-237, default 237): +512M
把第一个分区做为FAT32d 分区:
[html] view
plaincopy
Command (m for help): t 改变分区的id
Partition number (1-4): 1 改变第一个分区
Hex code (type L to list codes): c 变为dos兼容的格式
Changed system type of partition 1 to c (W95 FAT32 (LBA))
查看分区情况:
[html] view
plaincopy
Command (m for help): p
Disk /dev/sdb: 1954 MB, 1954545664 bytes
255 heads, 63 sectors/track, 237 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00069760
Device Boot Start End Blocks Id System
/dev/sdb1 1 66 530113+ c W95 FAT32 (LBA)
/dev/sdb2 67 132 530145 83 Linux
保存写入上面的内容:
[html] view
plaincopy
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.
格式化分区:
sudo mkfs.vfat -F 32 -n boot /dev/sdb1 //boot是为分区起的名字,就是在硬盘上显示的名字 格式化位fat32格式 第一个分区
sudo mkfs.ext3 -L linux_fs /dev/sdb2 // linux_fs 是第二个分区的名字,格式化位 ext3格式
[plain] view
plaincopy
sudo fdisk -l
查看你的设备的符号,显示结果通常如下:
[plain] view
plaincopy
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000c4c5b
Device Boot Start End Blocks Id System
/dev/sda1 * 1 60065 482466816 83 Linux
/dev/sda2 60065 60802 5917697 5 Extended
/dev/sda5 60065 60802 5917696 82 Linux swap / Solaris
Disk /dev/sdb: 1954 MB, 1954545664 bytes
255 heads, 63 sectors/track, 237 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00069760
找到你的设备的盘符,我的是 /dev/sdb
[html] view
plaincopy
sudo umount /dev/sdb
[html] view
plaincopy
sudo fdisk /dev/sdb
在终端显示内容如下:
[html] view
plaincopy
Command (m for help):
输入m得到帮助信息:
[html] view
plaincopy
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
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
开始分区
如果你的设备已经有分区,先删除你的分区:
[html] view
plaincopy
Command (m for help): d 删除命令
Partition number (1-4): 1 删除地几个分区
[html] view
plaincopy
如果有多个分区,接着执行命令d,输入分区号
创建新分区:
[html] view
plaincopy
Command (m for help): n 创建分区命令
Command action
e extended
p primary partition (1-4)
p 选择分区的类型 e:扩展分区 p:主分区
Partition number (1-4): 1 分区号 1:第一个分区
First cylinder (1-237, default 1): 1
Last cylinder, +cylinders or +size{K,M,G} (1-237, default 237): +512M 分区的大小
创建第二个分区:同上
[html] view
plaincopy
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (67-237, default 67):
Using default value 67
Last cylinder, +cylinders or +size{K,M,G} (67-237, default 237): +512M
把第一个分区做为FAT32d 分区:
[html] view
plaincopy
Command (m for help): t 改变分区的id
Partition number (1-4): 1 改变第一个分区
Hex code (type L to list codes): c 变为dos兼容的格式
Changed system type of partition 1 to c (W95 FAT32 (LBA))
查看分区情况:
[html] view
plaincopy
Command (m for help): p
Disk /dev/sdb: 1954 MB, 1954545664 bytes
255 heads, 63 sectors/track, 237 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00069760
Device Boot Start End Blocks Id System
/dev/sdb1 1 66 530113+ c W95 FAT32 (LBA)
/dev/sdb2 67 132 530145 83 Linux
保存写入上面的内容:
[html] view
plaincopy
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.
格式化分区:
sudo mkfs.vfat -F 32 -n boot /dev/sdb1 //boot是为分区起的名字,就是在硬盘上显示的名字 格式化位fat32格式 第一个分区
sudo mkfs.ext3 -L linux_fs /dev/sdb2 // linux_fs 是第二个分区的名字,格式化位 ext3格式
相关文章推荐
- 在ubuntu下删除U盘分区及多分区格式化
- Ubuntu 下格式化 分区U盘SD 卡
- Ubuntu 下格式化 分区U盘SD 卡
- Ubuntu 下格式化 分区U盘SD 卡
- 文件系统结束Ubuntu下分区格式化U盘(fdisk&&mkfs)
- Ubuntu下分区格式化U盘(fdisk&&mkfs)
- uefi模式gpt分区下,光盘或u盘或硬盘安装ubuntu 16.04和win7并存
- Ubuntu下基于格式化命令 格式化U盘的方法
- ubuntu下对sd卡 分区和格式化 挂载sd卡
- win8+EIF+GPT分区 u盘 安装ubuntu13.10. 双系统
- ubuntu 12.04硬盘分区,格式化,挂载
- 在linux下对U盘进行格式化及分区
- Ubuntu下基于格式化命令 格式化U盘的方法
- ubuntu中U盘硬盘格式化(NTFS,FAT12,FAT16,FAT32,EXT4,EXT3,EXT2)
- Ubuntu 硬盘”分区“图文教程(用于光盘,U盘安装Ubuntu)
- ubutnu格式化分区u盘
- ubuntu下使用 Parted GPT工具对大于3T的硬盘进行分区,并使用mkfs进行格式化
- Ubuntu格式化分区时的一个小错误
- 解决U盘制作Ubuntu系统安装盘后无法格式化且容量无法恢复
- 不用光驱,不用分区,不用格式化,硬盘模式安装双系统XP+linux ubuntu==wubi