|
|
Usage: fdisk [-l] [-b SSZ] [-u] device E.g.: fdisk /dev/hda (for the first IDE disk)3 T4 `8 o1 H- V" r
or: fdisk /dev/sdc (for the third SCSI disk)
7 }3 [1 i4 y* O% v8 Y+ h or: fdisk /dev/eda (for the first PS/2 ESDI drive)
" D9 Y" m3 D2 B, l7 B* c or: fdisk /dev/rd/c0d0 or: fdisk /dev/ida/c0d0 (for RAID devices)
. L0 a+ F+ f- h3 w H ... @. ]8 s; R% g, c/ B
- df -k
( ]% b% @1 n1 w* o0 v3 ]( V: Z3 k - df -lh
4 r) Q. g9 `. ]- A0 f! w1 q - 查看有几块硬盘:fdisk -l$ \$ u9 ^0 l% k. u0 M! j* U! V
复制代码 文件系统 1K-块 已用 可用 已用% 挂载点
% x4 ]4 _1 `5 f8 p( v. y1 x /dev/sda3 3723848 705968 2828716 20% /( z u8 H4 y3 w: n9 [1 D; N5 K
/dev/sda1 101089 9274 86596 10% /boot9 C& h; N, Y1 ~. z8 p' L
none 14520 0 14520 0% /dev/shm
+ v+ [ E+ G+ [/ e; Y' |5 P 对新硬盘分区,4G硬盘中划出1G作为新分区。给/home使用3 v: o; @2 R, ~, X8 `
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
3 L& }- _( j* b2 |7 Q Building a new DOS disklabel. Changes will remain in memory only,) R! W7 v- K6 ~
until you decide to write them. After that, of course, the previous2 M6 T q1 S. B& g% Y. i* |9 O# d7 I
content won't be recoverable.. y9 K6 ?5 W5 ^7 Z8 X
The number of cylinders for this disk is set to 8322.
) I0 G5 S0 b+ u# \8 b1 H There is nothing wrong with that, but this is larger than 1024,
* x+ o1 U3 `% }2 i and could in certain setups cause problems with:
2 t- l" F$ w$ U; h; a9 z1 v 1) software that runs at boot time (e.g., old versions of LILO)
* T r* f* G" q0 K9 h$ {* u0 ? 2) booting and partitioning software from other OSs# e* G/ Y) q( g/ m" Q
(e.g., DOS FDISK, OS/2 FDISK)
) {+ u6 Q1 K& ~3 p* G Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite); r9 ~( f1 z. i; A
Command (m for help): p
; }5 K I, J# {8 r4 r; E8 { Disk /dev/hda: 4294 MB, 4294967296 bytes# I8 w& X' y& {3 i& ^. ~9 ~" I
16 heads, 63 sectors/track, 8322 cylinders
5 A* o+ n: X h' V O9 V8 w Units = cylinders of 1008 * 512 = 516096 bytes4 y! D- r. k& B$ p5 L4 j
Device Boot Start End Blocks Id System
) _# w) l/ C3 }% _" V, a Command (m for help): m. k: M2 v! C, R) O
Command action+ [, Y" A& w+ i; c
a toggle a bootable flag
: C( }) R n n# ]. `+ o# E" U b edit bsd disklabel
+ E! ]4 h" _/ g* T c toggle the dos compatibility flag0 o1 {1 r: u5 W3 M
d delete a partition! E' ]) t, K8 a; ~+ Q
l list known partition types) }% `; I, s0 g: r
m print this menu+ L+ U& p' w+ z
n add a new partition- r9 i3 b: Y6 f. }/ C% z- n) A; e6 `
o create a new empty DOS partition table; g3 T/ v% J6 b: o& a3 t
p print the partition table9 J! M% R7 _5 _8 w+ P9 f# u
q quit without saving changes
1 b- V9 S0 |. J2 U' H" G s create a new empty Sun disklabel
. t5 M& ^2 Q" T t change a partition's system id
; J, x9 _' z6 J& B u change display/entry units
; L: W* K& {; Z# o! s" x2 A1 f; s v verify the partition table
# c: Z; N( H6 O" s' y8 y' P w write table to disk and exit; J* d$ X& W' w8 O! L3 J; J
x extra functionality (experts only)
( W" z4 a. M. D- {1 r' L" V Command (m for help): n
1 [, l# I% V3 Z4 b0 N8 C1 S Command action
" R1 z% O# P2 Y/ }1 r6 m4 t e extended
' h: y9 M) m& e7 y9 H p primary partition (1-4)
" b+ Z2 P8 H3 B4 K% R7 ` p) o( c7 l5 ^6 ^+ M8 u( `& v1 L8 L* l" ?
Partition number (1-4): 1
4 Z- k, s7 [6 v R* y First cylinder (1-8322, default 1):
' {9 S% E1 j8 L- ~4 R) f Using default value 1
3 m/ J$ M9 g3 u Last cylinder or +size or +sizeM or +sizeK (1-8322, default 8322): 1000G* e7 m A2 v* C0 J' f0 W
Command (m for help): p
7 d2 T) H4 \: x8 Y Disk /dev/hda: 4294 MB, 4294967296 bytes
" s, Q4 E* S6 m+ X7 u4 ^' G 16 heads, 63 sectors/track, 8322 cylinders1 R" S# M, J$ R5 l) U
Units = cylinders of 1008 * 512 = 516096 bytes
' @; d$ t9 G8 s4 }; a0 |2 X2 D Device Boot Start End Blocks Id System
' J7 K2 [& d! f5 p /dev/hda1 1 1000 503968+ 83 Linux
( K% }/ ]% Q2 X% \ ~3 }# j Command (m for help): w! r$ g3 K# | P0 A `/ D* c) G- ~- n
The partition table has been altered!
- V ^, J4 F* r9 v6 ~+ z Calling ioctl() to re-read partition table.
( d+ J4 P( C1 @1 B- V Syncing disks.
S% m8 z1 B/ H4 L+ ]1 c5 @, S5 d //格式化新分区+ J$ V9 d$ B- d
mke2fs 1.32 (09-Nov-2002)* C9 C" Q- h2 V
Filesystem label=) N% k( U3 J; {' f* t0 P% @7 x$ e5 b
OS type: Linux, s9 }/ n0 }& c
Block size=1024 (log=0)
: s, E! \3 \; C2 x9 }5 z Fragment size=1024 (log=0)$ r- R& ]) K' C5 W
126480 inodes, 503968 blocks
, p) G3 t- F: b# K* r 25198 blocks (5.00%) reserved for the super user
/ p, C7 d# P+ M, a First data block=1- s S- x$ G# [7 r$ z, a% o+ F
62 block groups* `1 I" ^& I; v- |& {
8192 blocks per group, 8192 fragments per group
- T3 ], F8 l# d' w1 T, d 2040 inodes per group
# {& i8 F( j; r Superblock backups stored on blocks: 2 G+ P6 w$ t3 Y/ j( w/ u. C
8193, 24577, 40961, 57345, 73729, 204801, 221185, 4014091 K; D k, \& `. c% C3 |9 c
Writing inode tables: done
% o0 q, U) v; U3 T Creating journal (8192 blocks): done0 r9 W2 t. {3 I6 A: g J
Writing superblocks and filesystem accounting information: done
2 J% H9 }. X" h# Q This filesystem will be automatically checked every 30 mounts or
) Y& Y, H2 B9 U) {& x: w 180 days, whichever comes first. Use tune2fs -c or -i to override.
4 f8 L/ [: D( R; ?文件系统 1K-块 已用 可用 已用% 挂载点
3 q# D) R8 g t, j /dev/sda3 3723848 705992 2828692 20% /
6 y( o% I" m/ p4 i. [6 s8 N' M! q /dev/sda1 101089 9274 86596 10% /boot4 ]1 X4 H: H5 c) _( t# t% a
none 14520 0 14520 0% /dev/shm! i) S: O' a' p0 X7 D: l
//挂上新分区- z/ `1 }/ P& ^, o
- mount /dev/hda1 /home3 o: X( N/ B5 |
- df -k
复制代码 文件系统 1K-块 已用 可用 已用% 挂载点7 L) U! ~* a; I
/dev/sda3 3723848 705992 2828692 20% /3 e/ U4 y1 D+ N- f8 f0 Q
/dev/sda1 101089 9274 86596 10% /boot* N( `5 U9 P$ z/ @2 `
none 14520 0 14520 0% /dev/shm
0 e& A& U( r% L1 M6 u4 O2 | /dev/hda1 488006 8239 454569 2% /home
, s8 c9 j9 `" s2 G( I4 L% q+ x7 i7 z2 ] I
自动挂载:8 h" j2 ^% x# G4 ?% R9 N
- vi /etc/fstab7 X; S5 w5 e1 f7 c9 A
4 J) u: o5 w0 f( P. y- /dev/sdb5 /mnt/ljp1 ext3 defaults 0 0, P; E- V' ?, E
6 G( V' Z% r% |/ g4 G) r- /dev/sdb6 /mnt/ljp2 ext3 defaults 0 0
复制代码 手动挂载:0 M1 Q! m8 M9 {
- mount /dev/sdb5 /mnt/ljp1& _* a f# { C& B5 Z: R
- & v6 P' B2 M5 d( H) z; t) r
- mount /dev/sdb6 /mnt/ljp2
复制代码 $ w. h- Q8 G5 J, ~ o: v: X3 j4 B
- `+ r+ T. b5 @) m3 @' @3 x+ e1 ]. E8 j
|
|