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.) |
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........ |
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 Quote:
There is a vast amount of documentation on the web and on your own computer. Code:
man mount Code:
cfdisk /dev/hdb 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 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 Code:
mount -t reiserfs /dev/hdb1 /mnt/storage 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 |
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 |
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." |
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? |
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." |
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 |
All times are GMT -5. The time now is 03:09 AM. |