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.

Introduction to Linux - A Hands on Guide

This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.

I'm formatting a partition on an external HDD - what do I enter for the mount point?

I'm formatting through Mandriva Control Center (Mandriva 2008.1 Spring), and the dialog is prefilled with /usr, but I don't know if that's good (I assume that would conflict with the existing /usr on the "/" partition.

A mountpoint is a directory.
For creating a mountpoint you can create a new directory directly on the root of your filesystem.
The name may reflect the use of the harddisk: music, video or whatever-you-want.
That directory can be used as the mountpoint: /music, /video or /whatever-you-want.
That's all!

Or, after you've plugged it in, you can do a /sbin/fdisk -l /dev/[sh]d? to list your attached devices and partitions.

Then a mke2fs <option list here> /dev/sda3 would, for example, format the third partition of /dev/sda as an ext2 (or ext3 -- see man mke2fs for the options) file system.

You need to do this before attempting to mount the partition since mount will not mount a file system it does not recognize.

The comment by Sjonnie43, above, is only relevant after you have created the file system on the partition. In fact, I think that you can't create a file system (i.e., "format" in MS-speak) on a mounted file system.

In "Linux-speak" your question would have better phrased as "How do I identify the device and partition to be used when I create a new file system on a drive.

Note also that tools like qtparted, kparted and gparted provide a GUI for partitioning (and re-partitioning) drives and creating file systems on those partitions.

I'm a bit confused - Sjonnie48's suggestion (mount as /music or whatever) is by far the most appealing, as I think that maybe I understand it. On the other hand, I am specifically talking about creating a file system (or formatting, as it says in the Mandriva Control Center). I'm tempted to just put in /backup and see what happens - but it seems like there should be a simple answer (and it should go on a Linux wiki).

I've never found a need to specify a mount point when plugging in external media which is already formatted (unless that would solve the issue of having to open a file manager as root). And as long as it's usable... I'm not going to worry about the parts of my distro that "ain't broke". So yes, only concerned about what to specify when formatting.

You asked nothing about formatting, only about a mountpoint. That is what I replied to.
My experience with Mandriva/Mandrake goes back a few years, I have not used it for about three years.
I remember the Mandrake Control Center as being very user-friendly, also for creating a filesystem.
You can specify which filesystem you desire, like reiserfs (most robust of all) or any other native Linux filesystem.
Just follow the instructions from the Control Center, and virtually nothing can go wrong.

Let me see if I can clear things up. First, you did ask about formatting:

Quote:

I'm formatting a partition on an external HDD - what do I enter for the mount point?

which is the question to which I replied after reading your whole post, not just your title line.

I replied mentioning "generic" Linux tools rather than Mandriva tool because, frankly, I only used Mandriva for a week or so several years ago, and I'm not familiar with the way that distribution has packaged those tools.

A few questions:

1) Is the external HD already formatted and partitioned?

When you purchase an external HD from most vendors in the US, the drive is delivered "pre-formatted" as (most often) FAT32 or (rarely) NTFS in a single partition. It is usually delivered with a single partition. Some are delivered with two partitions, one containing MS programs which, in "ad-speak," "enhance the security" and "usability" of the drive. (But, of course, those programs require a MS OS to run.)

On the other hand, you may have just put a new (or, perhaps, used) HD in a USB enclosure. That drive may or may not have already been partitioned and formatted.

2) Do you need to create the partition you wish to use for you new file system, or is it you intention to replace an existing partition with a new file system? Or do you, perhaps, want to use the whole drive for you new file system?

3) Do you know which type of file system you wish to create in the removable HD? Linux supports many different file system types (including FAT and NTFS), so, if your drive is already prepared for use, and you just want to use what's on it, perhaps all you need to do is identify the file system already present on the drive. (The fdisk command I mentioned above, and the partitioning GUI programs, will tell you the partition types and, in many cases, the file system name. They will also identify the physical device entry in the /dev directory corresponding to the device. That information is useful whne you mount the partition(s) on the drive.)

Bottom line: Can you provide more details about what you're trying to accomplish?
What type of external HD are you using? (USB, Serial, ?) (Brand, model, size) etc.
Is the drive already partitioned?
Etc.

Re the disagreement above, I have been talking about formatting - but I sometimes misread things by other people and im not going to mock other people's misreadings - or discuss the point any more .

Re PTrenholme's questions... I'm deleting 2 existing Linux partitions (FAT32 and ext3) on the HDD, and want to create a single NTFS partition from those 2 (so I have a way of transferring large files between Linux and Windows machines). There's another ext3 partition which I'm keeping - that shows the mount point as "/var" but when I navigate to /var in my file manager, it's clearly a different directory.

