Linuxシステムの下でハードディスクパーティションを拡張する方法のまとめ
ハードディスク(HDD)が満杯になり、ハードディスク(HDD)の拡張を加えます。独立したサーバでも、クラウドスペースで新しく買ったハードディスクでも、拡張方式は同じです。以下、アリVPSを例に、ハードディスクをマウントして拡張する2つの方法について詳しく説明します。
アリVPSは、個人的には以下の2つの面が改善される必要があると思います。 1,デフォルトはlvmではないので、システムディスク/dev/xvda 1は拡張できないので、ビッグデータのものがあれば、最初から拡張の問題を考慮しなければなりません。データ量が大きいほど、操作リスクが大きくなります。2,シームレスな拡張は実現できない,つまりバックグラウンドで拡張してVPSに登録せずに調整する.非専門家、拡張困難
一、lvmを採用せず、直接ハードディスクをディレクトリにマウントする
1ハードディスク(HDD)パーティションの表示
コードのコピー
[root@iZ94zz3wqciZ ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/xvda1 20641404 14778400 4814480 76% /
tmpfs 509300 0 509300 0% /dev/shm
[root@iZ94zz3wqciZ ~]# fdisk -l
Disk /dev/xvda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 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: 0x00078f9c
Device Boot Start End Blocks Id System
/dev/xvda 1*1 2611 20970496 83 Linux//idは83でlvm以外
Disk/dev/xvdb:23.6 GB、2362320128 bytes//新しく買ったハードディスク
255 heads, 56 sectors/track, 3230 cylinders
Units = cylinders of 14280 * 512 = 7311360 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x27cc1f5a
2、ハードディスク(HDD)のパーティション化とパーティションの表示
コードのコピー
[root@iZ94zz3wqciZ~]#fdisk-S 56/dev/xvdb//パーティション
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command(m for help):n//入力n