Sunday, February 19, 2012

Add a VirtualBox Disk to Linux

I've started to play around with linux in VirtualBox.  I'm going to start posting things I find useful, since I'm a Windows man by trade.  This is the first:

I was adding a new VirtualBox disk for my data (so I can keep the OS/programs seperate from my personal stuff).  Here's how I did it.
  1. Create the disk in the VirtualBox GUI.
  2. Format the disk in Linux: 
    1. Find the disk (probably /dev/sdb or some such path): fdisk -l
    2. Format the disk: fdisk /dev/sdb
  3. Edit the fstab to mount the disk where you want it:
    • /dev/sdb /home/david                                ext2    defaults        0 0
    • Note that I mounted to my home directory, so I need to move my existing home dir (which has all the crappy Windows type folders) and then create it again so that the mount can find the folder.
  4. Remount: mount -a
  5. EDIT 2012-02-19: Copy all of the .* files from the old user dir to the new one.
  6. Done! (I think, I'm new at this)

1 comment:

  1. Hi David Faivre,

    I need your help, i try to implement your HashFoo.Nhib.Spatial but cannot find any documentation about that.

    I really hope that ypu can help me, Regards
    Antonio Ramos