I can mount partitions that aren't in fstab by using kwrite

Well this is a strange thing! I have SUSE 11.1, SUSE 10.3 and Gentoo on by box, I just installed 11.1 and decided to copy over fstab from 10.3 as the 11.1 I had just installed went into the partitions of an old 10.3 installation I figured I would not need to make any changes to the fstab as it was already configured to mount all my partitions.

Firstly I thought I’d edit the 11.1 fstab to add my 10.3 root partiton so I could mount it and get at fstab, I did a ‘kdesu kwrite’, then went to the open file dialogue and noticed that the root partition for my 10.3 installation was listed so I had a click and found I could get straight to my old fstab. By now I was intrigued so I jumped up the tree and found at the top my /home, /root, and /store partitions from the 10.3 installation all contents and all users, including /root fully available! None of these partitions are mentioned in the virgin 11.1 fstab!

Next I tried a ‘kdesu konqueror’ and found my 10.3 partitions in /media . Then I did a ‘umount’ on /dev/sdc3 which worked but when I tried to mount it again I was informed…

“mount: can’t find /dev/sdc3 in /etc/fstab or /etc/mtab”.

So I went back to kwrite and tried to open the partition from there, a little rumble from my hard disk and there it was again. Went back and tried a mount /dev/sdc3 and got a…

“mount: according to mtab, /dev/sdc3 is already mounted on /media/Home_sdc3_100GB”

Am I missing something, a new function in 11.1 perhaps or is this just weird? I’ve been running various Linux’s for ten years and normally the only problem has been getting partitions to mount!:slight_smile:

I should add that none of the Gentoo partitions are available.

Personally I think this might be a serious security issue so please feel free to delete this post mister moderator! :slight_smile:

Many thanks to anyone who can cast a little light on this for me!

Did you use the same /home partition for both distros and login with the same home directory?
If so, it could be that it is still seeing entries from the 10.3 config.
Try again using a newly created user.
I found that some things work unexpectedly using a common /home/username enty for all distros.

No I didn’t use the same /home. I have three HD’s with one OS on each the only common ground they share is the /swap which used to reside on it’s own HD but now lives on the Gentoo HD in this case sda.
This is bizzare it shouldn’t be possible but I can repeat it again and again!

You better post the contents of the original /etc/fstab of both 10.3 en 11, because your story is a bit without facts.

Your mounting point “/media/Home_sdc3_100GB” means, that the mounting procedure was not performed my “mount” using /etc/fstab but by udev using its own rules and autofs. Both is very useful for automounting USB-sticks or CDs. May be you have a look at “man udevadm”. You may edit the rules located in /etc/.udev which allows you to declare specific group and user permissions.

autofs in configured in /etc/sysconfig/autofs.

These are hints up to now. Takes some time, to go into deeper contemplations. See this

udev is targeted at Linux kernels 2.6 and beyond to provide a userspace solution for a dynamic /dev directory, with persistent device naming. The previous /dev implementation, devfs, is now deprecated, and udev is seen as the successor.

at Writing udev rules

You may come back for more discussion (although I am not a udev rules specialist)

HTH

Right you are, here are the contents of my two fstabs. I think they are fine though and that veti below is on the right line with udev.

From SUSE 11.1
/dev/disk/by-id/ata-Maxtor_6E030L0_E1J4QXTE-part1 /boot ext3 acl,user_xattr 1 2
/dev/disk/by-id/ata-Maxtor_6E030L0_E1J4QXTE-part2 / ext3 acl,user_xattr 1 1
/dev/disk/by-id/ata-Maxtor_6E030L0_E1J4QXTE-part3 /home ext3 acl,user_xattr 1 2
/dev/disk/by-id/ata-SAMSUNG_SP0411N_S01JJ70Y304542-part2 swap swap defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0

From SUSE 10.3
/dev/disk/by-id/scsi-SATA_SAMSUNG_SP2504CS09QJ1CLB14007-part1 /boot ext3 acl,user_xattr 1 2
/dev/disk/by-id/scsi-SATA_SAMSUNG_SP2504CS09QJ1CLB14007-part2 / ext3 acl,user_xattr 1 1
/dev/disk/by-id/scsi-SATA_SAMSUNG_SP2504CS09QJ1CLB14007-part3 /home ext3 defaults 1 2
/dev/disk/by-id/scsi-SATA_SAMSUNG_SP0411NS01JJ70Y304542-part2 swap swap defaults 0 0

/dev/disk/by-id/scsi-SATA_SAMSUNG_SP2504CS09QJ1CLB14007-part4 /mnt/sdc4 ext3 auto 0 0

/dev/disk/by-id/scsi-SATA_Maxtor_6E030L0_E1J4QXTE-part1 /mnt/hdb1 ext3 noauto 0 0
/dev/disk/by-id/scsi-SATA_Maxtor_6E030L0_E1J4QXTE-part2 /mnt/hdb2 ext3 auto 0 0
/dev/disk/by-id/scsi-SATA_Maxtor_6E030L0_E1J4QXTE-part3 /mnt/hdb3 ext3 auto 0 0

/dev/disk/by-id/scsi-SATA_SAMSUNG_SP0411NS01JJ70Y304542-part1 /mnt/sda1 ext2 noauto 0 0
/dev/disk/by-id/scsi-SATA_SAMSUNG_SP0411NS01JJ70Y304542-part3 /mnt/sda3 ext3 auto 0 0

proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
usbfs /proc/bus/usb usbfs noauto 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0
/dev/fd0 /media/floppy auto noauto,user,sync 0 0

Veti thanks for the pointer,I think you are proberbly right about udev. I didn’t notice where the ‘mount’ had said my file was already mounted! I have had a look at /etc/sysconfig/autofs and been to Writing udev rules. Lot of intresting info there but I didn’t manage to work out why Kwrite in su should be able to call up my other HD’s and leave them available to non root users.

I’ve had a fiddle about and found that I can enter user directories on all OS’s but can only read/copy files as a normal user unless I have previously been there as root in which case I seem to be able to do just anything I want!! This doesn’t happen elswhere in the file system there I can only read things, do ctrl-a, ctrl-c and then go to a user folder create a txt file and ctrl-p what I had just ctrl-c’d elsewhere, contents of /etc/passwd for example!

None of this seems right to me. At the moment I’m the only person using this box but that’s not always the case.

The device names /dev/disk/by-id/*** are examples for naming of devices, generated by Udev.

In your case, the automounter of the KDE desktop connects to the D-Bus, which asks HAL about new devices. HAL knows about them because of Udev told it to HAL.

That’s the chain, so far, for short.

If you want to make sure, that mounting is restricted to specific users, you have to do that at the Udev rules level.

In your example, it looks like when starting kwrite, a D-Bus scan is initiated, which then gets told about unmounted devices from HAL and mounts them to /media/Udev-name. This is very useful for desktop single user PCs.

As this chain is much too complex for my experience (I tried to establish automount from level 3, whithout any desktop, and had a hard way to go through this chain) I guess, this thread could better be moved to the Applications section for more audience.
At least, you are on your way, I hope. :wink:

Right Veti I see what you are getting at but I think it is strange that kwrite should be able to mount partitons that aren’t mentioned in SUSE 11.1 fstab. What I think I shall try is to comment out the /dev/dev/disk/by-id/*** entries and re-write fstab the traditional way /dev/sda1, /dev/sda2 and so on and see if that changes the situation.
By the way thanks very much for your help and intrest and yes I am on my way I think :slight_smile:

Well, your decision for renaming your devices in /etc/fstab should, at least, be commented. :wink:

Because the naming is relevant to different issues, which are discussed in this section Install/Boot/Login. No matter, what names you use, Udev will have created them at startup. When looking into the /dev/disk/ folder, there are folders ./by-id/ ./by-label/ ./by-path/ ./by-uuid/. Each of them contains links to /dev/sdxy devices, created by Udev.

When you want to use the /dev/sdXY naming, consider, what happens, if you add another hard disk into your system. The /dev/sdXY may change, according to the booting sequence. This will not happen, when using one of the names in the /dev/disk/by-something/ folders. However, these names might change when the partition tables are altered. It is less efford, just to change the end of the name /dev/disk/by-id/whatever-part2 than to figure out, if the booting order was maintained. Very important for external hard drives attached!

To my knowledge, the worst solution is the use of /dev/disk/by-uuid. Theses names are universally unique and you will never mix up these drives whith any other drive in the world. But the names are not stable. They change, when, for example, you resize the partition. Opensuse likes to use these names for the entries in grub’s menu.lst. This will lead to a desaster, when you manually fiddle with your hard disks. So I prefer to use the /dev/disk/by-id/names throughout all of my tables, because they proved to be more robust, when a scatterbrain as I am, once again handled with the screw driver.

So, the use of Udev names should be considered carefully. But - well - you will do that, for sure!

this may help you
how to access windows ntfs partitions - openSUSE Forums

I would have a look at your PolicyKit config with respect to automounting. This can be used to prevent user access if required.

cat /usr/share/PolicyKit/policy/org.freedesktop.hal.storage.policy

Have a read of ](http://hal.freedesktop.org/docs/PolicyKit/model-theory-of-operation.html)