Solved

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

Posted on 2015-01-02
4
213 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 500 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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses

630 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