1

How do I mount a vmware vmdk file as /home on startup?

I have been using Ubuntu as a VMWare Guest. All My data resides on a single vmdk disk, which I mounted as /home in the VM using fstab. Now I want to move to an actual Ubuntu installtion for performance reasons (Installed with wubi under windows 7). I can mount my vmdk to a folder using vmware-mount (I have vmware server), but how do I go about mounting it to /home on startup?

2 Answers 2

4

Make the command you use to mount your disk, part of a bash script named say, customMount.sh. An example of such a script is:

#!/bin/bash
# File: customMount.sh
# Description: Mounts a partition on startup
sudo mount /dev/sda1 /home

Above script will mount /dev/sda1 (first physical partition on sda) to /home. Note: Replace it with your vmware-mount command.

Then run following commands:

  1. Make customMount.sh executable
    sudo chmod +x customMount.sh

  2. Copy to /etc/init.d
    cp customMount.sh /etc/init.d/

  3. Change directory to /etc/rc5.d/ and make a link to the script as:
    cd /etc/rc5.d
    ln -s ../init.d/customMount.sh S20customMount.sh

  4. Similarly, make another link in rc2.d as:
    cd /etc/rc2.d
    ln -s ../init.d/customMount.sh S20customMount.sh

Reboot Ubuntu and verify if the mounting is done by executing ls /home

0
3

"For performance reasons" -- then you don't want to be mounting it via vmware-mount. Instead, transfer the files out of the vmware image file to /home.

2
  • Yes I understand that. I still get a major improvement when I am running ubuntu as the only OS. and I need to keep the vmdk to take on the road and sometimes when I quickly need to do something in ubuntu and I'm in windows
    – Midhat
    Jan 17, 2012 at 20:42
  • This post unfortunately doesn't answer my question in its current state
    – Midhat
    Jan 17, 2012 at 20:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .