Sample Header Ad - 728x90

Truncate expand doesn't seem to work

0 votes
1 answer
1080 views
I just expanded my 1GB "homefile" which is mounted to /home/user by another GB using truncate -s +1G homefile. While it changed the size of homefile shown with df to 2GB, when mounted it is still only 1GB. Am I missing something? I don't have to use mkfs.etx4 again, do I?.. as that would wipe the data and defeat the purpose of me using truncate over fallocate, with which I have to use resize2fs after expanding, but doesn't change the data. I tried using resize2fs after truncate, but it had an error in the filesystem type (I'll have to reboot my VM if that is pertinent). If there is no way for me to expand with truncate, is there another way to mount a dynamically expanding file? I know qcow2 can do that, but it seems a little heavy-handed for this. I'm aware of squashfs in things like PuppyOS and PorteuOS, but it had more steps involved to set up when I looked. I like the simplicity of truncate if it will work.
Asked by alchemy (757 rep)
Apr 10, 2022, 04:47 AM
Last activity: Sep 9, 2023, 08:32 AM