Subscribe

NAbox Increase Disk Space

Hi,

Our NAbox has filled the /opt, when using the menu to add further space it keeps failing;

 

nabox1.PNG

 

When running through the resize i get the following

Capture.PNG

 

 is there any docs on how to perform the increase?

 

Re: NAbox Increase Disk Space

01) login as root to nabox and check what filesystem device names before adding new disk
root@nabox:~# fdisk -l
save the output to a file

02) login to the vmCente
03) shutdown the nabox vm
04) add new disk to the vm "for example /dev/sdd = 100g"
05) startup the nabox vm
06) login as root ssh nabox.YOURDOMAIN.COM
07) check if you can see the new disk:
root@nabox:~# fdisk -l

Disk /dev/sdd: 100 GiB, 107374182400 bytes, 209715200 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


08) check the filesystem before add the new disk:
root@nabox:~# df -hP
Filesystem Size Used Avail Use% Mounted on
/dev/sda6 4.8G 3.0G 1.7G 65% /
udev 10M 0 10M 0% /dev
tmpfs 6.3G 33M 6.3G 1% /run
tmpfs 16G 0 16G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/sda1 88M 29M 52M 36% /boot
/dev/mapper/vg_data-lv_data 394G 122G 255G 33% /opt


09) check lv size 394G = 400G:
root@nabox:~# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
lv_data vg_data -wi-ao---- 400.00g

 

10) format the new filesystem as ext4:

root@nabox:~# mkfs.ext4 /dev/sdd
mke2fs 1.42.12 (29-Aug-2014)
Creating filesystem with 26214400 4k blocks and 6553600 inodes
Filesystem UUID: fe28bb20-38f2-4178-b4a9-0787a45ebb75
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

 

 

11) extend VG with the new disk:
root@nabox:~# vgextend vg_data /dev/sdd
Physical volume "/dev/sdd" successfully created
Volume group "vg_data" successfully extended

 

12) run lvsan begore lvextend:
root@nabox:~# lvscan
ACTIVE '/dev/vg_data/lv_data' [400.00 GiB] inherit

 

13) extend lv with new 100g
root@nabox:~# lvextend -L+100G /dev/vg_data/lv_data
Size of logical volume vg_data/lv_data changed from 400.00 GiB (102399 extents) to 500.00 GiB (127999 extents).
Logical volume lv_data successfully resized

 

14) check the new size of lv "you can see it did change from 400g to 500g":
root@nabox:~# lvscan
ACTIVE '/dev/vg_data/lv_data' [500.00 GiB] inherit

 

15) resize the filesystem:
root@nabox:~# resize2fs /dev/vg_data/lv_data
resize2fs 1.42.12 (29-Aug-2014)
Filesystem at /dev/vg_data/lv_data is mounted on /opt; on-line resizing required
old_desc_blocks = 25, new_desc_blocks = 32
The filesystem on /dev/vg_data/lv_data is now 131070976 (4k) blocks long.

now you can see /opt whent from 400g to 500g

 

root@nabox:~# df -hP
Filesystem Size Used Avail Use% Mounted on
/dev/sda6 4.8G 3.0G 1.7G 65% /
udev 10M 0 10M 0% /dev
tmpfs 6.3G 8.5M 6.3G 1% /run
tmpfs 16G 0 16G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/sda1 88M 29M 52M 36% /boot
/dev/mapper/vg_data-lv_data 493G 122G 349G 26% /opt