Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
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.
Also consult man fstab for information about mounting during a boot
and look at man mkfs for information about formatting a drive
Sometime an info <subject> presents more details and an easier-to-read alternative to the man command.
Oh, another useful tool is parted for creating and changing disk partitions.
Another thing: If you're moving to *nix from Windows, you should note that *nix system do not force you to create a separate "top-level" entry for different drives. You can attach a file system residing in any hard drive at any point in your file system you want to use. Basically, a *nix system has a single "logical" file system, organized hierarchically below the top level ("/"), almost independent of any physical devices where data is stored.
For illustration purposes only, here's what my Fedora 8etc/fstab looks like:
You probably know this. Before mounting the drive, you need to format it and create a filesystem on the partition.
If any user can use this partition, then it may be best to use the same permissions that the /tmp directory uses. You need to mount the partition before using chmod. "sudo chmod a=rwxt path/to/mountpoint".
Some distro's such as Mandriva & SuSE have a partitioner that can make the process easier. You can use them to create the filesystem (format) and to add an entry to /etc/fstab. Otherwise, you use "sudo /sbin/fdisk /dev/hdb" or "sudo /sbin/fdisk /dev/sdb" to format the partition. You next need to create the filesystem. Here you need to decide which filesystem to use. I am happy with ext3. I have used reiserfs and xfs in the past. Here is what my laptop's /etc/fstab entry looks like for the root partition:
You could use the form "/dev/hda1" instead. If you use /dev/disk/by-id/ or /dev/disk/by-uuid/, then make sure you use the value for your partition and not the value that I gave. Simple use "ls /dev/disk/by-id/" to look up your value.
Fedora core uses lvm. You can use the "/usr/sbin/system-config-lvm" program to add your new disk to the lvm volume. This would allow you to increase the size of /home, by adding your new drive to its lvm volume. Otherwise you need to create a mount point for your new partition.
Please put your distro in your LQ profile. That would enable us to give better answers.
add to /etc/fstab
/dev/hdb1 /media/storage ext3 rw,user 0 0
Well, because there are lots of options you can use, and it wasn't clear what you actually wanted.
For example, the "0 0" at the end of your proposed line disables fsck boot-time checking of the file system, and would only normally be done for file systems that a not mounted during the boot process. (In my example, above, that's what the "noauto" option is for -- to tell udev that the file system is on removable media, and that it might not be available when the system is booted.)
Also, by specifying "rw,user" you have granted r/w access to whoever mounts the file system, and permitted any user to do so. Since the file system will (implicitly) be mounted during the boot process, it will be owned by "root" and be in the "root" group. Thus the system administrator will need to set access and ownership values for any files in /media/storage before anyone else will be able to use the device. (Note that a "directory" is, on *nix systems, just another type of file.) While this may be what you want, again it was neither clear nor usual that you would want to do so. More commonly one just uses the "defaults" option on boot-mounted file systems, and then sets the permissions on /media/storage like this: chmod u+rwxt,g+rwx,o+rwx /media/storage so that everyone can read or execute any file in the "storage" directory, but only the user that created the file (or "root") can delete the file. (These are the permissions that are set on the /tmp directory.)
All the above is why we were recommending that you read the manual pages for the commands you intend to use. We can't read your mind to know what you want, and, as you specified in your example, when what you want is not "standard" you either need to provide more details or, as we suggested, read the information provided in your distribution and see how you want to do it.
The power and problem with systems like Linux is that you can do almost anything you want to do with the system (power), but you have to know how to do it (problem). And the documentation can be overwhelming since it needs to cover all the possibilities, not just the "common" ones.
Last edited by PTrenholme; 11-19-2007 at 01:40 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.