Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VMware - redhat 6, properly removing a mounted drive, and remounting

Posted on 2015-01-02
4
Medium Priority
?
223 Views
Last Modified: 2015-02-20
/extra is 40GB. I need /extra to be /700GB

This is on a server running as a virtual.

I'm going to umount /extra
remove the entry in fstab

/dev/extra/extra                    /extra                    ext4    defaults        0 0

Then I'm going to shutdown the VM. Delete the 40GB drive. Recreate the drive with the new size 700GB

Then I'll turn back on the VM, and recreate /extra

The question is, are there other caveats to look out for, before I recreate /extra. Is there other things I need to remove in other locations on the redhat OS, before recreating /extra again?
0
Comment
Question by:Rambl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 35

Expert Comment

by:Seth Simmons
ID: 40527973
i assume that you don't need the data on /extra since you are creating a new one

not sure what virtualization you are using but in most cases shouldn't need to shutdown the guest to add/remove the disk
unmount, comment out fstab entry, remove the drive at the hypervisor level then add a new one, check fdisk as to the device name, partition, mount, modify fstab (if the name is the same, just uncomment)

alternatively, you can expand the virtual disk instead of removing and creating a new one and should be able to do hot (without unmounting or changing fstab)
0
 
LVL 16

Expert Comment

by:choward16980
ID: 40527975
Have a read here:

http://serverfault.com/questions/509468/how-to-extend-an-ext4-partition-and-filesystem



You must begin with the partition unmounted. If you can't unmount it (e.g. it's your root partition or something else the system needs to run), use something like System Rescue CD instead.

Run parted, or gparted if you prefer a GUI, and resize the partition to use the extra space. I prefer gparted as it gives you a nice graphical representation, very similar to the one you've drawn in your question.

resize2fs /dev/whatever

e2fsck /dev/whatever (just to find out whether you are on the safe side)

Remount your partition.

While I've never seen this fail, do back up your data first!

-------------------------------
               
The resize2fs man page says: If the filesystem is mounted, it can be used to expand the size of the mounted filesystem, assuming the kernel supports on-line resizing. (As of this writing, the Linux 2.6 kernel supports on-line resize for filesystems mounted using ext3 and ext4.). However, resizing a mounted filesystem is a more dangerous operation, since the kernel could easily freeze or crash while running rarely exercised code, leaving your filesystem in a bad state. –  200_success May 21 '13 at 15:12

-------------------------------
               
True -- but you don't want to be messing around with your partition table with the filesystem mounted. That's why I started with the fs unmounted. –  Flup May 21 '13 at 15:15
               
-------------------------------

For ext4, might be resize4fs instead on RHEL 5. –  Zac Thompson Sep 4 '14 at 20:04
0
 
LVL 35

Accepted Solution

by:
Seth Simmons earned 1500 total points
ID: 40527981
oops, just noticed the title again with vmware
in that case, you can extend the disk then continue as i mentioned earlier with unmounting and resizing with resize2fs (though it can be done while mounted)

here is the RHEL 6 documentation:

Resizing an Ext4 File System
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/ext4grow.html
0
 
LVL 62

Expert Comment

by:gheist
ID: 40528162
First you need to add some physical partitions to to VG named "extra", then you can expand the volumes.
Extending existing disk is quite useless as you must unmount anything on that disk (and use mini installer DVD to partition where /root and /boot are) to add new space to a VG in form of LVM-type partitions.

Only thing that works on the flu is = add new disk, make LVM partition, add to VG, expand.
Rest involves unmounts.
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question