[LBo] Multiple Partitions
Anita Lewis
A.Lewis at linuxbasics.org
Fri Aug 4 21:19:19 CEST 2006
On 08/04/2006 02:49 PM Amend, Bob wrote:
> I recently changed over from Windows to Ubuntu. It was relatively
> painless but the learning curve was steeper than I thought. One
> question I had at the outset was what to do with my 200 gb hard drive
> that
> Ubuntu resides. I tried to break it up into 4 partitions but could not
> figure out how to mount the individual partitions. I tried a lot of
> things but could not modify my /etc/fstab file to have my individual
> partitions recognized. How can I do this? This is important because I
> don't want to lose all my music and pictures if the drive craps out or
> gets corrupted.
>
> Please help.
>
> Bob
>
The general idea is to make an empty directory on your system which you
want to "fill" with the partition in question. Then you mount that
partition on that directory. You can put a line in /etc/fstab which
will allow this mounting to happen at boot time or by root or a user
after boot time. Here are some samples from my /etc/fstab:
------------------
/dev/hda8 /home ext2 defaults 1 1
/dev/hda9 /home/ajlewis2/Documents ext2 defaults 1 1
/dev/hda2 /home/ajlewis2/win ext2 defaults 1 1
/dev/hda1 /win2 ntfs
users,exec,suid,dev,ro,noauto,umask=000 0 0
-----------------
The first line is for partition /dev/hda8 to be mounted on the directory
/home. /home is a directory that is created during installation. In
this case I have chosen to use a separate partition for it.
The second line is allowing /dev/hda9 to be mounted in my users
directory. I created a directory named Documents. The line in
/etc/fstab causes /dev/hda9 to now appear as the Documents directory in
my user directory.
The third one is similar to the second. It is also mounted at boot. It
is the one that I can look at as user and also look at it when I'm in
Windows using a driver that allows that.
The last has a directory called win2 and it is not in my user directory
but up in the / directory. I show it here as one that has 'noauto' in
it. It is not mounted at boot, but can be mounted and unmounted by any
user (the users option allows that).
ext2 and ntfs are the filesystem types. Your filesystem may be ext3 or
reiserfs. You will need to adjust your line accordingly.
Note also that I have the line to mount /home prior to the one that
mounts /home/ajlewis2/Documents. /home has to be mounted first since
Documents is on that partition.
I recommend that you copy /etc/fstab as a backup first, just in case it
gets messed up. This file is critical for a proper boot. But if you
are just adding a line that should be fine. If you put the new line in
at the end, do not put a newline character at the end of the line. A
blank line at the end of /etc/fstab will cause it to fail to work.
Anita
More information about the QnA
mailing list