Search This Blog

Friday, April 10, 2009

Setting up Dual Boot Ubuntu / Windows OS-

Setting up Dual Boot
Im setting up a dual boot OS at work. This is a mixture of Windows XP and Ubuntu .... or to be more precise Xubuntu as its Ubuntu with an XFCE4.4 Windows Manger. What follows is some of the stuff that Ive learnt as Ive gone along.

Partitioning / Mounting / Un-mounting
After installing everythign one of the things I needed to do was set up some mounts for the partitions. I ended up with the following partitions on a 300Gig Hard Drive:

  1. 50 GB Windows NTFS Partition - Windows XP OS installed on this. Having 50GB meant that not only could I put the OS there but Id have a good 45GB left over to install various apps there (ie: development tools for my job)
  2. 48 GB Linux / XUbuntu ext3 Partition - this was the XUbunut OS install partiton which was done with the same ideas in mind as the Windows one above. ie: enough to instal lthe OS and then have another 45GB of free space left over to put all my bits and bobs in.
  3. 2GB Linus Swap Partition - The reasons I used the odd 48GB above and not 50GB was so tyhat I could assing 2GB to swap space (this was on the advice of my works MIS department so who am I to argue with people who do this for a living :-) )
  4. 200GB NTFS Partition - So what was left was 200GB of space which I formatted as NTFS filesystem and am going to use this as my data storage area. ie: an area that will be accessible by both Windows and Linux and will be where I store data in. Applications will be run from the OS partition but storage will occur here and hence the largish 200GB partition.
So I now had to set this up. The actual partitions where set up during the installation of Ubuntu but as I logged in I noticed that all I could see was the 48GB Linux partition. Hmmm....I used a tool called GParted:

sudo apt-get install gparted

which is able to provide a graphical view of the partition and allow you to mount/unmount etc. On start up this tool complained that it couldn't mount two partitions called 50GB Volume and new Volume respectively.

So first I had a look at the /etc/fstab and /etc/mtab files. These show the volumes to auto mount on startup and the volumes currently mounted an in these cases neither one had my missing partitions.

Next I attempted to mount the storage data partition figuring that since it was empty I was less likely to cause any damage if I did something wrong. I wanted to see what my partitions were called and any other info about them so had a look at :

ls -la /dev/disk/by-uuid/
ls -la /dev/disk/by-id/
ls -la /dev/disk/by-label/
ls -la /dev/disk/by-path/

which allows me to see what the partitions are named that are available. Well it turns out my partitions are at:


with the sda1 and 2 being my windows and data partitions. Okay. So next i attempted to do:

mkdir /mnt/windows
mount /dev/sda1 /mnt/windows

to show myself that yes, I can actually mount the directory. At this stage I was ready to update the /etc/fstab file so that in the future my partitions where auto-mounted. My addition to the fstab file was as follows (the following is a cat /etc/fstab with the last few lines being the new ones):

# /etc/fstab: static file system information.
proc /proc proc defaults 0 0
# /dev/sda4
UUID=fffe5c7d-2046-4254-a5b5-5433508d4732 / ext3 relatime,errors=remount-ro 0 1
# /dev/sda3
UUID=725ec9c9-88a9-45f3-a7b9-01a96db36c64 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
# /dev/sda1 and /dev/sda2 are both ntfs FS's with them being windows boot partition and 200Gig data store respectively
# - could also use LABEL=DATA cos ive set the LABEL to DATA for /dev/sda2 using ntfslabel, ie: ntfslabel LABEL DATA
# - blksize=4096 is added to the end by default when mount -a is run
# - sda1 uses type ntfs and ro so that the windows partiton can be read but not written to (for safety there should be no reason to write to it)
# - sda2 uses type ntfs-3g and rw so that the data partition can be written to and it also becomes fuseblk on mount -a (which is default and normal)
# - Note: the idea is windows and linux partitions can write to the /mnt/data partition BUT not to each other, hence ro and rw options
# - not sure about relatime use (perhaps atime with its performance hit would be better)
/dev/sda1 /mnt/windows ntfs auto,nodev,exec,suid,ro,user,uid=mkopka,gid=mkopka,allow_other,utf8 0 0
/dev/sda2 /mnt/data ntfs-3g auto,nodev,exec,suid,rw,user,uid=mkopka,gid=mkopka,allow_other,relatime,utf8 0 0

with the last two lines being the important ones that perform the mount. The comments provide info on what the options mean and why I selected them/

And there you go, I have now got auto mounted partitions. By running:

sudo mount -a

I was able to now mount the two new partitions.

No comments:

Post a Comment