How to Add a Hard Drive?
I just added a hard drive to my computer running Redhat Enterprise Linux 4, but I do not know where it is in the file system. Can anyone tell me how to config the new hard drive with the GUI?:D
|
The easiest way is to add it in the /etc/fstab ... you can specifiy where you want the drive to be mounted, and the options you want..
Check out the man fstab page for more details. If you have problems, check back and maybe I can help you understand the jargon.. You do have to find out where the /dev/ is located... is it an external drive or an internal ide/sata drive? |
Well, actually if it's a new hard drive, they've got to a bit more than just that.
They've got to give it partitions, and a filesystem. I believe in Redhat EL you have a How-To that actually gives good detail... Ah yes: https://www.redhat.com/docs/manuals/...STORAGE-ADDREM Cool |
I do not know what type of file system I should set to the partitions, and how to use the mkfs command. Is there a GUI for all of these?
|
The type should be whatever type of filesystem you'll be using. If unsure, go with ext3. This is type 83. And the mkfs command, depending on the new partition number:
mke2fs -j /dev/hda3 Replace /dev/hda3 with whatever you created with fdisk. Cool |
And there is a gui for hard-drive partitioning... qtparted is a pretty good one... but good old fdisk and mkfs are just as easy.
|
I updated the fstab and rebooted the machine, but I did not see the new folders mounted. Here is the fstab content:
Code:
# This file is edited by fstab-sync - see 'man fstab-sync' for details :newbie: |
Check your dmesg and /var/log/messages logs to see if there are any errors. In particular, did the mount points exist before you tried to mount them? The mount points, e.g. /local6 must exist on your filesystem.
|
There are some lines in dmesg:
Code:
mounted file system with ordered data mode How do I know if files are written on the new hard drive or the existing mount point? |
Let me start at the beginning. Linux has a directory tree off root ("/") which contains directories, files, devices, and a few other things. You have to make mount points, which are regular old directories (e.g. "mkdir /mnt/mynewdrive"). All these mount points must be put in the root directory, which is the root partition of your linux installation. So, when you launch a file manager, it shows you the root ("/") directory tree. Every other thing which stores data on the whole PC is a directory off the root directory tree. That means you have a mount point there for any new thing you install.
You don't need to mount a drive to partition and format it. In fact, if there are no partitions on it, there is nothing to mount. Disk partitioning programs show partitions if they are there, but if the drive is unpartitioned the program will still find it. You should be able to find the disk partitioner in your linux distro somewhere. Most partitioning software also formats the partitions. fdisk is a noteable exception. When you partition a drive, each partition needs a mount point, that exists in the root tree. So, use the mkdir command to make your mount points. I usually put them in /mnt, but you can put them off / if you wish. here is a sample fstab line for a HDD partition: /dev/sdb<space>/mnt/local<space>ext3<space>defaults<space>0<space>2 Do not have 2 partitions that have the same last number. Root should have 1. Once you have the disk formatted, and in your distro I would use ext3, when you boot the next time it should automatically go in fstab. I know you can do it. Don't ever give up. I have faith in you. |
The hard drive is successfully mounted, and it is working now:D. I would like to thank all of you who have ever helped me out.
There is one more thing I have been concerned. The hard drive I just mounted is going to store files uploaded from my website. The number of files might approach millions (I hope,) and the drive capability might not fullfil the need. Therefore, I will have to add a new hard drive and wonder how to do this. These are some questions I would like to consult: 1. How to mount multiple hard drives to 1 mount point? 2. What type of file system is the best for storing and searching a numerious of small files? 3. Is there a way to set a rule and make Linux automatically sort (by file name) and store files in appropriate sub-folders when files are uploaded:rolleyes:? (This might reduce the time for searching files because Linux already knows the rule where to store files.) I look forward to your response.:D |
1. According to the mount man page,
Quote:
2. Reiser FS is good for that sort of thing, due to its being backed by a balanced tree. And in my (admittedly non-scientific) findings, most people who've used it seem happy with it. One word of warning though, there seems to be a much larger overhead than ext2/3 - so if you're using small drives you might find it actually gets slower. 3. This would be an application-specific question - Linux stores a file in the specific directory and with the specific filename that it's told to. If you wanted to apply some kind of filtering on uploaded files, you'd have to do it in the application that accepts (or possibly sends) those files. Basically, wherever the filename is chosen, that's where you need to filter. If you're asking solely in terms of making searches faster, then that's something that could be done with a shell script (e.g. if you're searching for a jpeg, search these directories first, then run through the rest). However, I don't think there's much of an advantage you'd get over just using common sense (e.g. if you're looking for a picture, look in /home/foo/pictures first) and I certainly wouldn't recommend any automatic filtering scheme that's too complex for you to keep in your head anyway. |
Quote:
2. Indeed, ReiserFS, as noted above. 3. You could probably script this if you have any scripting knowledge. However, you may be able to accomplish this with a series of cron-jobs; a combo of a nice script a cron-job would be ideal IMHO. Check out the Bash-How-To at http://tldp.org to see how easy it actually may be to make the scripting you are looking for. HTH Cool |
All times are GMT -5. The time now is 07:15 AM. |