Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

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

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
pavank
Posts: 8
Joined: 2020-07-13 01:21

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

#1 Post by pavank »

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: 8
Joined: 2020-07-13 01:21

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

#2 Post by pavank »

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.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

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

#3 Post by p.H »

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

pavank
Posts: 8
Joined: 2020-07-13 01:21

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

#4 Post by pavank »

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?

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

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

#5 Post by p.H »

Gparted is GUI-based. parted, mkswap, swapon, swapoff are command-line tools.

pavank
Posts: 8
Joined: 2020-07-13 01:21

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

#6 Post by pavank »

Thanks P.H, used GParted and extended the primary partition, dev/sda1.

Post Reply