1

I'm using Xubuntu 17.04.

I'm having a problem where I'm trying to copy a partition (using Gparted) to a larger hard drive that's going to replace the one I'm copying from. The copy works fine but then when I got to resize the partition to fill the extra space of the new drive it also grows the size of the used data proportionally. To be specific the size of the old and new drives (respectively) are 931.51GB and 5.46TB. The used data grows from 15.79GB to 88.86GB after the resize.

Any idea why this is happening?

  • 1
    No, the data doesn't "grow". If you had 10 pictures on the old partition, you will not have 50 pictures on the new one. – mikewhatever Jul 14 '17 at 17:22
  • 1
    There are metadata (that are used to manage the file system in the partition), and the file system will need more metadata in a larger partition. – sudodus Jul 14 '17 at 17:26
  • @sudodus your comment should be an answer! – George Udosen Jul 16 '17 at 19:06
1

This is just a guess, but it could be that the reserved space is what's growing, at least in part. Many Linux filesystems, including the Ubuntu default of ext4fs, enable setting aside a proportion of the filesystem (5% by default, IIRC) for use by root. The idea is that, if ordinary users fill a partition with files, root can log in and still create files in a repair attempt.

That said, 5% of 5.46 TB is 273 GB, whereas the observed "used" space is much less than that, at 89 GB. Thus, if this is what's happening, the reserved space must be much less than the default, or I'm not remembering the default value correctly.

Providing details of how you're determining the used space might be helpful. For instance, are you reading this off of GParted's window, using df, etc. Sometimes tools will give wildly different estimates because they're measuring different things, so knowing which tools are providing the estimates will tell those who are familiar with the tools what's going on.

0

Metadata

There are metadata (that are used to manage the file system in the partition), and the file system will need more metadata in a larger partition.

You get a hint of what kinds of metadata there are, when you read the manual

man mkfs.ext4

describing options for an ext4 file system, but other file systems have similar metadata, at least some of the metadata.

The following paragraphs describe some aspect of the metadata. Usually you need not worry about these options, you can use the standard settings of the file system, and it will work. As described in the manual, the size of the metadata will vary with the size of the partition and file system.

About metadata

   packed_meta_blocks[= <0 to disable, 1 to enable>]
         Place the allocation bitmaps and the inode table at the beginning
         of the disk.  This option requires that the flex_bg file  system
         feature to be enabled in order for it to have effect, and will
         also create the journal at the beginning of the file system. This
         option is useful for flash devices that use SLC flash  at  the
         beginning of the disk.  It also maximizes the range of contiguous
         data blocks, which can be useful for certain specialized use
         cases, such as supported Shingled Drives.

   -i bytes-per-inode
          Specify  the  bytes/inode  ratio.   mke2fs  creates an inode for
          every bytes-per-inode bytes of space on the  disk.   The  larger
          the  bytes-per-inode  ratio,  the  fewer inodes will be created.
          This value generally shouldn't be smaller than the blocksize  of
          the  filesystem,  since  in  that case more inodes would be made
          than can ever be used.  Be warned that it  is  not  possible  to
          change  this  ratio  on  a filesystem after it is created, so be
          careful deciding the correct value  for  this  parameter.   Note
          that  resizing a filesystem changes the numer of inodes to main‐
          tain this ratio.


   -N number-of-inodes
          Overrides the default calculation of the number of  inodes  that
          should  be  reserved  for  the filesystem (which is based on the
          number of blocks and the bytes-per-inode  ratio).   This  allows
          the user to specify the number of desired inodes directly.

   -j     Create the filesystem with an ext3 journal.  If the -J option is
          not specified, the default journal parameters will  be  used  to
          create  an  appropriately  sized  journal (given the size of the
          filesystem) stored within the filesystem.  Note that you must be
          using  a kernel which has ext3 support in order to actually make
          use of the journal.

Not metadata, but depending on the size of the file system

   -m reserved-blocks-percentage
          Specify the percentage of the filesystem blocks reserved for the
          super-user.   This  avoids  fragmentation, and allows root-owned
          daemons, such as syslogd(8), to continue to  function  correctly
          after non-privileged processes are prevented from writing to the
          filesystem.  The default percentage is 5%.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.