Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

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

share|improve this answer
    
Thanks!............ –  Midhat Jan 18 '12 at 11:28
add comment

"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.

share|improve this answer
    
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 '12 at 20:42
    
This post unfortunately doesn't answer my question in its current state –  Midhat Jan 17 '12 at 20:42
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.