I would like to create virtual volume (partition) on my disk. I use VPS and I cannot shrink root partition and create new one.
So I decided to create a virtual volume on disk, let's say that I want to create virtual volume with size of 12 GB, how can I do it?
Next, is possible to automatically mount it after every reboot? How?
I wonder is there is any performance drop between real partition and virtual volume (like latency, etc..).
I use Debian 9 with ext4 file system.
I cannot shrink parition, because I cannot mount livecd (rescue disk), because my hosting provider has no option for it. So then i cannot boot into livecd to unmount filesystem to make changes to partitions.
i want that "partition", because in that partition users will be able to upload (using web app) some files, and I would like to limit size of that space/partition for example to 12 GB, so it never take more than 12 GB.
fallocate -l 7G dummy (to create big dummy file) inside mounted device and
Filesystem Size Used Avail Use% Mounted on udev 485M 0 485M 0% /dev tmpfs 100M 6.8M 93M 7% /run /dev/mapper/vg-lv_root 19G 1.2G 17G 7% / tmpfs 496M 0 496M 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 496M 0 496M 0% /sys/fs/cgroup /dev/sda1 236M 37M 187M 17% /boot /dev/loop0 12G 7.1G 3.9G 65% /srv/data tmpfs 100M 0 100M 0% /run/user/0
You can see, that it is mounted and it shows used space in /srv/data, but I wonder why it doesn't show used space on root partition (I have 20 GB SSD from provider, but
df -h shows that I have 32 GB (20 GB root and 12 GB mounted device). How can I see "real" used space in root partition? Because in root directory I have that data.img which has size of 12 GB, but it doesn't count as used space,
df -h showed used space, but after running
mkfs.ext4 it doesn't show anymore, do you understand me? :)
Another question: Should I run
dd if=/dev/zero of=data.img bs=1M count=12000 command?