LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 09-15-2006, 01:32 PM   #1
pmetzak
LQ Newbie
 
Registered: Sep 2006
Posts: 10

Rep: Reputation: 0
Installing a new hard drive


Hi,

I'm new to Linux so I apologize if the answer to this question is frightfully simple. I have just plugged another 250gig harddrive into the motherboard of my computer which has a windows and a linux partition. I would like for the new hard drive to be used by Linux. Do I need to format it/ install some software/ make a sacrifice to a pagan god to make it operational?

Thank you for the information!
 
Old 09-15-2006, 02:07 PM   #2
pusrob
Member
 
Registered: Jan 2006
Distribution: Gentoo
Posts: 507

Rep: Reputation: 36
Wink HDD and linux

Hello pmetzak!
Well, if you want to use your new HDD only with Linux, then there isn't too much to do. Firstly: Put in you hard drive, then format it. I recommend the ReiserFS filesystem, becouse it is very advanced and powerful. Secondly: modify your fstab file (can be found in /etc). If you want only one pertition than add a line like this:
"/dev/hdb1 /media/hdb1 reiserfs notail 0 1". If you want another partition, than add another line like that, but with hdb2. The /media/hdb2 part means, that the partition will be mounted in that directory, so don't forget to create one. This dir name is only a suggestion, you can add this mount point anywhere., for example in /home/hdb2 or /home/HDD2 or anything else. It is advisable to put the mount point where the other devices are. This can be different in different linux distributions. Thats all. Good luck!
 
Old 09-15-2006, 02:11 PM   #3
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Before we get started, would you please tell us whether the new drive is parallel or serial ATA, and if it is parallel, whether it is slave or master and which bus it is connected to. Better still, if you scan through dmesg shortly after a re-boot, do you see /dev/something that you recognize as your new drive?

Do you want the entire new drive to appear as one partition, or more than one? And where in your existing filesystem tree do you want to graft on the new drive?

It is easier to give specific instructions when the answers to these questions is known, however it is nevertheless possible to give a general answer. You need to first partition the drive, using fdisk. Then, for each partiton, you need to create a filesystem, using mkfs. Then, again for each partition, you need to mount the partition using mount. You can then, optionally, create entries in fstab, to allow automatic mounting following re-boots.

--- rod.
 
Old 09-18-2006, 06:17 PM   #4
pmetzak
LQ Newbie
 
Registered: Sep 2006
Posts: 10

Original Poster
Rep: Reputation: 0
installing a new hard drive

Hi,

The hard drive is a SATA 250Gig hard drive. By typing 'dmesg', I don't see any drive information following /dev/... but I do see something relating to the drives listed under SCSI device. The new hard drive is

SCSI device sdb: 488397168 512-byte hdwr sectors (250059 MB)
sdb: unknown partition table

I would like to graft the partitions onto the root directory. I am not sure how many partitions I would like to make.... what are the advantages/disadvantages of having multiple partitions? The Linux portion of this computer is used mostly for storing large amounts of Matlab data. Thanks again to anyone that can help me out with this.
 
Old 09-19-2006, 03:15 PM   #5
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Before you do anything, read the man page for fdisk. Better still, read the linux partition howto, especially the chapter on 'partitioning with fdisk'. Sorry not to give you a one or two line answer, but that document is so on-topic and complete that I couldn't possibly be more concise.

You can then start by making yourself root, and running fdisk /dev/sdb. Use the 'p' command to see if there are any existing partitions. If there are none, then use the 'n' command to make one or more partitions. You can create an arbitrary number of partitions, of whatever size you want. If you are going to use the entire space for similar types of files, then a sinlge partition of type 'ext2' (82) is probably appropriate. If this is a Windows dual-boot host, maybe now is a good time to create a partition for sharing between Linux & Windows; a few Gigabytes of FAT32 serves well for that. If you are going to be backing up this new space, it might make sense to match partition sizes with the size of the backup media. Its all up to you, though.

So having created the new partition(s), which will be named /dev/sdb1, /dev/sdb2..., you will need to create a filesystem on each one. If you have created a linux partition on the first partition of the new drive, then use

Code:
mkfs -t ext2 /dev/sda1
This will format the partition with the filesystem type 'ext2'. Repeat for all partitions, using the filesystem type appropriate to that partition.

Now, you can mount the partitions on your existing root filesystem. Make a mountpoint. In this sample, I will use the names of the partitions, but you can choose any name that is appropriate, such as matlab, matlabdata, etc.

As root,
Code:
mkdir /sdb1
This will simply create a directory, upon which the new partition will be mounted. You will only have to do this once for each partiton you want to mount. You can create such directories anywhere in the filesystem. You can even use existing directories, and these will be 'replaced' by the new partiton when you, next, mount the partition.

Again, as root
Code:
mount -t ext2 /dev/sdb1 /sdb1
The partiton will be mounted on /sdb1, and you should be able to see it, read, and write to it according to the ownership and priveleges that were set up on the mountpoint. See the 'mount' man-page for details of assigning different permissions to the mounted partition.

The previous step will need to be repeated after any re-boot, unless you make an appropriate entry in /etc/fstab. An appropriate entry for the above example might look like
Code:
/dev/sdb1     /sdb1     ext2    rw,users,umask=022    0     0
Make one new entry for each partiton that you want mounted at boot time.

All of this and more is detailed in the Howto that I pointed out at the top if this post. Really recommended reading.

--- rod.
edit: forgot to mention off the top, that your new disk is /dev/sdb. SATA drives tend to look like SCSI drives...

Last edited by theNbomr; 09-19-2006 at 03:20 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing Mandriva 2006 - Hangs installing hard drive controller nvidia mcp04 sata DanielJPayne Mandriva 7 01-19-2006 02:15 AM
Installing grub to external USB hard drive for later use as internal hard drive dhave Linux From Scratch 2 12-10-2005 08:48 AM
Installing From Hard Drive dinojerm Debian 2 04-17-2004 10:26 AM
installing from hard drive booyah Slackware 2 05-11-2003 05:16 PM
Installing 8.1 on second hard drive mjcalling Linux - Newbie 7 02-20-2002 11:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 05:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration