码迷,mamicode.com
首页 > 系统相关 > 详细

Linux 分区命令随查

时间:2015-06-16 18:20:33      阅读:182      评论:0      收藏:0      [点我收藏+]

标签:

sudo fdisk -l

sudo fdisk /dev/sdb

 

help command

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
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)

Command (m for help): p

Disk /dev/sdb: 16.1 GB, 16131293184 bytes
255 heads, 63 sectors/track, 1961 cylinders, total 31506432 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 identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdb1 2 614457 307228 b W95 FAT32
/dev/sdb2 614459 12001823 5693682+ af HFS / HFS+

delete patition

Command (m for help): d
Partition number (1-4): 1

Command (m for help): p

Disk /dev/sdb: 16.1 GB, 16131293184 bytes
255 heads, 63 sectors/track, 1961 cylinders, total 31506432 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 identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdb2 614459 12001823 5693682+ af HFS / HFS+

Command (m for help): d
Selected partition 2

Command (m for help): p

Disk /dev/sdb: 16.1 GB, 16131293184 bytes
255 heads, 63 sectors/track, 1961 cylinders, total 31506432 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 identifier: 0x00000000

Device Boot Start End Blocks Id System

new patitioin

Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-31506431, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-31506431, default 31506431):
Using default value 31506431

Command (m for help): p

Disk /dev/sdb: 16.1 GB, 16131293184 bytes
255 heads, 63 sectors/track, 1961 cylinders, total 31506432 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 identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdb1 2048 31506431 15752192 83 Linux

change patition type

Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): b
Changed system type of partition 1 to b (W95 FAT32)

Command (m for help): p

Disk /dev/sdb: 16.1 GB, 16131293184 bytes
48 heads, 6 sectors/track, 109397 cylinders, total 31506432 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 identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdb1 2048 2000000 998976+ b W95 FAT32
/dev/sdb2 2000001 30000000 14000000 83 Linux
/dev/sdb3 30000001 31506431 753215+ 83 Linux

Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 87
Changed system type of partition 2 to 87 (NTFS volume set)

Command (m for help): p

Disk /dev/sdb: 16.1 GB, 16131293184 bytes
48 heads, 6 sectors/track, 109397 cylinders, total 31506432 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 identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdb1 2048 2000000 998976+ b W95 FAT32
/dev/sdb2 2000001 30000000 14000000 87 NTFS volume set
/dev/sdb3 30000001 31506431 753215+ 83 Linux

sudo mkfs -t ntfs /dev/sdb2

Cluster size has been automatically set to 4096 bytes.
Initializing device with zeroes: 3% ....

 

Linux 分区命令随查

标签:

原文地址:http://www.cnblogs.com/zzuse/p/4581212.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!