extend - extending logical volume in ubuntu -
i have following problem. ' ve added 20gb ubuntu machine (from 20 40gb). fdisk -l command :
disk /dev/sda: 42.9 gb, 42949672960 bytes 255 heads, 63 sectors/track, 5221 cylinders, total 83886080 sectors units = sectors of 1 * 512 = 512 bytes sector size (logical/physical): 512 bytes / 512 bytes i/o size (minimum/optimal): 512 bytes / 512 bytes disk identifier: 0x000881a0 device boot start end blocks id system /dev/sda1 * 2048 499711 248832 83 linux /dev/sda2 501758 41940991 20719617 5 extended /dev/sda5 501760 41940991 20719616 8e linux lvm disk /dev/mapper/zabbix-root: 20.1 gb, 20124270592 bytes 255 heads, 63 sectors/track, 2446 cylinders, total 39305216 sectors units = sectors of 1 * 512 = 512 bytes sector size (logical/physical): 512 bytes / 512 bytes i/o size (minimum/optimal): 512 bytes / 512 bytes disk identifier: 0x00000000 disk /dev/mapper/zabbix-root doesn't contain valid partition table disk /dev/mapper/zabbix-swap_1: 1069 mb, 1069547520 bytes 255 heads, 63 sectors/track, 130 cylinders, total 2088960 sectors units = sectors of 1 * 512 = 512 bytes sector size (logical/physical): 512 bytes / 512 bytes i/o size (minimum/optimal): 512 bytes / 512 bytes disk identifier: 0x00000000
i tried exteng command :
lvextend -l+20g /dev/mapper/zabbix-root
and got following
extending logical volume root 38.74 gib insufficient free space: 5120 extents needed, 5 available
can extend root 20gb more?
thanks
update
ok made cfdisk pvcreate , vgextend , lvextend , can see 40gb in volumegroup vgdisplay command.
next question is. how refresh info commands df etc.? df -h there still 19gb in here... ill send outputs lvdisplay,vgdisplay,fdisk -l, , df -h.
fdisk -l :
disk /dev/sda: 42.9 gb, 42949672960 bytes 255 heads, 63 sectors/track, 5221 cylinders, total 83886080 sectors units = sectors of 1 * 512 = 512 bytes sector size (logical/physical): 512 bytes / 512 bytes i/o size (minimum/optimal): 512 bytes / 512 bytes disk identifier: 0x000881a0 device boot start end blocks id system /dev/sda1 * 2048 499711 248832 83 linux /dev/sda2 501758 83886079 41692161 5 extended /dev/sda5 501760 41940991 20719616 8e linux lvm /dev/sda6 41941055 83886079 20972512+ 83 linux disk /dev/mapper/zabbix-root: 41.6 gb, 41599107072 bytes 255 heads, 63 sectors/track, 5057 cylinders, total 81248256 sectors units = sectors of 1 * 512 = 512 bytes sector size (logical/physical): 512 bytes / 512 bytes i/o size (minimum/optimal): 512 bytes / 512 bytes disk identifier: 0x00000000 disk /dev/mapper/zabbix-root doesn't contain valid partition table disk /dev/mapper/zabbix-swap_1: 1069 mb, 1069547520 bytes 255 heads, 63 sectors/track, 130 cylinders, total 2088960 sectors units = sectors of 1 * 512 = 512 bytes sector size (logical/physical): 512 bytes / 512 bytes i/o size (minimum/optimal): 512 bytes / 512 bytes disk identifier: 0x00000000 disk /dev/mapper/zabbix-swap_1 doesn't contain valid partition table
df -h :
filesystem size used avail use% mounted on /dev/mapper/zabbix-root 19g 17g 791m 96% / udev 489m 8.0k 489m 1% /dev tmpfs 200m 280k 199m 1% /run none 5.0m 0 5.0m 0% /run/lock none 498m 0 498m 0% /run/shm /dev/sda1 228m 25m 192m 12% /boot
vgdisplay :
--- volume group --- vg name zabbix system id format lvm2 metadata areas 2 metadata sequence no 5 vg access read/write vg status resizable max lv 0 cur lv 2 open lv 2 max pv 0 cur pv 2 act pv 2 vg size 39.76 gib pe size 4.00 mib total pe 10178 alloc pe / size 10173 / 39.74 gib free pe / size 5 / 20.00 mib vg uuid d4i8hj-rq2h-cpf1-lkfm-bsam-3mqe-9e39f3
lvdisplay :
--- logical volume --- lv name /dev/zabbix/root vg name zabbix lv uuid n4nqwb-p6hr-l51a-q98i-oae9-qmvu-whjqxo lv write access read/write lv status available # open 1 lv size 38.74 gib current le 9918 segments 3 allocation inherit read ahead sectors auto - set 256 block device 252:0 --- logical volume --- lv name /dev/zabbix/swap_1 vg name zabbix lv uuid jddtkd-vpzf-bxng-rqdi-hksc-i8j2-moy47c lv write access read/write lv status available # open 2 lv size 1020.00 mib current le 255 segments 1 allocation inherit read ahead sectors auto - set 256 block device 252:1
pvdisplay :
--- physical volume --- pv name /dev/sda5 vg name zabbix pv size 19.76 gib / not usable 2.00 mib allocatable yes (but full) pe size 4.00 mib total pe 5058 free pe 0 allocated pe 5058 pv uuid g2jnvt-dfq6-takf-qz8l-qff4-vaeq-qyvp3u --- physical volume --- pv name /dev/sda6 vg name zabbix pv size 20.00 gib / not usable 992.50 kib allocatable yes pe size 4.00 mib total pe 5120 free pe 5 allocated pe 5115 pv uuid il7kfu-rca9-3sue-0hrz-qtyx-s8el-elpogr
so figured out. @ first needed enlarge disk size in vmware enviroment. after needed rescan ubuntu server :
echo "- - -" > /sys/class/scsi_host/host#/scan
where # had replace numbers every host in scsi_host. able see added space in ubuntu command :
fdisk -l
in next step had prepare or format freespace using command :
cfdisk /dev/sda
-you can format u wish (also space) there new partition now. - in case : /dev/sda6
next step use pvcreate new partition :
pvcreate /dev/sda6
after done add existing volume group using :
vgextend vg_name /dev/sda6
and can extend logical volume using :
lvextend -l+20g /dev/zabbix/root
and if check fdisk -l there /zabbix-root +20gb :) bud dont forget use resize2fs let filesystem know there change. if u not u not able use new space.
resize2fs /dev/zabbix/root
Comments
Post a Comment