|
|
大于2T的设备使用fdisk分区已经不可以,只能使用gpt方式分区
+ u5 r, ^+ w( J! t3 w[root@localhost ~]# gdisk /dev/sdb
2 k4 t" V( I* m V/ T8 [$ `GPT fdisk (gdisk) version 0.8.68 c3 t) b# P! z0 V9 V
Partition table scan:
( \/ D! R! d# i4 T MBR: protective
7 J( C3 k* |, |! x* i. b# J5 ? BSD: not present6 S: }) e& A' l
APM: not present
) V I- g7 [5 F. E# {! Z- k) C# w GPT: present/ O$ ]6 E1 M9 b2 C( \
Found valid GPT with protective MBR; using GPT.+ c! ?2 P7 ]% B
Command (? for help): ?
I! A2 I. a/ I+ cb back up GPT data to a file- b! U+ ?1 z: c0 A( h4 i! a3 ?3 M
c change a partition's name
3 q" o3 k) p, n0 b% F$ kd delete a partition
$ h2 n; u& O0 E' |# ^i show detailed information on a partition
. |8 T/ ]' X% ~% a8 nl list known partition types
& S1 o G+ H& C; cn add a new partition
4 y- I! b/ m W- b( j& bo create a new empty GUID partition table (GPT)
& A" {, @ v( f) n, Y) \& E; qp print the partition table2 N, B n6 e; f9 k
q quit without saving changes
( _4 k. t' [$ s( i x! F# h; B: zr recovery and transformation options (experts only)
1 \) U/ P5 Y3 A% }# ]% Fs sort partitions' E& a" F6 ?' X+ w) e+ s3 t' ^& N* m. v
t change a partition's type code
" ^2 g3 H- {! c+ F* S& v% Lv verify disk
8 _' R: ?0 Y& t4 W5 ^' M8 tw write table to disk and exit
9 ~# r- T) T$ D9 H; v7 C3 ]/ Yx extra functionality (experts only)- b4 }) B! v# z) j
? print this menu
. [+ f% {( L$ ?+ l+ Z1 V# [Command (? for help): p7 b) k7 F6 @* y0 C( n
Disk /dev/sdb: 62914560 sectors, 30.0 GiB# u( K# ?. ?: g6 H% q
Logical sector size: 512 bytes4 B; K# ^% ?8 S6 D
Disk identifier (GUID): 0C46C34F-DB4A-4E3A-8D8B-EE2D49F2027A
9 N( h/ m5 N7 A8 h6 aPartition table holds up to 128 entries0 D! b8 }, }2 {, H: Y5 m
First usable sector is 34, last usable sector is 62914526
" V; l- H9 M8 S5 ?$ M- E: x/ Y4 EPartitions will be aligned on 2048-sector boundaries
8 F: q3 }4 o: W( L0 aTotal free space is 62914493 sectors (30.0 GiB)
6 b7 b" I, D% k9 UNumber Start (sector) End (sector) Size Code Name
" R7 L5 S% `$ q# s6 H iCommand (? for help): n
# Q. F$ T _, y* S* L7 f+ rPartition number (1-128, default 1): 1008 Q }, v8 i5 G, C0 [
First sector (34-62914526, default = 2048) or {+-}size{KMGTP}: D+ u5 I7 k+ _( U6 C6 V
Last sector (2048-62914526, default = 62914526) or {+-}size{KMGTP}: +1G
. k+ d! L: q# B" J- V V5 ~2 BCurrent type is 'Linux filesystem'
* I6 a* U1 E. F/ y# VHex code or GUID (L to show codes, Enter = 8300):
% x1 ^' K& P: T+ [, ZChanged type of partition to 'Linux filesystem'
, `0 k9 d% t6 T5 W# J8 [Command (? for help): p" f/ G, f, i; {- U* F
Disk /dev/sdb: 62914560 sectors, 30.0 GiB9 P) D$ N) Z* y1 W" Y
Logical sector size: 512 bytes
& i8 f. D7 E W+ @" h2 UDisk identifier (GUID): 0C46C34F-DB4A-4E3A-8D8B-EE2D49F2027A% B$ ~5 {' g1 e1 j) c4 [, [$ C
Partition table holds up to 128 entries9 m) }4 { {0 _, }# A- J! Z
First usable sector is 34, last usable sector is 62914526' T" G* c4 m a; ~& s g( |
Partitions will be aligned on 2048-sector boundaries
& u$ O7 P9 A) wTotal free space is 60817341 sectors (29.0 GiB)! n3 `6 A& d9 g8 J; W
Number Start (sector) End (sector) Size Code Name
2 f1 O$ [6 P; c2 [. q 100 2048 2099199 1024.0 MiB 8300 Linux filesystem# {0 ~: p0 g0 W6 t+ H2 s! t1 P
Command (? for help): w
/ `# e \- l) W- ]& H( O% MFinal checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
9 n+ o4 q! H+ s3 pPARTITIONS!!
) x5 }) [' L, [8 S, YDo you want to proceed? (Y/N): y
9 B4 f1 c0 P* L( ]8 T1 jOK; writing new GUID partition table (GPT) to /dev/sdb.- e" Y+ f5 s2 R, S, x0 S& B
The operation has completed successfully.
2 c) U0 k2 S. ^4 g& b[root@localhost ~]# lsblk8 ^) I" g! f3 q6 {8 G: v% a) f
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
* B7 j; G' R, E: Q& ?4 @sda 8:0 0 80G 0 disk; {1 i! p5 A6 a4 l; v9 V
├─sda1 8:1 0 1G 0 part /boot( `8 y" s2 ]& a8 f
└─sda2 8:2 0 79G 0 part
9 _0 b* P) q% }; J" U9 ^6 R1 B ├─cl-root 253:0 0 50G 0 lvm /" S$ i7 U5 Q$ v9 \" r
├─cl-swap 253:1 0 2G 0 lvm [SWAP]$ y4 r9 [" x1 n9 |6 D; N
└─cl-home 253:2 0 27G 0 lvm /home
8 P+ a' p8 m2 bsdb 8:16 0 30G 0 disk
% Z0 v w. U q! I' n! h$ ]. {7 _└─sdb100 259:0 0 1G 0 part
- j# ?) y+ g% G) n/ j8 n# I" |sdc 8:32 0 20G 0 disk$ h2 r- P4 V# [6 Q! m4 B
sr0 11:0 1 7.7G 0 rom |
|