Skip navigation.

SERVER : Adding a new hard disk.

, , , , , , , ,

Next step, after I've installed the server is to add a new hard disk, in my case a 20Gb HDD.

I've partitioned the HDD into 2 partitions, one 8Gb and the other ~11Gb both Ext3. You might want to partition it as Fat32 since that's compatible both with Linux and Windows. I thought I'm going to access the hard disk only trough the server or trough SAMBA and as such it shouldn't make a difference in what kind of partition it has. Of course, I might be wrong and I might have to change that at a later date p:

Anyways, in order to access the new hard disks partitions, after I've rebooted the server (:idea: I hope you dd shut down the computer before installing the HDD and didn't try to install it while the server was still running :wink: ) i had to add the partitions to the FSTAB file, this file tells Linux what can be mounted, where and how.

So, first of all, make 2 folders where you'll mount the 2 new partitions. I made /mnt/c and /mnt/d.
This is how i've done it :
sudo mkdir /mnt/c
sudo mkdir /mnt/d
sudo chown my_user_name /mnt/c
sudo chown my_user_name /mnt/d
sudo chmod 777 /mnt/c
sudo chmod 777 /mnt/d

The first 2 commands (sudo mkdir) will create the folders (I ran it as root so I'm shore the 2 folders will be created).
The following 2 commands (sudo chown) will change ownership of the folders to my_use_name (that should be the user you use most often, probably the one you created when you installed the server).
The last 2 commands (sudo chmod) will change the access mode for the folder, so anybody can read/write to that folder. If more than one user use the server and you don't want to give them access to this folders then you should use 700.

Now we need to find out just under what device name did Linux install our partitions, for that you should execute
fdisk -l
, you should see something like this :
Disk /dev/hda: 6448 MB, 6448619520 bytes
255 heads, 63 sectors/track, 784 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1         747     6000246   83  Linux
/dev/hda2             748         784      297202+   5  Extended
/dev/hda5             748         784      297171   82  Linux swap / Solaris

Disk /dev/hdd: 20.0 GB, 20020396032 bytes
255 heads, 63 sectors/track, 2434 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdd1   *           1        1020     8193118+   7  HPFS/NTFS
/dev/hdd2            1021        2433    11349922+   f  W95 Ext'd (LBA)
/dev/hdd5            1021        2433    11349891    7  HPFS/NTFS

As you can see, the 20.0 Gb hdd has been installed as /dev/hdd and the 2 partitions are /dev/hdd1 and /dev/hdd5
So now lets add them to the /etc/fstab file, for that you need to execute :
sudo editor /etc/fstab
.
You should add the following 2 lines :
/dev/hdd1       /mnt/c          ext3    defaults        0        0
/dev/hdd5       /mnt/d          ext3    defaults        0        0

As the comment says at the beginning of the file (# <file system> <mount point> <type> <options> <dump> <pass>) first you have to tell what device (or partition) you want to add, where should it be mounted, the type of the partition and some other options
If the partitions are FAT32 and not EXT3 then you should add something similar to this : (VFAT is the code for FAT32)
/dev/hdd1       /mnt/c          vfat    defaults        0        0

If everything was OK, you can now mount all the devices (including the ones you've just added) with
sudo mount -a

:idea: Of course you don't have to do this each time you reboot the server since from now on the mount will auto-mount your partitions.

If you get any errors, then you have to see again if the text from /etc/fstab is correct, and also look if the partition type is correct (look at the table returned by fdisk -l)

SERVER : Installing UBUNTU serverSERVER : Instal MC (Midnight Commander) Linux's Norton Commander

Write a comment

You must be logged in to write a comment. If you're not a registered member, please sign up.

December 2009
S M T W T F S
November 2009January 2010
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31