Find the answer to your Linux question:
Results 1 to 5 of 5
Hi, I need help with creating new mount points in a VM (Virtual Machine) that has got RHEL6.5. This VM is installed on Windows 7 machine. Current VM configuration is ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2013
    Posts
    3

    How to create new mounts using space occupied by an existing mount


    Hi,

    I need help with creating new mount points in a VM (Virtual Machine) that has got RHEL6.5. This VM is installed on Windows 7 machine.

    Current VM configuration is as follows:

    Filesystem Type Size Used Avail Use% Mounted on
    /dev/mapper/vg_ampshritamd02v-lv_root ext4 50G 2.1G 45G 5% /
    tmpfs tmpfs 939M 0 939M 0% /dev/shm
    /dev/sda1 ext4 485M 66M 395M 15% /boot
    /dev/mapper/vg_ampshritamd02v-lv_home ext4 144G 22G 115G 16% /home

    As is evident, home mount consists of 144 GB's. I need to split this mount into 5 mounts so that at the end of it we have /home, /opt, /tmp, /var and /log mounts the total size of which is 144 GB's.

    Could someone please help me with this?

    Thanks and Regards,
    Gaurav Vikash.

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,391
    Hi and welcome

    I would probably just install a new VM with the desired partition layout and then copy config and data.
    This should be faster than resizing the filesystem, resizing the volume, adding new volumes, mounting them, etc
    The new install is also safer, as resizing filesystems and volumes on the existing vm can potentially wipe data.

    From a subscription perspective:
    Once the new vm is up and running, just unsubscribe the old vm and subscribe the new vm to the RedHatNetwork
    You must always face the curtain with a bow.

  3. #3
    Just Joined!
    Join Date
    Dec 2013
    Posts
    3

    How to create new mounts using space occupied by an existing mount

    Quote Originally Posted by Irithori View Post
    Hi and welcome

    I would probably just install a new VM with the desired partition layout and then copy config and data.
    This should be faster than resizing the filesystem, resizing the volume, adding new volumes, mounting them, etc
    The new install is also safer, as resizing filesystems and volumes on the existing vm can potentially wipe data.

    From a subscription perspective:
    Once the new vm is up and running, just unsubscribe the old vm and subscribe the new vm to the RedHatNetwork
    Hi Irithori,

    Thank you for the welcome and suggestion. Hugely appreciated. However, due to project and administrative constraints, I am not at the liberty of asking for the VM to be re-installed. Is there no way to resize the filesystem and volumes without losing data?

    Thanks and Regards,
    Gaurav Vikash.

  4. #4
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,391
    The general workflow is:
    - unmount /home
    - force a filesystem check on /dev/mapper/vg_ampshritamd02v-lv_home
    - reduce the filesystem size (resize2fs)
    - reduce the volume size (lvresize)
    - add new volumes (lvcreate)
    - create new filesystems (mkfs)
    - mount them
    - create mountpoint entries in /etc/fstab

    This approach *should* work. As in: Dataloss is not expected.
    However: There are quite heavy operations involved. So I would at the very least suggest to create a backup of your data.
    What you also or additionally could do is to create a snapshot of your vm before these operations.
    You must always face the curtain with a bow.

  5. #5
    Just Joined!
    Join Date
    Dec 2013
    Posts
    3

    Thank you

    Quote Originally Posted by Irithori View Post
    The general workflow is:
    - unmount /home
    - force a filesystem check on /dev/mapper/vg_ampshritamd02v-lv_home
    - reduce the filesystem size (resize2fs)
    - reduce the volume size (lvresize)
    - add new volumes (lvcreate)
    - create new filesystems (mkfs)
    - mount them
    - create mountpoint entries in /etc/fstab

    This approach *should* work. As in: Dataloss is not expected.
    However: There are quite heavy operations involved. So I would at the very least suggest to create a backup of your data.
    What you also or additionally could do is to create a snapshot of your vm before these operations.

    Thanks a lot for the response. I am gonna try these and would let you know how I got along.
    Have a great weekend and new year. Cheers mate.

    Thanks and Regards,
    Gaurav Vikash.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •