0

Is there any way to remove free space of a partition ?
I want to build embedded os and i created disk image with dd command and patition this disk with fdisk .

my problem is , disk size is too big , I wan to create fixed size partition .
I mean my operating system rootfs is for example 200M and size of partition is for example 210M . How to remove 10M free space of this partition ?

mah454
  • 308
  • 1
    Note that the usable size of a filesystem will always be somewhat smaller than the actual space it occupies on the disk, as the filesystem itself needs some space for filesystem metadata. You should use filesystem-specific tools to verify the total size of the filesystem: e.g. if the filesystem is ext2/ext3/ext4, use tune2fs -l and multiply the Block count value with Block size to get the exact size the filesystem occupies on its partition in bytes. – telcoM Mar 04 '19 at 08:31
  • Also, the ext2/ext3/ext4 filesystems by default reserve some small percentage of their space for root's use only, so that critical system processes could keep working even if a regular user manages to fill the filesystem to 100%. If the value of 200M was reported by df, most of the discrepancy between that and the partition size of 210M might be because of this. – telcoM Mar 04 '19 at 08:33

0 Answers0