Manufacturing Information Solutions Forum Index Manufacturing Information Solutions
Your Place for Support and Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Adding a Second IDE Hard Drive To Your Linux System

 
Post new topic   Reply to topic    Manufacturing Information Solutions Forum Index -> Miscellaneous Hardware
View previous topic :: View next topic  
Author Message
dawn
Master Poster


Joined: 26 Jun 2004
Posts: 311
Location: Mishawaka, IN

PostPosted: Wed Mar 12, 2008 2:00 pm    Post subject: Adding a Second IDE Hard Drive To Your Linux System Reply with quote

Adding a Second IDE Hard Drive To Your Linux System

--------------------------------------------------------------------------------

The physical mount.
Copy down the specs from the label on the drive.
Make sure it's jumpered as "slave".
Mount the drive in a spare drive bay, securing it with several screws.
Attach an IDE cable from the IDE port on the motherboard.

Update the BIOS with the info for the new drive.
It may autodetect, but don't count on it. Check the BIOS settings to make
certain. Setting the 'LBA' option not necessary.

Partitioning.
Boot up Linux and partition the new drive:
As root, fdisk /dev/hdb.
[primary partition, Linux native]

Format the new drive.
mke2fs -cv /dev/hdb1
[verbose output and check for bad blocks]

Create a mount point.
Decide where you will be mounting it and create a mount point.
For example, if you will mount it as /mnt/drive2, as root,
cd /mnt
mkdir drive2
chmod 777 drive 2
[makes the new drive accessible to ordinary users.]

Testing.
As root, mount -t ext2 /dev/hdb1 /mnt/drive2.
If no error messages, cd /mnt/drive2, and try creating a directory and
writing a couple of files.
If it works, hurray!
Continue to the final steps.

Modify /etc/fstab.
Add the following line to /etc/fstab:
/dev/hdb1 /mnt/drive2 ext2 defaults 1 2

Reboot and see if the new drive automounts.
Back to top
View user's profile Send private message Send e-mail
mistux
Site Admin


Joined: 25 Jun 2004
Posts: 1042
Location: South Bend, Indiana USA

PostPosted: Wed Mar 12, 2008 2:36 pm    Post subject: Reply with quote

Here is another tutorial, pretty much the same thing. It is from this How To found on: www.smorgasbord.net
---------------------------------------------------------------------------------
So you’ve been using linux for awhile now, and it’s time to install another hard drive for some more storage? Maybe it’s finally time to wipe out a Window’s or NTFS partition.

In any event, I wrote this post so you would have a little help through this step. I’m going to assume that you already know how to install a hard drive. I’m also going to assume that you knew how to make it a master or slave, you’ve checked to make sure that it shows up in bios, and that it was intalled properly. It also assumes you’ve already formatted your drive in linux ext3 format, using a tool like gParted, or something similar.

If you’ve done all of these things, then boot up your system - and let’s get going. I’m using Ubuntu linux - formerly Breezy 5.10, but I’ve recently upgraded to Dapper 6.06.

Open up a terminal window and run the following command:
$ sudo fdisk -l

You should get a listing of the hard drives installed on your computer. There will be a little paragraph for each one that will look like this:


Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 4678 37576003+ 83 Linux
/dev/hda2 4679 4865 1502077+ 5 Extended
/dev/hda5 4679 4865 1502046 82 Linux swap / Solaris



In windows disk drives are assigned an alphabet letter, and traditionally - floppy disk drives were a: and / or b:, and the main hard drive was c:/. Then the first cdrom or dvdrom was d:/, and any additional drives would be e:, f:, and so on. In linux it’s kind of the same, but in a different format. All hard drives installed are listed in the ‘device’ or /dev directory. All drives start with the appendage “hd” (I think for ‘hard drive’.

So, if you have 2 hard drives and one cdrom - then you have 3 devices. You have a hda, hdb, and hdc. The number of partitions comes next. If your main hard drive is linux - and you have 3 partitions, then you’ll have a hda1, hda2, and hda5. The partition numbers aren’t in a logical order - hda5 is always the swap partition.

So know, if you see your hard drive listed in the sudo fdisk -l, then you know you can mount it. Your computer has a startup file that tells it what to mount when it boots. We need to edit this file and add the new drive.

But first we have to create a directory. We have to create what’s called a “mount point”. A mount point is a virtual directory. It’s like saying - mount that hard drive from this directory.

The most logical place to create the mount point for the new hard drive is either the /mnt or /media folder. Many would say that /mnt is the only place it should be - the mount folder. However, Ubuntu always mounts all dvd, cd, and removable media in /media. I chose to make my mount point here for just that very reason.

Think of what you want to call the new mount point name. Just make sure you don’t use any special characters or spaces in the name. I called mine linuxstore. Now, in terminal run the following command substituting my mount point name for yours:
$ sudo mkdir /media/linuxstore

Next, here’s one of the most important things….and somethng that I didn’t find in any of the articles on the web when I was trying to figure out how to do this. You have to make the mount point directory ‘writable’. In other words, you have to give it writable permissions. They have to be world-writable permissions since you aren’t a member of the ‘root’ group in which all mount points are owned.

So, now you want to run the following command (again substituting my mount point name for yours):
$ sudo chmod 777 /media/linuxstore

use perhaps…

$ sudo chmod -R 2777 /mnt/point

If you want to mount your drive right away, and you don’t care if it’s mounted automatically every time you boot - then in terminal run the following command:
$ sudo mount /dev/hdd1 /media/linuxstore

There! Now you are temporarily mounted. But…if you want it to be permanent, you need to edit your filesystem tab file. Run the following command in terminal:
$ gedit /etc/fstab

The text editor window will appear with the fstab file loaded up. You will see something that looks kind of like this:

# /etc/fstab: static file system information.
#
# proc /proc proc defaults 0 0
/dev/hda1 / ext3 defaults,errors=remount-ro 0 1
/dev/hda5 none swap sw 0 0
/dev/hdb1 /media/hdb1 ext3 defaults 0 0
/dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0


All you have to do is add a new line for the new drive…
I will add the following line to my fstab for my new drive:

/dev/hdd1 /media/linuxstore ext3 defaults 0 0


Just be sure to substitute both the name of my hard drive for yours (mine is hdd1, is yours hdc1 or another name?), and my mount point hame for yours. Then save the file.

Now you will have the new hard drive mounted and writable both every time you boot. In Ubuntu, you should find your new drive listed under your ‘Places’ menu. To make the hard drive show up right now, without rebooting - just reload your fstab file with the following command:
$ sudo mount -a

Now you’re done! Enjoy your new storage drive in Linux!
Back to top
View user's profile Send private message Send e-mail
dawn
Master Poster


Joined: 26 Jun 2004
Posts: 311
Location: Mishawaka, IN

PostPosted: Wed Mar 12, 2008 2:57 pm    Post subject: Reply with quote

Here is another one:

http://www.bradtrupp.com/id/unbuntu-add-hard-drive.html it uses Gnome Partition Editor

After usign that utility you would do:

Mounting the new Partition

Open a terminal window and enter the following commands --

(1) Create the Mount Point


sudo mkdir /nas2

(2) Back up the /etc/fstab file.


sudo cp /etc/fstab /etc/fstab-backup

(3) Edit the /etc/fstab file and add the new partition to /etc/fstab. Since the file is owned by "root", we need to use sudo to start an editor.


sudo nano /etc/fstab

Add this line to /etc/fstab. Use tab instead of space to separate the various columns.


/dev/sda1 /nas2 ext3 defaults 0 0

To save your changes, press Control-X for save, Y to confirm, and then press Enter to exit.

(4) We have made changes to the /etc/fstab file, so let ask Ubuntu to mount the drives again


sudo mount -a

(5)Now give ourselves proper permissions to use the new drive. Assume in this example that my userid is "freddie".


sudo chown -R freddie:freddie /nas2
sudo chmod -R 755 /nas2

Now the new drive is mounted as /nas2 and is ready to use.

One more Thing

Also, as a convenience and ease of use, you can also create a symbolic link (using the ln -s command) on your desktop back to the /nas2 folder. Just click on the new link to open the folder in the default file browser.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Manufacturing Information Solutions Forum Index -> Miscellaneous Hardware All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group