Support Wikipedia

Monday, July 6, 2009

Mounting windows partition at bootup in Ubuntu

I have a dual booting linux system at work. I share the java projects (located on the windows partition) on both windows and Linux. But when I launch eclipse, all the projects show up closed since the windows partition is not mounted yet. The solution to this is to mount windows partition at boot up time.

To mount a windows partition at startup, you need to do the following.
- get the UUID of the device

/dev/sda1: UUID="9044866844865140" TYPE="ntfs"
/dev/sda2: LABEL="GHOST DATA" UUID="FCF8-3D81" TYPE="vfat"
/dev/sda5: UUID="b2293182-981b-4291-96ff-dba50f73510d" TYPE="ext3"
/dev/sda6: TYPE="swap" UUID="1d3b683c-c559-43e2-ac46-f3500e27dbfd"
- create an entry in /etc/fstab file for the windows NTFS drive
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
UUID="9044866844865140" /media/disk ntfs-3g defaults,locale=en_US.utf8 0 0
Instead of UUID specifying the device also works. see below
/dev/sda1 /media/disk ntfs-3g defaults,locale=en_US.utf8 0 0 
Note : both ntfs and ntfs-3g works fine for a windows partition.

The options for fstab are clearly explained in the ubuntu help docs here.

1 comment:

  1. The benefit to using a UUID is that there is an absolute pointer to the partition that you intend to mount. If you alter which (or the order) drives are connected, or you alter partitions, it is possible that the specified device no longer points to the partition you intended to mount. I actually ran into this situation once, and was glad that I used UUIDs. Since my MBR partition was still the same, Linux mapped all the other rearranged partitions correctly by UUID.