LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 02-15-2012, 03:25 PM   #1
Foxbat1155
Member
 
Registered: Oct 2011
Location: Portugal.
Distribution: Debian squeeze - Fluxbox.
Posts: 109

Rep: Reputation: 0
Smile mount Iomega external hard drive on debian squeeze, how to use mount command


Hello all.

I was about to start a thread asking how to mount and I have just been able to mount the Iomega external Hard Drive.

However I would like to ask for an explanation of the mount command just so I understand what I should do next time.

And is there a way to make this automatic?

My squeeze instalation is a fresh install and I did not choose the graphic desktop because I installed xorg and fluxbox.

Am I missing any package that would make the mounting of usb's and external hard drives more simple or automatic upon insertion?

This is the line I added to the /etc/fstab:
Code:
/dev/sdb1 /mnt/usb ntfs noauto,user,fmask=133,dmask=022 0 0
I then entered as root:

Code:
mount /mnt/usb
So if I understood I write the adress where the usb is in /dev and then the adress where I want it to be mounted on and then the filesystem and the rest I dont understand.

What can you explain to me about the rest?

Thankyou in advance =)
 
Old 02-15-2012, 10:58 PM   #2
PenGUiN_6_1
Member
 
Registered: Oct 2006
Location: Brunswick, MD
Distribution: gNewSense 2.3 (deltah) i386
Posts: 55

Rep: Reputation: 22
Code:
sudo mount -vvvv LABEL=.chip /mnt
[sudo] password for quant:
mount: fstab path: "/etc/fstab"
mount: lock path:  "/etc/mtab~"
mount: temp path:  "/etc/mtab.lock"
mount: going to mount LABEL=.chip by LABEL
mount: spec:  "/dev/sda4"
mount: node:  "/mnt"
mount: types: "(null)"
mount: opts:  "(null)"
mount: you didn't specify a filesystem type for /dev/sda4
       I will try type vfat
mount: mount(2) syscall: source: "/dev/sda4", target: "/mnt", filesystemtype: "vfat", mountflags: -1058209792, data: (null)
/dev/sda4 on /mnt type vfat (rw)
(This is an example)
FIRST...
I had specified to mount mine (a partition, but this also works for external USB drives with file system labels) by LABEL, which means mount looks it up by label

SECOND...
Once it finds the label, it looks for other information by that label, like the node that bears the label

THIRD...
The node having been found, it finds the target which is where you want to mount it

FOURTH...
The target being called the node (yes, the device node is what you are mounting, but that is spec, which means special), it looks for the filesystem type (in this example, I did not say what type, so it tries vfat) as well as anything like 'ro' for read-only or whatever else you say

FIFTH...
That information being known, it issues the mount command

Now, if you are mounting that one all the time and do not have a label, you can try this: use the UUID. mount looks at the UUID and with your options, does all of the stuff said earlier. My system has in its fstab file some of the information like that which you have provided, only it uses UUIDs (those are things or labels that are placed on the disk at format time).

Because the first part of your fstab contains the device, if only UUID or label (specified by UUID= or LABEL=, respectively), then mount, as said above, looks up the device you want (not a bother, just a different way of looking it up). After that, in that file, it looks for where you want it, then what type it is, and any options you have
Using a UUID or label (you want this put at /mnt/usb?), you can just issue
Code:
mount /mnt/usb
because mount will see that you have typed your specific-to-that-device label in fstab, that /mnt/usb is also there, and since that is in fstab, it can just put it where you want

Device names (sda, sdb, etc...) change at times, but the labels or UUIDs I do not think change (to check you have the right info, run 'sudo vol_id /dev/sda1' and make a note of the information; if done right, it should mount with only the location you want)

I do not know if this helps (I hope it does); other than that, I am uncertain if I can help
 
1 members found this post helpful.
Old 02-16-2012, 09:12 AM   #3
Foxbat1155
Member
 
Registered: Oct 2011
Location: Portugal.
Distribution: Debian squeeze - Fluxbox.
Posts: 109

Original Poster
Rep: Reputation: 0
Smile =)

Hello, thank you for your reply, it is helpful.

I do not have installed vol_id, should I install it? Is volname the same thing?

Thanks.
 
Old 02-16-2012, 03:46 PM   #4
PenGUiN_6_1
Member
 
Registered: Oct 2006
Location: Brunswick, MD
Distribution: gNewSense 2.3 (deltah) i386
Posts: 55

Rep: Reputation: 22
volname is not the same thing, it works for CDs or other ISO9660 type stuff (the ISO-9660 is common for things like CDs, DVDs, or CD or DVD image files of that form); udev would handle finding out what you would like. I am guessing your kernel version is at least 2.6.13 or something? You should already have that there (if not, run your system update tool; there is a very good chance you do have it on there, as I believe udev is something that runs in the background...you may not see it, but it is there); if not, use your system package manager or update tool to search for and install udev (there may be other packages required; just install them if it so mentions, and if need be, restart the system)
 
1 members found this post helpful.
Old 02-17-2012, 11:26 AM   #5
Foxbat1155
Member
 
Registered: Oct 2011
Location: Portugal.
Distribution: Debian squeeze - Fluxbox.
Posts: 109

Original Poster
Rep: Reputation: 0
Smile kernel version

This is my kernel version:

2.6.32-5-686
 
Old 02-17-2012, 01:16 PM   #6
Foxbat1155
Member
 
Registered: Oct 2011
Location: Portugal.
Distribution: Debian squeeze - Fluxbox.
Posts: 109

Original Poster
Rep: Reputation: 0
udev

indeed I do have udev. I do not have vol_id
 
Old 02-18-2012, 07:57 PM   #7
PenGUiN_6_1
Member
 
Registered: Oct 2006
Location: Brunswick, MD
Distribution: gNewSense 2.3 (deltah) i386
Posts: 55

Rep: Reputation: 22
Well, I think vol_id is an available command (it should be, as I believe it comes with udev), so if you need to, use
Code:
vol_id --uuid /dev/sdb1
with the device in question that should spit your UUID out on the screen. Using
Code:
vol_id --label /dev/sdb1
should spit your label out. With that information, you go back into your fstab, and where it says /dev/sdb1(?), use
Code:
UUID=BLEEP
or
Code:
LABEL=BLEEP
to enter it (only change the /dev/sdb1 spot, nothing else; either way, the system should use it where you want it)
 
1 members found this post helpful.
Old 02-19-2012, 11:56 AM   #8
Foxbat1155
Member
 
Registered: Oct 2011
Location: Portugal.
Distribution: Debian squeeze - Fluxbox.
Posts: 109

Original Poster
Rep: Reputation: 0
not found

Bash: command not found (vol_id)

And should I write the label I want where you wrote BLEEP?
 
Old 02-19-2012, 12:01 PM   #9
Foxbat1155
Member
 
Registered: Oct 2011
Location: Portugal.
Distribution: Debian squeeze - Fluxbox.
Posts: 109

Original Poster
Rep: Reputation: 0
Smile reminder

I would like to remind the readers that my installation of squeeze was not the default installation with the Graphical Desktop. I unchecked this option during the installation (tasksel I think).

So perhaps this is why I do not have vol_id.
 
Old 02-20-2012, 01:57 PM   #10
PenGUiN_6_1
Member
 
Registered: Oct 2006
Location: Brunswick, MD
Distribution: gNewSense 2.3 (deltah) i386
Posts: 55

Rep: Reputation: 22
You do not have the graphical install or whatever (that may or mat not be a reason); where BLEEP is though you should put your UUID (that is why I used the word BLEEP; it is supposed to be replaced with the thing, in this case, the UUID, you want to use). However, some commands might be on your system and you might be unaware of it. After looking on the Internet for some time, I came across something on blkid, but I was not sure if I had it on my system, so I did (locate and whereis, by the way, can be used on any command or whatever, if you think you got something on the system, but are unsure, or if you want to search):
Code:
quant@quant-laptop:~$ locate blkid
/etc/blkid.tab
/etc/blkid.tab.old
/lib/libblkid.so.1
/lib/libblkid.so.1.0
/sbin/blkid
/usr/share/doc/libblkid1
/usr/share/doc/libblkid1/changelog.Debian.gz
/usr/share/doc/libblkid1/copyright
/usr/share/man/man8/blkid.8.gz
/var/lib/dpkg/info/libblkid1.list
/var/lib/dpkg/info/libblkid1.md5sums
/var/lib/dpkg/info/libblkid1.postinst
/var/lib/dpkg/info/libblkid1.postrm
/var/lib/dpkg/info/libblkid1.shlibs
quant@quant-laptop:~$
The bold and underline indicates that this is the path you have to type if you want to use blkid; the format (as shown from my system; read the manual page for more) is:
Code:
quant@quant-laptop:~$ sudo blkid
/dev/sda1: UUID="efe0d178-50ea-4729-acd0-498c5dadaaed" TYPE="ext3"
/dev/sda2: UUID="64f0efb7-2c90-4ef8-b53d-a5928d6c8b3e" TYPE="ext3"
/dev/sda3: TYPE="swap" UUID="7a779dfd-1962-432e-a3b8-5b088d497687"
/dev/sda4: LABEL=".chip" UUID="4F38-00D9" TYPE="vfat"
quant@quant-laptop:~$
All the important stuff including Label and UUID should be there; just pick out what you need, and edit appropriately. As an extra example, here is if I were asking my computer about my sda4 (pretend it is not mounted, or that it is USB, as device names do change at times):
Code:
quant@quant-laptop:~$ sudo blkid | grep "sda4"
/dev/sda4: LABEL=".chip" UUID="4F38-00D9" TYPE="vfat"
quant@quant-laptop:~$
In this case, I see that /dev/sda4 is the device I want now, but it bears the UUID shown, and since sda4 is only used on some systems, either the Label or the UUID is better to use (you do not need to enter the quote marks when editing the /etc/fstab file, because the system does not use them there...I do not think; type man fstab and man blkid for more help)

I believe a different posting I have read somewhere said that Debian Squeeze was missing vol_id; maybe use blkid instead?

Last edited by PenGUiN_6_1; 02-20-2012 at 01:58 PM. Reason: Missing format marks
 
1 members found this post helpful.
Old 02-20-2012, 02:01 PM   #11
PenGUiN_6_1
Member
 
Registered: Oct 2006
Location: Brunswick, MD
Distribution: gNewSense 2.3 (deltah) i386
Posts: 55

Rep: Reputation: 22
Oh, yeah, type the precise path (that is, as shown); otherwise, the system might not recognize the command
 
1 members found this post helpful.
Old 02-21-2012, 02:14 PM   #12
Foxbat1155
Member
 
Registered: Oct 2011
Location: Portugal.
Distribution: Debian squeeze - Fluxbox.
Posts: 109

Original Poster
Rep: Reputation: 0
Hello again, I would like to thank your answers, they are really helpfull, I found blkid and I can see the labels now, thankyou again =)
 
Old 02-21-2012, 02:19 PM   #13
Foxbat1155
Member
 
Registered: Oct 2011
Location: Portugal.
Distribution: Debian squeeze - Fluxbox.
Posts: 109

Original Poster
Rep: Reputation: 0
Smile

I don't use sudo so I just enter su - and then use blkid directly, it works.

So when I am mounting manually I can define the LABEL and UUID, if I understood correctly? Thanks.
 
Old 02-21-2012, 02:20 PM   #14
Foxbat1155
Member
 
Registered: Oct 2011
Location: Portugal.
Distribution: Debian squeeze - Fluxbox.
Posts: 109

Original Poster
Rep: Reputation: 0
Smile nevermind.

Nevermind the last question.

What I mean is: when I plug in a usb or sd card and it does not automout, I can define its label first using /dev/s** ? And then mount it using the label or UUID?
 
Old 02-21-2012, 04:53 PM   #15
PenGUiN_6_1
Member
 
Registered: Oct 2006
Location: Brunswick, MD
Distribution: gNewSense 2.3 (deltah) i386
Posts: 55

Rep: Reputation: 22
When I type
Code:
sudo blkid
, and enter my password, it shows:
Code:
/dev/sda1:...
You have seen that output. So I enter
Code:
sudo ls -al /dev/disk/by-label
or
Code:
sudo ls -al /dev/disk/by-uuid
, and for those drives that have labels, the first command shows them listed as symlinks. All that means is if /dev/disk/by-label/.chip shows up, the listing actually is
Code:
.chip -> ../../sda4
(the .. means that you go back a directory, but all you need to know is the sda4 means /dev/sda4; the same with the
Code:
/dev/disk/by-uuid...the 4F38-00D9 -> ../../sda4
means /dev/sda4). SO, basically, yes, you can find a disk by label or uuid in the /dev/disk area (either by-label or by-uuid), use that to find your device (the labels or uuids point to a specific device), and use that label or uuid to mount it, remembering, as example:
Code:
mount LABEL=.chip /mnt
or, as example:
Code:
mount UUID=4F38-00D9 /mnt
 
1 members found this post helpful.
  


Reply

Tags
mount


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] How do I mount External Hard Drive and what command to backup Home Folder to it ? mansour Linux - Newbie 91 10-09-2011 04:14 PM
External USB hard drive undetected by Debian Squeeze Avelaval Linux - Hardware 11 08-24-2011 02:35 PM
udev rules to mount external hard drive at mount point akamikeym Gentoo 3 03-31-2010 01:12 PM
Cannot mount external hard drive thisObject Linux - Software 4 12-06-2006 11:53 PM
Can't mount external hard drive...HELP! Stevetgn Linux - Hardware 4 10-18-2005 07:38 PM


All times are GMT -5. The time now is 09:53 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration