Skip to content

Instantly share code, notes, and snippets.

@kasajian
Created May 20, 2014 04:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kasajian/e04aae63ece3a7cbed8a to your computer and use it in GitHub Desktop.
Save kasajian/e04aae63ece3a7cbed8a to your computer and use it in GitHub Desktop.
Linux / Ubuntu

Stuff to do after installing

How to mount the Windows host drive from within an Ubuntu

Assuming NAT is used, and the host port is 192.168.234.2, the host's 'C:' drive (i.e. using default share C$) is mounted to Ubuntu's folder /mnt/hostc

  • First create the mount point:

    mkdir /mnt/hostc chown zumaubuntu:zumaubuntu x

  • (note that you can really put this anywhere, and call it whatever you want)

  • zumaubuntu is the name the user in Ubuntu.

  • To just mount it once, you can issue the mount command like so: sudo mount -t smbfs -o uid=1000,gid=1000,username=ZumaWin,password=ZumaPass //192.168.234.2/c$ /mnt/hostc

  • This assumes:

  • zumaubuntu's uid and gid are 1000. If you don't know what these are, use the 'id' command at the terminal.

  • ZumaWin and ZumaPass is a Windows users who has Administrator access (since the C$ share is used)

  • However, to make the mount permanent, edit the /etc/fstab file and add to the bottom:

//192.168.234.2/c$ /mnt/hostc smbfs uid=1000,gid=1000,username=ZumaWin,password=ZumaPass

Grub rescue

If the computer is kicked into the grub rescue> prompt.

This information is from: https://help.ubuntu.com/community/Grub2#Command_Line_and_Rescue_Mode

  1. Type set

You should see where grub is looking to boot from

  1. Type ls

Shows you all the devices. Do an ls on each one, adding, /boot/grub to the end of the path, until you find the right one.

  1. Set prefix and root (substituting X and Y to that of the device that you found containing the boot/grub folder)

    set prefix=(hdX,Y)/boot/grub set root=(hdX,Y)

  2. If you do it right, then you should be able to type:

    insmod normal normal

  3. Boot into Linux and then type:

    sudo update-grub

  4. Then type this, replacing x with the boot device:

    sudo grub-install /dev/sdX

If you're not sure what the boot device is, run a disk utility in Linux. On my machine, it's /dev/sda

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment