Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,519
Rep:
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.
The hard drive is successfully mounted, and it is working now. 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? (This might reduce the time for searching files because Linux already knows the rule where to store files.)
Since Linux 2.4... multiple mounts can be stacked on the same mount point.
I'm at work right now so I can't check this out for myself, but it should be as simple as mounting partition A at {yourmountpoint}, then mounting partition B at that same point. In /etc/fstab, you'd be able to mount partitions where you wanted without worrying whether anything else was there. This does raise the question, though - what happens if both partitions have folders with the same name? If someone wants to try this and enlighten me before I get a chance to try it out myself (I can think of three possible outcomes), I'd be grateful.
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.
Originally posted by notooth The hard drive is successfully mounted, and it is working now. 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? (This might reduce the time for searching files because Linux already knows the rule where to store files.)
I look forward to your response.
1. Use LVM or Raid, I prefer LVM simply because I understand it better You (without using LVM) cannot simply mount up multiple devices to a single mount point to 'add space' to that directory. LVM is one way, you can add a new hard drive and copy the old data, but adding an additional drive, I'd use LVM with XFS (xfs_grow is very easy and doesn't screw with your files when growing a filesystem). It's been the easiest way I've found.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.