/usr is at 90% full
Basically my /usr area (/dev/cciss/c0d0p6) is at 90% full. I have about 5gb currently allocated to that partition. Fortunately, I still have about 30gb of unallocated space on the device where /usr resides. That being said, I would like to allocate an additional 5gb to /usr. Does anyone know the best approach to do this?
Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes
255 heads, 63 sectors/track, 8920 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/cciss/c0d0p1 * 1 13 104391 83 Linux
/dev/cciss/c0d0p2 14 650 5116702+ 83 Linux
/dev/cciss/c0d0p3 651 2435 14338012+ 82 Linux swap / Solaris
/dev/cciss/c0d0p4 2436 8920 52090762+ 5 Extended
/dev/cciss/c0d0p5 2436 3455 8193118+ 83 Linux
/dev/cciss/c0d0p6 3456 4092 5116671 83 Linux
/dev/cciss/c0d0p7 4093 4729 5116671 83 Linux
/dev/cciss/c0d0p8 4730 5239 4096543+ 83 Linux
Responses
Hello Brett!
Are there any unused partitions? As I can see from your "fdisk" output there are plenty of partitions on your hard drive.
I don't know what you're exactly meaning with the 30 GB of remaining capacity. Is there storage unassigned to any partition? Or is it assigned to an unused parition?
If there is an unused partition it would be one possibility to merge it with your /usr partition to get more capacity. Another possibility is to delete another partition and expand your /usr partition. If you have 30 GB unassigned to any partition remaining the best approach would be to use a tool like gparted from a live CD to resize the /usr partition - this needs a downtime.
Basically it would have been the best to choose LVM when partitioning the hard drive. The big benefit of LVM is to resize partitions and file systems dynamically on your needs - online, of course. ;-)
Is it a productive or a test server? I personally would highly recommend using LVM instead of classical partitioning.
Best regards,
Christian.
I think the best solution in that case would be:
- create a additional partition (can be done easily with the live DVD and gparted)
- format the additional partition with your favourite file system
- mount it as /mnt/temp or something like this
- rsync / cp --preserve=all the data from your "old" /usr to the new /usr
- edit your /etc/fstab to use the new partition as /usr (so you don't have to format/delete the old partition)
- reboot the system to see if everything's working fine
Remember: this operation needs server downtime - you need a RHEL live DVD to do this.
Good luck!
Best regards!
Silly question, but, "do you have any capability of breaking that mirror and presenting the underlying devices directly to your RHEL system as individual disks"? If so, then what you could do is:
- boot off one half the mirror
- Redo the other disk as an LVM-managed device - replicating your current partitioning scheme to it via LVs.
- Set the LVM-managed drive to be your primary mirror half and resilver to the disk you booted off of in step one
Once you've re-established your hardware-level mirror, the device your OS is booted from will be LVM-controlled, allowing you to dynamically resize filesystems annd volumes to your heart's content.
Hi Bret,
This works until your /usr or whatever filesystem grows to more then half the space left on disk. LVM does not have this disadvantage, for it does not need to copy all the data on the filesystem. It just extends "the filesystem structure".
I would recommend to switch to LVM the next time you have to reinstall this system e.g. when upgrading the RHEL 7.
Kind regards,
Jan Gerrit Kootstra
Nice work Brett. It seems like you were caught in quite a predicament and came up with an acceptable work-around. Like Jan mentioned, LVM is definitely the way to go. I'll actually be surprised if "slices" will even be an option in coming releases.
I wish I had noticed this thread previously. You could have (and probably stlil could, if you rolled back what you just did)... created that new partition as an LVM slice.
partition your drive and toggle the new partition to be LVM (8e I believe)
pvcreate /dev/cciss/c0d0p9
vgcreate /dev/cciss/c0d0p9 vg_hostname
lvcreate -n lv_usr -L10GB vg_hostname
mkfs /dev/mapper/vg_hostname-lv_usr
mount /dev/mapper/vg_hostname-lv_usr /newusr
Then... when you need more space in /usr
pvdisplay /dev/cciss/c0d0p9 | grep Free
lvresize -L+5G /dev/mapper/vg_hostname-lv_usr
resize2fs /dev/mapper/vg_hostname-lv_usr
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