I'm going to try formatting as NTFS-3G with mount point /bkp and see what happens. If there's a problem I'll get into the details...

I just tried, creating the file system with a mount point of /bkp, going through all the steps in Mandriva Control Center (which looks like it uses gparted*), but I can't mount the partition.

When I try to mount (using a panel applet) I get "Cannot mount volume. You are not privileged to mount this volume." I get a similar error from the file manager (I use Thunar*) running as root. ounting from the command line gives no error, but fails to let me access the disk with the file manager. Part of the system (including Mandriva Control Center) sees the partition as mounted, but when I try to do anything, I get an error?

Could it be that I'm using the wrong mount point, or is it a different problem?

Re the existing /var labelled partition, the label is only used if you mount the partition using the LABEL= naming convention in your mount command. (See man mount for details.) The second argument you pass to mount is the place in your file system where the file system on the removable media will be "connected" to your existing file system as a branch.

So, for example, if you had a line like this in your /etc/fstab:

Code:

UUID=342D7D7923AC4107 /Vista ntfs-3g rw,noauto,defaults 0 0

then the device with that UUID would appear as a subdirectory of / called "/Vista." Here's what that looks like:

Hopefully, the above will make clear that the "mount point" is, basically, whatever you want to use.

Oh, a couple of points, since you're talking about moving your USB drive between systems: The UUID= or LABEL= form used in the /etc/fstab let's you have a "static" /etc/fstab which works even when the physical device id changes. (And, for USB devices, it does change as the "mix" of devices you have plugged in changes.) The second point is the "noauto" option, which instructs the loader to not attempt to attach the device during boot. Without it you will get an error message during the boot, and, sometimes, an aborted boot. (The "noauto" option does have a downside: You do have to manually mount the device when you plug it in, or, for some OSs, accept where it is automatically mounted. Personally, I prefer to control my mount points, but many others prefer to let their display manager do the mounting when a device is plugged in.)

At first I misread/misunderstand Sjonnie48's statement about the "file system"...

Quote:

A mountpoint is a directory.
For creating a mountpoint you can create a new directory directly on the root of your filesystem.
The name may reflect the use of the harddisk: music, video or whatever-you-want.
That directory can be used as the mountpoint: /music, /video or /whatever-you-want.
That's all!

..until farslayer asked "also have you created the directory /bkp in your root partition... ?"

Aha! So I create the directory in the filesystem, apart from the HDD, matching the mount point. Now I can successfully mount from the command line - thank you!

The remaining questions are:

Practical question: Auto-mounting. I still get a permission error when I plug it in, and also when I try to mount it from the file manager (even running as root) even though the other partition mounts automatically. Is there a simple explanation somewhere of how to make it auto-mount? There are how-tos, but quite technical, not great for a newbie. After reading
post, I opened /etc/fstab but there is no "noauto" anywhere. Curiously, /etc/fstab has an entry for this partition I'm asking about, but not for the other partition that does auto-mount.

Idly curious question: If there is a directory in my filesystem called /bkp, and my external HDD mounts as /bkp, isn't there potential for conflict? Suppose I got mixed up and put files into /bkp when the external HDD was not plugged in - what would happen? (I don't want to do an experiment - now that things are working, I want them to stay that way!)

Idly curious question: If there is a directory in my filesystem called /bkp, and my external HDD mounts as /bkp, isn't there potential for conflict? Suppose I got mixed up and put files into /bkp when the external HDD was not plugged in - what would happen? (I don't want to do an experiment - now that things are working, I want them to stay that way!)

I understand your concern. There is indeed a potential for conflict. If you have your USB drive unmounted and write stuff to /bkp, when you then mount the USB at that directory/mount point, you'll lose access to whatever is on /bkp (these files would be stored on whatever physical disk is mounted as the root volume--that is / ). The data's not gone, it's just not accessible as long as something else is mounted at /bkp. This is a characteristic of the way Unix mounts volumes and I don't know a good way to avoid the possibility of making a mistake in writing to a directory that you only mean to have as a mount point for a device which can be removed.

My understanding is that, by convention, the /mnt directory (off the root) is used for things that are mounted temporarily. So, on one of my systems, I've created the directories /mnt/usb and /mnt/usb2 to provide mount points for the USB drives I sometimes have attached. There's also a /mnt/cdrom directory there (for when there's actually a CD in the drive). Following this convention can sometimes feel kind of clunky and one way to deal with it is to have a link that points to the directory in question from a more mnemonic path (such as your /bkp).