I added a new disk (/dev/vdb
) of 2TB with existing data from the previous 1TB disk.
I used fdisk /dev/vdb
to extend its only partition /dev/vdb1
to full capacity of 2TB from previous 1TB. (In other words, I deleted vdb1, and then re-created it to fill the disk. See How to Resize a Partition using fdisk - Red Hat Customer Portal).
And then I did:
[root - /]$ fsck -n /dev/vdb1
fsck from util-linux 2.23.2
e2fsck 1.42.9 (28-Dec-2013)
/dev/vdb1: clean, 46859496/65536000 files, 249032462/262143744 blocks
[root - /]$ e2fsck -f /dev/vdb1
e2fsck 1.42.9 (28-Dec-2013)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/vdb1: 46859496/65536000 files (0.4% non-contiguous), 249032462/262143744 blocks
[root - ~]$ resize2fs /dev/vdb1
resize2fs 1.42.9 (28-Dec-2013)
The filesystem is already 262143744 blocks long. Nothing to do!
And fdisk -l
looks like this:
Disk /dev/vdb: 2147.5 GB, 2147483648000 bytes, 4194304000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x4eb4fbf8
Device Boot Start End Blocks Id System
/dev/vdb1 2048 4194303999 2097150976 83 Linux
However when I mount it:
mount /dev/vdb1 /mnt
This is what I got from df -h
:
/dev/vdb1 985G 935G 0 100% /mnt
Which is still the size of the previous partition.
What am I doing wrong here?
UPDATE
I ran partprobe
and it told me to reboot:
Error: Error informing the kernel about modifications to partition /dev/vdb1 -- Device or resource busy. This means Linux won't know about any changes you made to /dev/vdb1 until you reboot -- so you shouldn't mount it or use it in any way before rebooting.
Error: Failed to add partition 1 (Device or resource busy)
So I rebooted and then ran this again:
mount /dev/vdb1 /mnt
But the added file system is still:
/dev/vdb1 985G 935G 0 100% /mnt
Any ideas? Should I do all the fsck
, e2fsck
, and resize2fs
once again?
This is really weird. After the reboot, I ran partprobe
again and it was still this error:
Error: Error informing the kernel about modifications to partition /dev/vdb1 -- Device or resource busy. This means Linux won't know about any changes you made to /dev/vdb1 until you reboot -- so you shouldn't mount it or use it in any way before rebooting.
Error: Failed to add partition 1 (Device or resource busy)
Why is the device or resource busy? Even after I rebooted?