Netskope Global Technical Success (GTS)
Increase disk space on ubuntu based publishers
Netskope Cloud Version - 120
Objective
To demonstrate the process for increasing disk space on ubuntu based publishers
Prerequisite
Netskope Private access entitlement.
Netskope Publisher actively reporting to Management Plane
Context
The minimum requirement of the Netskope private access Publisher disk space has changed from 8 GB to 16 GB.
Customers can use this KB to increase the disk space on Ubuntu based publisher
Lab Recreate:
Before beginning to increase the disk size, please ensure that you increase the Physical disk size on the server.
Step 1 : Run command df -h, you will get the output below :
ubuntu@npa-publisher:~$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 1.9G 0 1.9G 0% /dev
tmpfs 393M 1.2M 392M 1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv 29G 5.5G 22G 21% / - We are interested in this partition
tmpfs 2.0G 0 2.0G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
tmpfs 1.0G 0 1.0G 0% /tmp
/dev/sda2 974M 102M 805M 12% /boot
/dev/loop0 56M 56M 0 100% /snap/core18/2667
/dev/loop1 56M 56M 0 100% /snap/core18/2679
/dev/loop3 50M 50M 0 100% /snap/snapd/17950
/dev/loop2 70M 70M 0 100% /snap/lxd/19188
/dev/loop4 64M 64M 0 100% /snap/core20/1778
Step 2 : Run command lsblk you will get the output below :
ubuntu@npa-publisher:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 55.6M 1 loop /snap/core18/2667
loop1 7:1 0 55.6M 1 loop /snap/core18/2679
loop2 7:2 0 69.9M 1 loop /snap/lxd/19188
loop3 7:3 0 49.8M 1 loop /snap/snapd/17950
loop4 7:4 0 63.3M 1 loop /snap/core20/1778
loop5 7:5 0 91.9M 1 loop /snap/lxd/24061
sda 8:0 0 40G 0 disk – This is the total disk size before ├─sda1 8:1 0 1M 0 part
├─sda2 8:2 0 1G 0 part /boot
└─sda3 8:3 0 29G 0 part – We need to increase this
└─ubuntu--vg-ubuntu--lv 253:0 0 29G 0 lvm /
sr0 11:0 1 1024M 0 rom
Resize Partition
Step 3 : Run command “sudo parted /dev/sda
ubuntu@npa-publisher:~$ sudo parted /dev/sda
GNU Parted 3.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit b
(parted) print free
Warning: Not all of the space available to /dev/sda appears to be used, you can fix the GPT to use all of the space (an extra 20971520 blocks) or continue with the current setting?
Fix/Ignore? Fix
Model: Msft Virtual Disk (scsi)
Disk /dev/sda: 42949672960B
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
17408B 1048575B 1031168B Free Space
1 1048576B 2097151B 1048576B bios_grub
2 2097152B 1075838975B 1073741824B ext4
3 1075838976B 32212237823B 31136398848B
32212237824B 42949656063B 10737418240B Free Space – this is the free space we have
(parted) resizepart 3 42949656063B
(parted) print free
Model: Msft Virtual Disk (scsi)
Disk /dev/sda: 42949672960B
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
17408B 1048575B 1031168B Free Space
1 1048576B 2097151B 1048576B bios_grub
2 2097152B 1075838975B 1073741824B ext4
3 1075838976B 42949656063B 41873817088B – Now we see there is no free space. So the free space has been added to partition 3
(parted) quit
Information: You may need to update /etc/fstab.
Resize Physical Volume
Step 4 : Run command sudo pvresize /dev/sda3
ubuntu@npa-publisher:~$ sudo pvresize /dev/sda3
Physical volume "/dev/sda3" changed
1 physical volume(s) resized or updated / 0 physical volume(s) not resized ubuntu@npa-publisher:~$
Step 5 : Run command sudo lvresize -l +100%FREE to resize Physical volume
ubuntu@npa-publisher:~$ sudo lvresize -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
Size of logical volume ubuntu-vg/ubuntu-lv changed from <29.00 GiB (7423 exten ts) to <39.00 GiB (9983 extents).
Logical volume ubuntu-vg/ubuntu-lv successfully resized.
ubuntu@npa-publisher:~$ sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv
resize2fs 1.45.5 (07-Jan-2020)
Filesystem at /dev/mapper/ubuntu--vg-ubuntu--lv is mounted on /; on-line resizin g required
old_desc_blocks = 4, new_desc_blocks = 5
The filesystem on /dev/mapper/ubuntu--vg-ubuntu--lv is now 10222592 (4k) blocks long.
Step 6 : View Disk and Partitions to confirm the change
Ubuntu@npa-publisher:~$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 1.9G 0 1.9G 0% /dev
tmpfs 393M 1.2M 392M 1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv 39G 5.5G 32G 15% / - The disk size has now increased to 39G
tmpfs 2.0G 0 2.0G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
tmpfs 1.0G 4.0K 1.0G 1% /tmp
/dev/sda2 974M 102M 805M 12% /boot
/dev/loop0 56M 56M 0 100% /snap/core18/2667
/dev/loop1 56M 56M 0 100% /snap/core18/2679
/dev/loop3 50M 50M 0 100% /snap/snapd/17950
/dev/loop2 70M 70M 0 100% /snap/lxd/19188
/dev/loop4 64M 64M 0 100% /snap/core20/1778
/dev/loop5 92M 92M 0 100% /snap/lxd/24061
tmpfs 393M 0 393M 0% /run/user/1000
ubuntu@npa-publisher:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 55.6M 1 loop /snap/core18/2667
loop1 7:1 0 55.6M 1 loop /snap/core18/2679
loop2 7:2 0 69.9M 1 loop /snap/lxd/19188
loop3 7:3 0 49.8M 1 loop /snap/snapd/17950
loop4 7:4 0 63.3M 1 loop /snap/core20/1778
loop5 7:5 0 91.9M 1 loop /snap/lxd/24061
sda 8:0 0 40G 0 disk
├─sda1 8:1 0 1M 0 part
├─sda2 8:2 0 1G 0 part /boot
└─sda3 8:3 0 39G 0 part – The required disk size has been increased └─ubuntu--vg-ubuntu--lv 253:0 0 39G 0 lvm /
sr0 11:0 1 1024M 0 rom
Terms and Conditions
- All documented information undergoes testing and verification to ensure accuracy.
- In the future, If any such platform changes are brought to our attention, we will promptly update the documentation to reflect them.
Notes
- This article is authored by Netskope Global Technical Success (GTS).
- For any further inquiries related to this article, please contact Netskope GTS by submitting a support case with 'Case Type – How To Questions'.