[Solved] Unable to see the allocated disk space to Debian VM

New to Debian (Or Linux in general)? Ask your questions here!

[Solved] Unable to see the allocated disk space to Debian VM

Postby pavank » 2020-07-13 03:50

Hi,
I'm new to Linux/Debian, hope some can assist me here. I have allocated 20GB to my Debian VM (VMWare platform) but on the machine, I can only see I think around 3.9GB. FYI - Please see the below output. Will someone be able to advise where/how to find the unallocated space and and how to extend? FYI - I have few more Debian VMs but they are showing correctly like below.
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 91G 11G 76G 13% /

Issue box:
df -h
Filesystem Size Used Avail Use% Mounted on
udev 3.9G 0 3.9G 0% /dev
tmpfs 798M 8.7M 790M 2% /run
/dev/sda1 2.9G 2.9G 0 100% /
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
tmpfs 798M 12K 798M 1% /run/user/1011
tmpfs 798M 4.0K 798M 1% /run/user/109
tmpfs 798M 12K 798M 1% /run/user/1007

df -a -h
Filesystem Size Used Avail Use% Mounted on
sysfs 0 0 0 - /sys
proc 0 0 0 - /proc
udev 3.9G 0 3.9G 0% /dev
devpts 0 0 0 - /dev/pts
tmpfs 798M 8.7M 790M 2% /run
/dev/sda1 2.9G 2.9G 0 100% /
securityfs 0 0 0 - /sys/kernel/security
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
cgroup2 0 0 0 - /sys/fs/cgroup/unified
cgroup 0 0 0 - /sys/fs/cgroup/systemd
pstore 0 0 0 - /sys/fs/pstore
bpf 0 0 0 - /sys/fs/bpf
cgroup 0 0 0 - /sys/fs/cgroup/memory
cgroup 0 0 0 - /sys/fs/cgroup/freezer
cgroup 0 0 0 - /sys/fs/cgroup/blkio
cgroup 0 0 0 - /sys/fs/cgroup/net_cls,net_prio
cgroup 0 0 0 - /sys/fs/cgroup/perf_event
cgroup 0 0 0 - /sys/fs/cgroup/cpuset
cgroup 0 0 0 - /sys/fs/cgroup/pids
cgroup 0 0 0 - /sys/fs/cgroup/cpu,cpuacct
cgroup 0 0 0 - /sys/fs/cgroup/rdma
cgroup 0 0 0 - /sys/fs/cgroup/devices
systemd-1 - - - - /proc/sys/fs/binfmt_misc
mqueue 0 0 0 - /dev/mqueue
hugetlbfs 0 0 0 - /dev/hugepages
debugfs 0 0 0 - /sys/kernel/debug
tmpfs 798M 12K 798M 1% /run/user/1011
fusectl 0 0 0 - /sys/fs/fuse/connections
tmpfs 798M 4.0K 798M 1% /run/user/109
tmpfs 798M 12K 798M 1% /run/user/1007
binfmt_misc 0 0 0 - /proc/sys/fs/binfmt_misc
tracefs - - - - /sys/kernel/debug/tracing
xrdp-chansrv 0 0 0 - /home/pavan.kaparthi/thinclient_drives
Last edited by pavank on 2020-07-14 01:09, edited 1 time in total.
pavank
 
Posts: 4
Joined: 2020-07-13 01:21

Re: Unable to see the allocated disk space to Debian VM

Postby pavank » 2020-07-13 06:01

Managed to find more info. I can see 15GB free space available, please see the below. Now I have to figure it out, how to extend primary boot partition /dev/sda1. If anyone know the process for extending extend primary boot partition /dev/sda1, please keep me posted.

~# fdisk -l
Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors
Disk model: Virtual disk
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x07e339b4

Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 6293503 6291456 3G 83 Linux
/dev/sda2 6295550 10483711 4188162 2G 5 Extended
/dev/sda5 6295552 10483711 4188160 2G 82 Linux swap / Solaris

Using cfdisk command:
Disk: /dev/sda
Size: 20 GiB, 21474836480 bytes, 41943040 sectors
Label: dos, identifier: 0x07e339b4

Device Boot Start End Sectors Size Id Type
>> /dev/sda1 * 2048 6293503 6291456 3G 83 Linux
/dev/sda2 6295550 10483711 4188162 2G 5 Extended
└─/dev/sda5 6295552 10483711 4188160 2G 82 Linux swap / Solaris
Free space 10483712 41943039 31459328 15G
Last edited by pavank on 2020-07-14 01:12, edited 1 time in total.
pavank
 
Posts: 4
Joined: 2020-07-13 01:21

Re: Unable to see the allocated disk space to Debian VM

Postby p.H » 2020-07-13 07:34

Disable the swap /dev/sda2 with swapoff -a

If you use gparted :
- move /dev/sda2 and /dev/sda5 to the end of the disk
- extend /dev/sda1

If you use parted :
- remove /dev/sda5 and /dev/sda2
- extend /dev/sda1 (resizepart), leaving enough space for a new swap partition
- create a new swap primary partition
- exit parted
- extend the filesystem in /dev/sda1 with the proper tool (resize2fs if ext4)
- format the new swap partition with mkswap -U <uuid_from_/etc/fstab>

Enable the swap with swapon -a
p.H
 
Posts: 1422
Joined: 2017-09-17 07:12

Re: Unable to see the allocated disk space to Debian VM

Postby pavank » 2020-07-13 10:30

Thanks for the reply P. H. Are they command line utilities or from any GUI based as there no GUI/desktop version has been installed. Will you be able to provide more info on how to do please?
pavank
 
Posts: 4
Joined: 2020-07-13 01:21

Re: Unable to see the allocated disk space to Debian VM

Postby p.H » 2020-07-13 12:25

Gparted is GUI-based. parted, mkswap, swapon, swapoff are command-line tools.
p.H
 
Posts: 1422
Joined: 2017-09-17 07:12

Re: Unable to see the allocated disk space to Debian VM

Postby pavank » 2020-07-14 01:03

Thanks P.H, used GParted and extended the primary partition, dev/sda1.
pavank
 
Posts: 4
Joined: 2020-07-13 01:21


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 3 guests

fashionable