9

so this is the situation:

I had this hardDrive of 500GB, on my server and tried to upgrade it to a 2T HardDrive,

after the upgrade result of lsblk has changed while df still returns same results.

df -h:

/dev/xvdf6      493G  472G     0 100% /root/external


lsblk:

xvdf6 202:86   0     2T  0 disk /root/external

so why the size of the drive is different if I use lsblk vs df commands?

I'm doing some heavy processing, and data in harddrive will go over 500GB, so what happens then?

nafas
  • 519

2 Answers2

8

The block device is now 2TB, but the filesystem still has its old size. You need to resize it, e.g. using resize2fs - increasing size can be done online.

The steps are these (assuming this is the last partition on the block device):

  • First use fdisk or friends to extend the partition,
  • then use the resize tool for your file system (resize2fs for ext{2,3,4}) to resize the file system.

You don't need to stop your processes, if you use a file system, that can grow online (such as ext{2,3,4} or ocfs2)

Eugen Rieck
  • 20,637
2

Additional info, when you resizing using resize2fs you face this kind of error

$ resize2fs /dev/yourpartition
...
resize2fs: Read-only file system While checking for on-line resizing support

You need to remount it and do it again

$ mount -o remount /dev/yourpartition
$ resize2fs /dev/yourpartition
...
The filesystem on /dev/yourpartition is now 976562 (4k) blocks long.

reference here