linux(LVM)扩展根目录空间的操作步骤
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
LVM下添加根目录空间
一、linux下的fdisk工具进行分区。
用root用户登录到你的linux系统,查看你系统的分区
#fdisk -l
会出现以下的信息:
Disk /dev/sda: 322.1 GB, 322122547200 bytes
255 heads, 63 sectors/track, 39162 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: 0x00098804
Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux Partition 1 does not end on cylinder boundary.
/dev/sda2 64 11749 93858816 8e Linux LVM
Disk /dev/mapper/vg_app2-lv_root: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 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: 0x00000000
Disk /dev/mapper/vg_app2-lv_swap: 4160 MB, 4160749568 bytes
255 heads, 63 sectors/track, 505 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: 0x00000000
Disk /de v/mapper/vg_app2-lv_home: 38.3 GB, 38260441088 bytes
255 heads, 63 sectors/track, 4651 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: 0x00000000
根据提示信息可以判断出此系统的磁盘接口为SCSI,对应“sda”如果上面的红色字体是“hda”,那么此系统的磁盘接口为IDE对应“hda”所以我做一下操作:
#fdisk /dev/sda/
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):m //“ 列出fdisk的帮助”
Command action
a toggle a bootable flag
b edit bsddisklabel
c toggle the dos compatibility flag
d delet
e 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
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help):n //” 命令n用于添加新分区"
Command action
e extended
p primary partition (1-4)
p //" 选择创建主分区"此时,
Partition number (1-4):3 //fdisk会让你选择主分区的编号,如果已经有了主分区sda1,sda2,那么编号就选3,即要创建的该分区为sda3.
First cylinder (2611-3916, default 2611): //此时,fdisk又会让你选择该分区的开始值这个就是分区的Start 值(start cylinder);这里最好直接按回车,
Using default value 2611
Last cylinder, +cylinders or +size{K,M,G} (2611-3916, default 3916): //此时,fdisk又会让你选择该分区的开始值这个就是分区的End 值这里最好直接按回车,
Using default value 3916
Command (m for help): w //w "保存所有并退出,分区划分完毕"
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.