Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Help me understand the LVM disk allocation, usage, and available size
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Help me understand the LVM disk allocation, usage, and available size

letrocksletrocks Member
edited March 2018 in Help

I just trying out a VPS from a provider where disk space is suppose to be 160GB with 32GB RAM. When I check the df and lsblk, I don't see how the disk allocated it used so much that only 147GB is left. Even after OS installation, I was hoping to have more disk space available.

My LVM understanding is very primitive. Can someone enlighten me how this match works?


# df -h
Filesystem                   Size  Used Avail Use% Mounted on
udev                          16G     0   16G   0% /dev
tmpfs                        3.2G   17M  3.2G   1% /run
/dev/mapper/ubuntu--vg-root  157G  2.6G  147G   2% /
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                    472M  202M  246M  46% /boot
tmpfs                        3.2G     0  3.2G   0% /run/user/0

# lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
NAME                FSTYPE        SIZE MOUNTPOINT LABEL
sda                               160G
├─sda1              ext2          487M /boot
├─sda2                              1K
└─sda5              LVM2_member 159.5G
  └─ubuntu--vg-root ext4        159.5G /

Comments

  • jackbjackb Member, Host Rep

    Ext4 reserved space?

  • letrocksletrocks Member
    edited March 2018

    @mikho tune2fs can't open /dev/sda5. It works fine on the /dev/sda1

    # tune2fs -l /dev/sda5
    tune2fs 1.42.13 (17-May-2015)
    tune2fs: Bad magic number in super-block while trying to open /dev/sda5
    Couldn't find valid filesystem superblock.
    

    But it worked on the /dev/mapper/ubuntu--vg-root
    Looking into now.

    I think that worked. Out of the box 5% blocks were reserved. So changing the reserved space percentage helped to reclaim the space. Now is it a good idea, remains to be seen.

    From the man page

    -m reserved-blocks-percentage
    Set the percentage of the filesystem which may only be allocated by privileged processes. Reserving some number of filesystem blocks for use by privileged processes is done to avoid filesystem fragmentation, and to allow system daemons, such
    as syslogd(8), to continue to function correctly after non-privileged processes are prevented from writing to the filesystem. Normally, the default percentage of reserved blocks is 5%.

  • mikhomikho Member, Host Rep

    On smaller disk it is better to have a larger percentage. But it is alot of ”wasted” space on larger drives.

Sign In or Register to comment.