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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
root@zentao:/home/ubuntu# fdisk /dev/sda
Welcome to fdisk (util-linux 2.27.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
The size of this disk is 4 TiB (4398046511104 bytes). DOS partition table format can not be used on drives for volumes larger than 2199023255040 bytes for 512-byte sectors. Use GUID partition table format (GPT).
Command (m for help): p ###查看已有分区
Disk /dev/sda: 4 TiB, 4398046511104 bytes, 8589934592 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
Disklabel type: dos
Disk identifier: 0x039343bf
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 1499135 1497088 731M 83 Linux
/dev/sda2 1501182 419428351 417927170 199.3G 5 Extended
/dev/sda5 1501184 419428351 417927168 199.3G 8e Linux LVM
Command (m for help): F ###查看可分配空间
Unpartitioned space /dev/sda: 3.8 TiB, 4183299194880 bytes, 8170506240 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
Start End Sectors Size
419428352 8589934591 8170506240 3.8T
Command (m for help): n ###创建分区
Partition type
p primary (1 primary, 1 extended, 2 free)
l logical (numbered from 5)
Select (default p): p
Partition number (3,4, default 3):
First sector (1499136-4294967295, default 1499136): 419428352
Last sector, +sectors or +size{K,M,G,T,P} (419428352-4294967294, default 4294967294):
Created a new partition 3 of type 'Linux' and of size 1.8 TiB.
Command (m for help): p
Disk /dev/sda: 4 TiB, 4398046511104 bytes, 8589934592 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
Disklabel type: dos
Disk identifier: 0x039343bf
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 1499135 1497088 731M 83 Linux
/dev/sda2 1501182 419428351 417927170 199.3G 5 Extended
/dev/sda3 419428352 4294967294 3875538943 1.8T 83 Linux
/dev/sda5 1501184 419428351 417927168 199.3G 8e Linux LVM
Partition table entries are not in disk order.
Command (m for help): t ###修改分区type
Partition number (1-3,5, default 5): 3 ###指定要修改的分区
Partition type (type L to list all types): 8e ###8e对应的type为Linux LVM
Changed type of partition 'Linux' to 'Linux LVM'.
Command (m for help): w ###写入分区表
The partition table has been altered
|