LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 11-05-2006, 04:51 AM   #1
charmanr
LQ Newbie
 
Registered: Jun 2006
Location: Beijing
Distribution: Suse Linux 10.0 x86_64
Posts: 6

Rep: Reputation: 0
fstab, mtab and KDiskFree confusion


Hi,

In my laptop I have one drive with two partitions / and /home and I also have two USB drives. The first drive has just one partition which contains music files, the second drive has two partitions with videos and photographs.

When the drives are plugged in they are automatically mounted as /mount/Pics & Tunes (It used to have both on the same partition under Windows), /mount/NEW VOLUME (not sure how it got that name), and /mount/END:VCARD (again I really don't know where it got that name from). Each partition always having the same name when automounted.

I want these partitions to be mounted in specific locations /music, /photos & /videos but this is where I am getting confused, is there a config file where I can specify this?

I thought about adding the device names (/dev/sda1 etc....) to /etc/fstab so they are mounted where I want them at boot time but I can see that this might be problematic. The devices will not be recognised at boot time because I have noticed that mounting from fstab takes place before the USB drives are even noticed by the system (therefore sda1, sdb1 & sdb2 do not exist yet). Am I also right in thinking that the devices might be placed on the wrong mountpoint if they are plugged into different USB ports? What would happen if one of the drives was not plugged in etc.?

I have also noticed that KDiskFree only shows devices that are listed in /etc/fstab and not those mounted in /etc/mtab so I am unable to view the disk usage for the USB drives. Right clicking the desktop icon for the device and clicking properties tells me that the devices have 0% usage which is not true. Having the drives automounted where I want them and KDiskFree reading from /etc/mtab instead of /etc/fstab would solve this.

To sum up:

1) Is there a config file that I can edit to automount the USB devices on specific mount points?

2) Can I make KDiskFree use /etc/mtab instead of /etc/fstab for displaying disk usage?

I hope that someone can help me with this, it's not a serious problem but it is annoying.

Thanks you.
 
Old 11-05-2006, 05:13 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
This is a well-known problem. Since the naming of usb devices depends on the order in which they're plugged in, you need something more than fstab in order to give them dedicated mount points.

That's where udev comes in. It's the new Linux dynamic device manager. It's designed to take care of this. If you're running a kernel that's less than a year or two old, then you're probably using udev.

You can set up rules for udev to use that will detect individual devices and create /dev entries specific to them. Then you can create fstab devices for those entries so that they will always mount to the locations you want.

This page has all the info you need to know about udev and how to write rules for it. Have fun.

http://www.kernel.org/pub/linux/util...plug/udev.html

Edit: BTW, the automounting system in KDE uses a different system than mount+fstab. Truthfully, I don't know exactly how it works, but I do know that it uses the HAL (Hardware Abstraction Layer), which is one step above udev, and provides applications with detailed device info, such as the volume name.

I *think* that if the device has an fstab entry, KDE uses it. If not, it uses a default /mount or /media location, with the volume name as the mount folder. You should be able to change the actions on the second kind by right clicking on the device in Konqueror and choosing properties > mounting.

Last edited by David the H.; 11-05-2006 at 05:24 AM.
 
Old 11-07-2006, 09:38 AM   #3
charmanr
LQ Newbie
 
Registered: Jun 2006
Location: Beijing
Distribution: Suse Linux 10.0 x86_64
Posts: 6

Original Poster
Rep: Reputation: 0
Hello David. I have had a look at the article and since I now know what I need to change I have been able to look up more information elsewhere.

For now this task is a little above me and I can't quite get my head around it. I will come back to it at a later date when I don't have other things to be getting on with. Like I said it is more an annoyance than anything else.

Many thanks for the pointer though.
 
  


Reply



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
fstab problem: mount: can't find dvd in /etc/fstab or /etc/mtab Nikon01 Slackware 5 11-17-2006 06:15 AM
mtab and fstab problems Henster Linux - General 4 08-31-2004 05:38 AM
/etc/fstab or /etc/mtab praveenv Linux - Newbie 1 08-17-2004 04:03 AM
use mtab as fstab?hi rgiggs Mandriva 5 06-08-2004 12:47 PM
How to reload fstab and mtab jon_k Linux - Software 2 06-03-2004 10:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 12:27 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