Skip to contentSkip to conversation

How to Resize Partition

DISCUSSION Scott Moseman 4 participants 4 messages Feb 12, 2008 Device mapper

lore
Share & tools
lore
#0 lore raw

This is the original size of my partition, 50GB...

# df -h | grep mpath
/dev/mapper/mpath0p1   50G  2.1G   45G   5% /san

I increased it to 60GB and am trying to resize. Through my troubleshooting and various attempts, I've increased /dev/sdb1 (NIC), /dev/sdc1 (HBA) and /dev/mapper/mpath0p1 (MPIO).

Disk /dev/sdb: 64.4 GB, 64424509440 bytes
/dev/sdb1 1 61440 62914544 83 Linux

Disk /dev/sdc: 64.4 GB, 64424509440 bytes
/dev/sdc1 1 61440 62914544 83 Linux

Disk /dev/mapper/mpath0: 64.4 GB, 64424509440 bytes
/dev/mapper/mpath0p1 1 61440 62914544 83 Linux

I unmount/mount, reboot, etc and the mounted partition keeps showing up as 50GB. How do I get my additional 10GB? This is on a CentOS 4.5 server.

Thanks,
Scott

#1 lore raw
Quoted 3 lines

I unmount/mount, reboot, etc and the mounted partition keeps showing up as 50GB. How do I get my additional 10GB? This is on a CentOS 4.5 server.

I suggest to run LVM on top of whole mpath disk and not use partitions. In any case, peraphs you need to run "kpartx -a" and then extend filesystem with 'ext2online'.

--
DV

#2 lore raw
In reply to Scott Moseman
Quoted 4 lines · Scott Moseman

This is the original size of my partition, 50GB...

# df -h | grep mpath
/dev/mapper/mpath0p1   50G  2.1G   45G   5% /san

50G is the size of the mounted filesystem, not related to the block device

Quoted 5 lines

I increased it to 60GB and am trying to resize. Through my troubleshooting and various attempts, I've increased /dev/sdb1 (NIC), /dev/sdc1 (HBA) and /dev/mapper/mpath0p1 (MPIO).

Quoted 9 lines

Disk /dev/sdb: 64.4 GB, 64424509440 bytes
/dev/sdb1 1 61440 62914544 83 Linux

Disk /dev/sdc: 64.4 GB, 64424509440 bytes
/dev/sdc1 1 61440 62914544 83 Linux

Disk /dev/mapper/mpath0: 64.4 GB, 64424509440 bytes
/dev/mapper/mpath0p1 1 61440 62914544 83 Linux

Here are the block device size, not related with the filesystem mounted on top of it.

Quoted 3 lines

I unmount/mount, reboot, etc and the mounted partition keeps showing up as 50GB. How do I get my additional 10GB? This is on a CentOS 4.5 server.

You increased the block device size, but not the filesystem. You only have to modify the filesystem to take the extra room added into account.
You didn't mentionned what FS you use. For ext2/3 see tune2fs; for reiserfs see resize_reiserfs; for XFS (highly recommended! for this kind of usage, except if you are using a cluster FS) use xfs_growfs.

Anyway, the device-mapper is aware of the new size (because acting at the block-level), but no dm tool can do anything on data (filesystems) above the block layer.

For cluster filesystems, you have to check the docs because you cannot modify a filesystem without any locking management (or else you will cause a big mess in your data). Or maybe you will have to unmount the device to do that.

Gabriel

#3 lore raw
In reply to Scott Moseman

Maybe you're confusing the /san filesystem size with its partition's new size?
Assuming the /san fs is ext2 or ext3, make the old /san fs aware of its partition's enlarged size by doing these:
umount /san
e2fsck -f /dev/mapper/mpath0p1
resize2fs /dev/mapper/mpath0p1
mount /dev/mapper/mpath0p1 /san
df -h /san

--------------------------------------------------------
This e-mail, including any attachments, may be confidential, privileged or otherwise legally protected. It is intended only for the addressee. If you received this e-mail in error or from someone who was not authorized to send it to you, do not disseminate, copy or otherwise use this e-mail or its attachments. Please notify the sender immediately by reply e-mail and delete the e-mail from your system.

-----Original Message-----

From: [email protected] [mailto:[email protected]] On Behalf Of Scott Moseman
Sent: Tuesday, February 12, 2008 10:31 AM
To: device-mapper development
Subject: [dm-devel] How to Resize Partition

This is the original size of my partition, 50GB...

# df -h | grep mpath
/dev/mapper/mpath0p1   50G  2.1G   45G   5% /san

I increased it to 60GB and am trying to resize. Through my troubleshooting and various attempts, I've increased /dev/sdb1 (NIC), /dev/sdc1 (HBA) and /dev/mapper/mpath0p1 (MPIO).

Disk /dev/sdb: 64.4 GB, 64424509440 bytes
/dev/sdb1 1 61440 62914544 83 Linux

Disk /dev/sdc: 64.4 GB, 64424509440 bytes
/dev/sdc1 1 61440 62914544 83 Linux

Disk /dev/mapper/mpath0: 64.4 GB, 64424509440 bytes
/dev/mapper/mpath0p1 1 61440 62914544 83 Linux

I unmount/mount, reboot, etc and the mounted partition keeps showing up as 50GB. How do I get my additional 10GB? This is on a CentOS 4.5 server.

Thanks,
Scott

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel