LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 08-06-2008, 02:30 PM   #1
Chriswaterguy
Member
 
Registered: Apr 2007
Distribution: CrunchBang 10 Statler
Posts: 106

Rep: Reputation: 16
Formatting external HDD - what mount point?


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.

I searched the web and the forums but couldn't find an answer.

Thanks!
 
Old 08-06-2008, 02:59 PM   #2
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
What I usually do for an external device is open a shell and type the following BEFORE I plug in the device.

tail -f /var/log/messages


then when you plug in the device you should see messages on the screen as the device is detected and a device ID is assigned to it..

Code:
it-etch:~# tail -f /var/log/messages
Aug  6 12:46:01 it-etch -- MARK --
Aug  6 13:06:01 it-etch -- MARK --
Aug  6 13:26:02 it-etch -- MARK --
Aug  6 13:46:02 it-etch -- MARK --
Aug  6 14:06:02 it-etch -- MARK --
Aug  6 14:26:03 it-etch -- MARK --
Aug  6 14:46:03 it-etch -- MARK --
Aug  6 15:06:03 it-etch -- MARK --
Aug  6 15:26:03 it-etch -- MARK --
Aug  6 15:46:04 it-etch -- MARK --
Aug  6 15:57:42 it-etch kernel: usb 6-8: new high speed USB device using ehci_hcd and address 12
Aug  6 15:57:42 it-etch kernel: usb 6-8: configuration #1 chosen from 1 choice
Aug  6 15:57:42 it-etch kernel: scsi10 : SCSI emulation for USB Mass Storage devices
Aug  6 15:57:47 it-etch kernel:   Vendor: WDC WD20  Model: 0EB-00CSF0        Rev: 1B04
Aug  6 15:57:47 it-etch kernel:   Type:   Direct-Access                      ANSI SCSI revision: 02
Aug  6 15:57:47 it-etch kernel: SCSI device sdb: 39102336 512-byte hdwr sectors (20020 MB)
Aug  6 15:57:47 it-etch kernel: sdb: Write Protect is off
Aug  6 15:57:47 it-etch kernel: SCSI device sdb: 39102336 512-byte hdwr sectors (20020 MB)
Aug  6 15:57:47 it-etch kernel: sdb: Write Protect is off
so this device was detected as /dev/sdb

Once you know what the device is you can partition the drive(fdisk, cfdisk, etc..), format the partitions (mkfs) and mount them...
 
Old 08-06-2008, 03:05 PM   #3
Sjonnie48
Member
 
Registered: Jun 2005
Location: Earth
Distribution: Ubuntu10.04
Posts: 308

Rep: Reputation: 43
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!
 
Old 08-06-2008, 04:48 PM   #4
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
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.

Last edited by PTrenholme; 08-06-2008 at 04:50 PM.
 
Old 08-06-2008, 09:33 PM   #5
Sjonnie48
Member
 
Registered: Jun 2005
Location: Earth
Distribution: Ubuntu10.04
Posts: 308

Rep: Reputation: 43
Quote:
The comment by Sjonnie43, above, is only relevant after you have created the file system on the partition.
Chriswaterguy only asked about a mountpoint. I did not see any questions about filesystems or formatting, or what you eat with Thanksgiving.

So I only replied to his question.

Last edited by Sjonnie48; 08-06-2008 at 09:35 PM.
 
Old 08-07-2008, 01:01 AM   #6
Chriswaterguy
Member
 
Registered: Apr 2007
Distribution: CrunchBang 10 Statler
Posts: 106

Original Poster
Rep: Reputation: 16
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.
 
Old 08-07-2008, 02:17 AM   #7
Sjonnie48
Member
 
Registered: Jun 2005
Location: Earth
Distribution: Ubuntu10.04
Posts: 308

Rep: Reputation: 43
Quote:
what do I enter for the mount point?
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.
 
Old 08-07-2008, 08:48 AM   #8
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
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.
 
Old 08-07-2008, 09:54 AM   #9
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
At this point I'm wondering if I replied to someone elses question in the wrong thread.. hrmm..


http://www.tuxfiles.org/linuxhelp/mounting.html

http://www.itc.virginia.edu/desktop/linux/mount.html
 
Old 08-08-2008, 11:17 AM   #10
Chriswaterguy
Member
 
Registered: Apr 2007
Distribution: CrunchBang 10 Statler
Posts: 106

Original Poster
Rep: Reputation: 16
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...
 
Old 08-08-2008, 12:35 PM   #11
Chriswaterguy
Member
 
Registered: Apr 2007
Distribution: CrunchBang 10 Statler
Posts: 106

Original Poster
Rep: Reputation: 16
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?

Have googled, still confused. Any ideas?

Other info: it's a USB drive, from memory it's Western Digital, IDE, 160 GB.

Thanks!

*I'm using Mandriva 2008.1 Spring, Gnome version. I installed Thunar because I like it.
 
Old 08-08-2008, 01:43 PM   #12
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
you probably need to update your /etc/fstab file to mount the new partition using ntfs-3g.. without the entry in fstab only root would be able to mount the partition.

<your partition> /media/<mount point> ntfs-3g defaults,locale=en_US.utf8 0 0


other things to look at..
http://www.ntfs-3g.org/support.html#useroption

also have you created the directory /bkp in your root partition... ?

Last edited by farslayer; 08-08-2008 at 01:44 PM.
 
Old 08-08-2008, 03:51 PM   #13
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
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:
Code:
[Peter@dv9708us ~]$ sudo mount /Vista
[sudo] password for Peter:
[Peter@dv9708us ~]$ ls /Vista/
autoexec.bat  Documents and Settings  PerfLogs       System.sav
Books         hiberfil.sys            Pictures       System Volume Information
boot          HP                      ProgramData    Users
bootmgr       IPH.PH                  Program Files  Wallpapers
config.sys    MSOCache                $RECYCLE.BIN   Windows
CVS           pagefile.sys            SWSetup
But you can attach the file system anywhere you wish to do so. Here I create a sub-directory in my $HOME and attach the same file system there:
Code:
[Peter@dv9708us ~]$ mkdir test
[Peter@dv9708us ~]$ sudo mount UUID=342D7D7923AC4107   ~/test #Because the device is already mounted, no options are needed.
[Peter@dv9708us ~]$ ls test
autoexec.bat  Documents and Settings  PerfLogs       System.sav
Books         hiberfil.sys            Pictures       System Volume Information
boot          HP                      ProgramData    Users
bootmgr       IPH.PH                  Program Files  Wallpapers
config.sys    MSOCache                $RECYCLE.BIN   Windows
CVS           pagefile.sys            SWSetup
[Peter@dv9708us ~]$ sudo umount test
Thus I can have the same file system mounted in more than one place. This shows that "/Vista" was not disrupted by being mounted as "test.":
Code:
[Peter@dv9708us ~]$ ls /Vista
autoexec.bat  Documents and Settings  PerfLogs       System.sav
Books         hiberfil.sys            Pictures       System Volume Information
boot          HP                      ProgramData    Users
bootmgr       IPH.PH                  Program Files  Wallpapers
config.sys    MSOCache                $RECYCLE.BIN   Windows
CVS           pagefile.sys            SWSetup
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.)
 
Old 08-13-2008, 07:28 PM   #14
Chriswaterguy
Member
 
Registered: Apr 2007
Distribution: CrunchBang 10 Statler
Posts: 106

Original Poster
Rep: Reputation: 16
Ok, it's now working!

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!)

Thanks again.
 
Old 08-14-2008, 09:24 AM   #15
JMCraig
Member
 
Registered: Feb 2003
Location: Utah, USA
Distribution: Red Hat EL/CentOS, Ubuntu/Debian
Posts: 113

Rep: Reputation: 15
Quote:
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).

Best of luck!
 
  


Reply

Tags
externalharddrive, formatting, mountpoint



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Make removable USB hdd mount at fixed mount point ctkroeker Linux - General 13 08-11-2009 08:49 AM
Changing removable HDD mount point (not /dev name) saravkrish Linux - General 1 03-17-2007 11:38 PM
Formatting external hdd as backup to 2 hdd's balch4 Linux - Desktop 2 12-04-2006 11:49 PM
Help for formatting external hdd !! sudhir Linux - Hardware 4 12-11-2003 11:30 PM
system freezes when formatting external hdd hobylinux Linux - Hardware 6 09-10-2003 10:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 11:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration