Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 3277  / 2 Years ago, sat, october 8, 2022, 9:11:50

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?


More From » 11.10

 Answers
6

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


[#40899] Monday, October 10, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tusmuumu

Total Points: 195
Total Questions: 122
Total Answers: 104

Location: Oman
Member since Tue, Feb 7, 2023
1 Year ago
;