Linux系統由于數據累計增長、前期存儲規劃不合理等諸多因素,出現存儲不夠用的情況時,此時就需要擴展邏輯分區或添加新的邏輯分區。下面介紹一下通過使用fdsik添加新的邏輯分區。
首先使用df命令檢查文件系統的磁盤空間占用情況
[root@DB-ONE-SERVER~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-sda3
30G 2.4G 26G 9% /
/dev/sda1 99M 23M 71M 25% /boot
tmpfs 4.0G 0 4.0G 0% /dev/shm
You have new mail in /var/spool/mail/root
然后使用fdisk -l查看分區表信息
[root@DB-ONE-SERVER~]# fdisk -l
Disk /dev/sda: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 5221 41833260 8e Linux LVM
Disk /dev/sdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdb doesn't contain a valid partition table
Disk /dev/dm-0: 32.3 GB, 32346472448 bytes
255 heads, 63 sectors/track, 3932 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/dm-0 doesn't contain a valid partition table
Disk /dev/dm-1: 10.4 GB, 10468982784 bytes
255 heads, 63 sectors/track, 1272 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/dm-1 doesn't contain a valid partition table
fdisk命令參數介紹
p、打印分區表。
n、新建一個新分區。
d、刪除一個分區。
m、輸出菜單
q、退出不保存。
w、把分區寫進分區表,保存并退出。
[root@DB-ONE-SERVER~]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the PRevious
content won't be recoverable.
The number of cylinders for this disk is set to 2610.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
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
新聞熱點
疑難解答