> dd if=/dev/zero of=sparse_file bs=1 count=0 seek=512M You can see an example of this from within WSL with the following: > cd ~ When empty, a sparse disk will actually take up 0 bytes on the host drive. However, externally what is really being used is entirely different. That means that internally, it appears at it's maximum size (250GB in this case). WSL2 allocates what is known as a "sparse" virtual disk. So far I haven’t had any issues with dynamically extending the partitions and I’m getting a lot less Zenoss notifications about lack of free space.Well here's the good news - You didn't accidentally allocate 250G to WSL. It seems like there are a lot of steps to this process, but it’s actually pretty quick and easy if you can afford to restart your server. You can now run the df command to verify that you have more space–df -h. You can finally expand the ext3 file system in the logical volume using the command resize2fs /dev/volgroup/volume (ex: resize2fs /dev/vg_root/lv_root).(ex: lvextend -L+20G /dev/vg_root/lv_root) Extend the logical volume by the amount of free space shown in the previous step by typing lvextend -L+G /dev/volgroup/volume.To find the amount of free space available on the physical volume type vgdisplay | grep “Free”.In Figure C, the name of the volume group is vg_root. First type df -h to find the name of the volume group. Now you’ll add the physical volume to the existing volume group using the vgextend command.You need to initialize this new partition as a physical volume so you can manipulate it later using the Logical Volume Manager (LVM).You’ll notice another partition is present. If you want it to take up the rest of the space available (as allocated in step 4), just choose the default value for the last cylinder.So I chose 2611 for my first cylinder, which is also listed as the default. Now you’ll be prompted to pick the first cylinder which will most likely come at the end of your last partition (ex: /dev/sda3 ends at 2610).
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |