LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 02-18-2005, 02:39 PM   #1
AndeAnderson
Member
 
Registered: Feb 2005
Location: Pennsylvania
Distribution: Debian (maybe)
Posts: 235

Rep: Reputation: 30
Unhappy Add a Hard Drive to Linux


I accomplished a Debian Sarge Net Install and thought it worked pretty well. But, I have been surfing and searching and not finding the basic guidelines needed for a newbie to Linux for adding a second hard drive to the system. Much less how to start a program from the command line.

I see instructions that are geared toward someone already familiar with the system commands, idiosyncracies and gotchas found in Linux. Plus, everyone seems fixated on the idea that everyone has or wants to set up their Linux system with a multiple boot capability. That is just not true.

For example:

Step one "Use fdisk." I'm sorry folks, but the Linux fdisk may have the same name, but it definitely does NOT do the same job as the DOS fdisk I am familiar with. Plus, all the Linux fdisk tries to do is fdisk my cd-rom drive? Maybe because it is the First Primary IDE Drive? The new Hard Drive is the Secondary Primary IDE Drive. The main/boot hard drive is a SCSI Hard Drive.

Step two "mount the hard drive." I'm not sure if you mean, in a picture frame or on a horse. ;^) In order to "mount" the device you have to modify the "fstab" file. Huh??? How do you find this file and how do you open it to modify it? Plus, what gets modified in it? What is a "mount point"?

Step three "set the disk partition to use the file system you want to use." What is the command to format the hard drive in Linux? I thought the partition was set by the fdisk command?

If Linux can see and prepare the Hard Drive during the initial installation why can't that same procedure be used for the addition or replacement of additional hard drives? It only took Debian about 3 minutes to find and set-up the original SCSI hard drive to be used for Linux. How hard would it be to remove that portion of installation code and create a hard drive management utility?

I can't even see what is on drive a:, c:, or d:? If drive letters are even used? How do you find what files are on a specific drive or in a specific directory?

Isn't it funny that "basic system commands like fdisk and mount" are not listed, explained or available in either the Help Files or Linux Documentation? We are just expected to know them and how to use them.

So, how does one work the magic of installing a second hard drive on a plain "Linux Boot Only" computer? I'm not even using a GUI. I am going from the Command Line.

If nothing else I'll just try to reinstall Debian from scratch. Maybe that would enable the second hard drive to be used?

Thanks from the confused one. (And I thought Linux would be easier than IIS.)
 
Old 02-18-2005, 03:47 PM   #2
satinet
Senior Member
 
Registered: Feb 2004
Location: England
Distribution: Slackware 11, Sabayon 3.1
Posts: 1,464

Rep: Reputation: 46
Okay Ande Sounds like you are a little frustrated.

Firstly there are NO drive letters in unix or linux. So forget about C: D: A: etc.

What's a mount point?
A file's a file's a file. Basically a mount point is where pyshical disks and partitions on your system put themselves. You don't need to worry too much about the complexities of it for now. Basically, you need to know that your second disk is going to be on a mount point. Which YOU can choose.

Type 'cat /etc/fstab' to see how your system is set up. Mine is: (cat displays the contents of file - top command)

/dev/hda6 swap swap defaults 0 0
/dev/hda5 / reiserfs defaults 1 1
/dev/hda7 /home ext3 defaults 1 2
/dev/hda1 /windows ntfs ro 1 0 #ro = read only
/dev/hda9 /fat-e vfat auto,gid=100,umask=000 1 0 #umask to set default permissions
/dev/cdrom /mnt/cdrom iso9660 user,noauto,ro 0 0 #user allows anyone to mount it
/dev/uba1 /mnt/stick vfat auto,user 0 0
devpts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0

This is a list of where the disks (left column) or mounted (second column). The third column is the file system type. ntfs, being a windows partition. vfat a fat32 (ms windows/dos) partition.

As you can see I have /home 'mounted' at /dev/hda7 with the file system type of ext3 (linux). The is a partion on my first hard drive (i only have one). you can tell this as all my partitions are listed as /dev/hda?, expect cdrom and usb stick. Don't worry about devpts and proc for now.

So, if I wanted to add a second disk, i would have to

1) physically install the disk
2) run 'hdparm -l' which will tell me about the disks/partitons on my drive.
3) Run 'cfdisk' which is much easier than fdisk, and will enable me to format you new drive. Which will be /dev/hdb
4) decide on a mount point. /new maybe? /stuff Whatever. Note don't try to mount it where the is an existing partition mounted. I could umount /home and remount it on /hda5, then use my second disk to mount /home. but i'll keep it simple.
5) edit my /etc/fstab file (as root). 'pico' or 'vi' maybe. to include a line like:

/dev/hdb1 /stuff ext3 defaults 1 2 (the second last column is about dumping and the last column is about file system checking - don't worry about those '1 2' is fine for your second disk until you are a wizard.)

then type 'mount -a' (mount all i.e '-a' mount points in /etc/fstab that aren't already mounted.)
It's important to note that i would have had to created a folder called /stuff in this example. you have to mount to a directory that already exists.

mkdir /stuff
chmod 777 stuff (change permissions)

You sound keen but very windows- centric. Stick at it and you will be laughing at C: drives before long. If you want to use more than one disk at the same mount point then we are talking about things like LVM and RAID. Lets not.

Anyway, mount points are central to your system. As is /etc/fstab.

Don't despair there is plenty of stuff for new people out there. And people are willing to help.........

check this out for some basics and a guide to vi:

http://wks.uts.ohio-state.edu/basic_...nix_guide.html

and this:

http://wks.uts.ohio-state.edu/basic_...nix_guide.html

or this:

http://www.tuxfiles.org/linuxhelp/fstab.html

this may be useful:

http://www.neowin.net/forum/lofivers...hp/t64329.html

Hope this has been of some help.............

To start a progam for the command like type ./programme where program is the name (if you are in the right directory)
or /usr/lib/mozilla which would start mozilla (if you where in X)

type 'startx' to go graphical if you have this intalled........

Last edited by satinet; 02-18-2005 at 03:49 PM.
 
Old 02-18-2005, 03:53 PM   #3
coldAndUgly
Member
 
Registered: Dec 2003
Location: New Zealand
Distribution: Slackware 10.2
Posts: 36

Rep: Reputation: 15
Hello, if you want a partitioning utility that is more akin to fdisk in DOS then use cfdisk.
By default fdisk and cfdisk will partition the primary master, you want to partition the primary slave so:
Code:
cfdisk /dev/hdb
is the command to use.
Quote:
Isn't it funny that "basic system commands like fdisk and mount" are not listed, explained or available in either the Help Files or Linux Documentation? We are just expected to know them and how to use them.
This is not correct at all. It just seems that way at first because you don't know where to look and what to search for.
There is a vast amount of documentation on the web and on your own computer.
Code:
man mount
man fdisk
man cfdisk
man mkfs
That being said here are the instructions you are looking for.
Code:
cfdisk /dev/hdb
Use cfdisk to partition the drive as desired, if unsure; man cfdisk. After the partitions are created you need to format them.
You'll probably want to use ext2, ext3 or reiserfs; I suggest reiserfs. The new partitions will be labeled hdb1, hdb2 as seen in cfdisk so:
Code:
mkfs -t reiserfs /dev/hdb1
and so on, replacing hdb1 with the partition you wish to format.
Once the partitions are created and formatted you need to decide where to mount them.
I personally would use a subdirectory of /mnt I don't use debian so I don't known how its file system is structured.
As root:
Code:
mkdir /mnt/storage
or whatever you want to call the mount point, this can be any arbitrary directory, then:
Code:
mount -t reiserfs /dev/hdb1 /mnt/storage
replacing reiserfs with the file system you chose and /mnt/storage with the directory you wish to mount it to.
Now you can go about using the partition as normal. If you want the partitons to be mounted automatically upon reboot you
need to add a line similar to this in your /etc/fstab file.
Code:
/dev/hdb1        /mnt/storage             reiserfs    defaults         1   2
If unsure man fstab. See how useful the man command is.

Last edited by coldAndUgly; 02-18-2005 at 03:57 PM.
 
Old 02-18-2005, 03:57 PM   #4
satinet
Senior Member
 
Registered: Feb 2004
Location: England
Distribution: Slackware 11, Sabayon 3.1
Posts: 1,464

Rep: Reputation: 46
I think what we are saying here is that there is plenty out there.

it took me a few seconds to find those websites i listed and they are pretty useful.

the best resources:

www.linuxquestions.org
www.google.com
www.google.com/linux
 
Old 02-21-2005, 01:18 PM   #5
AndeAnderson
Member
 
Registered: Feb 2005
Location: Pennsylvania
Distribution: Debian (maybe)
Posts: 235

Original Poster
Rep: Reputation: 30
Smile Thanks

Your instructions and understanding are greatly appreciated. :~)

Actually, I'm more frustrated with myself than with Linux. I went to school for Unix and all of this looks so familiar. But, I just can't seem to pull it back from my memory and I feel like I should be able to recall at least the basics.

I think Microsoft has dulled my senses.

"I never lose until I quit trying."
 
Old 02-21-2005, 01:24 PM   #6
satinet
Senior Member
 
Registered: Feb 2004
Location: England
Distribution: Slackware 11, Sabayon 3.1
Posts: 1,464

Rep: Reputation: 46
Ande,

Look mate, the best thing about linux, IMHO is the user community. People are just so helpful for no return and there doesn't seem to be too many know it alls.

Anyway, Linux is pretty similar to unix - I'm a unix admin. Not that you can tell. But if anyone wants to know about commands like mt, tr, prorest etc, then I'm your man!

Sounds like you'll be fine after a few weeks of fiddling.

but have you actually fixed it now?
 
Old 02-21-2005, 01:41 PM   #7
AndeAnderson
Member
 
Registered: Feb 2005
Location: Pennsylvania
Distribution: Debian (maybe)
Posts: 235

Original Poster
Rep: Reputation: 30
Wink One Day

Thanks for the support and offer.

I haven't had a chance to even look at it yet. I wasn't here for the weekend and this morning I came in to find a Btrieve Database had been trashed after I left Friday night.

So I had to do a restore and repair on the database. Not to mention a couple of other projects which have been given priority.

I'll get to try it later this week.

"I don't lose until I quit trying."
 
Old 02-24-2005, 02:06 PM   #8
AndeAnderson
Member
 
Registered: Feb 2005
Location: Pennsylvania
Distribution: Debian (maybe)
Posts: 235

Original Poster
Rep: Reputation: 30
Only errors and no mounting

Hey satinet,

I have tried the procedure you sent and all I end up with is a unable to mount - no mount point specified, after modifying the /fstab file. Was I supposed to type the 'mount -a' command into the /fstab file somewhere? I was trying to use it from the command line after saving the /fstab file.

If I try a shutdown and restart I get an unable to boot error message for a critical system failure - enter root password or hit Ctrl+D to continue.

How can I specify the /stuff as the mount point before it is even created on the new hard drive? I never made it to the

mkdir /stuff
chmod 777 stuff

Is there a step you automatically do that I do not know about?

I did some research and found that the ext3 was for a Linux partition and that vfat was for my windows partition.

I entered this line into the /fstab file:

/dev/hda /data vfat defaults 0 2

I no longer get the error message on boot-up, but after installing MC I can see that the /dev/hda is not getting mounted anyway.

Thanks

Last edited by AndeAnderson; 02-25-2005 at 03:39 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How to Add a Hard Drive? notooth Linux - Newbie 12 10-26-2005 04:16 PM
how to add a hard drive to a linux system? kike_coello Linux - Hardware 13 10-18-2005 10:35 PM
How to add a hard drive existing Linux system a1ntsk33r3d Linux - Hardware 5 06-28-2005 02:20 PM
add hard drive mnauta Linux - Hardware 1 01-09-2004 04:02 PM
Can't add hard drive- simple task- about ready to give up linux saxblue Linux - Hardware 4 07-30-2003 11:23 AM


All times are GMT -5. The time now is 09:27 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration