You are not logged in.

#1 2004-07-08 01:35:15

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

submount for 2.6 kernels PKGBUILD

Inspired by this discussion http://bbs.archlinux.org/viewtopic.php? … t=submount I tried to build the submount package. It seems that it works ok (stock arch 2.6.7 kernel, newest gcc and the rest). There is also some special version for 2.4 kernels. I don't have the time to try it but the build process shouldn't be much different really.

PKGBUILD

pkgname=submount
pkgver=0.9
pkgrel=1
pkgdesc="System for automatic mounting/unmounting of removable devices"
url="http://submount.sourceforge.net"
depends=('glibc')
install=install.submount
source=(http://belnet.dl.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz)
md5sums=('f6abac328dbfb265eff18561065575c6')

build() {
  cd $startdir/src/$pkgname-$pkgver/subfs-$pkgver
  make || return 1
  install -D -m644 -o 0 -g 0 $startdir/src/$pkgname-$pkgver/subfs-$pkgver/subfs.ko 
        $startdir/pkg/lib/modules/`uname -r`/kernel/fs/subfs/subfs.ko
  
  cd $startdir/src/$pkgname-$pkgver/submountd-$pkgver
  ./configure
  make || return 1
  make DESTDIR=$startdir/pkg install
}

install.submount

# arg 1:  the new package version
post_install() {
  depmod -a
  echo "--------------------------------------------------"
  echo "Submount for 2.6 kernel series is now installed."
  echo ""
  echo "Try to load the module with: modprobe subfs"
  echo "If you can see no error messages you can now mount"
  echo "a cd with:"
  echo "mount -t subfs /dev/cdroms/cdrom0 /mnt/cd -o fs=iso9660,ro"
  echo ""
  echo "If you put any subfs items in /etc/fstab the module"
  echo "will be loaded automatically (no need for placing it"
  echo "in your rc.conf or rc.local)"
  echo "Put this line:"
  echo "/dev/cdroms/cdrom0 /mnt/cd subfs fs=iso9660,ro"
  echo "in your /etc/fstab to allow automatic mounting of cds."
  echo ""
  echo "For more information about usage read online"
  echo "docs at http://submount.sourceforge.net"
  echo "man submount is also available "
  echo "--------------------------------------------------"
}
 
# arg 1:  the new package version
# arg 2:  the old package version
post_upgrade() {
  depmod -a
}
 
# arg 1:  the old package version
pre_remove() {
  /bin/true
}
 
# arg 1:  the old package version
post_remove() {
  depmod -a
}
 
op=$1
shift
$op $*

It's possible that install file should be extended especially  pre_remove and post_remove functions (to prevent problems with uninstalling of the running module, etc.) - any suggestions?

Submount is now a standard in suse distro. These 2 links can be useful for some people too:
http://portal.suse.com/sdb/en/2004/05/h … subfs.html
http://portal.suse.com/sdb/en/2004/05/t … diocd.html
I don't have suse installed but if you do have it please check the fstab and maybe other configs for subfs info and post it here as an example of usage.

EDIT: Changed the message in install.submount - no need for loading the module from rc.conf.

Offline

#2 2004-07-08 09:31:32

rensel
Member
From: Milan, Italy, Europe, Earth, S
Registered: 2004-06-20
Posts: 93
Website

Re: submount for 2.6 kernels PKGBUILD

If you add a "subfs" device to /etc/fstab you don't need to add the module to rc.conf. It will give an error (SUBFS: module already in kernel, or something like that). I think that when it mounts local partitions it automatically loads the module.


Arch GNU/Linux 0.7 Trusted User
"If I were more modest, I would be perfect"

Offline

#3 2004-07-08 10:42:17

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: submount for 2.6 kernels PKGBUILD

I can't check it right now but you are probably right. I'll change the install message.
EDIT: done. Thanks for the info.

Offline

#4 2004-08-01 21:04:49

IceRAM
Member
From: Bucharest, Romania
Registered: 2004-03-04
Posts: 772
Website

Re: submount for 2.6 kernels PKGBUILD

Does anyone use submount with udev?

I had it installed, seemed to work properly (except for the misconfigured samba shares I had). After fixing the samba shares and getting to udev, I kept having continous (every 3-4 secs) floppy & CD-ROM seeks (the others were mounted properly). After a while, I've also deactivated the samba shares, because it felt like it was getting slow because of that. It's been working great after giving up on submount.

Offline

#5 2004-08-01 22:07:36

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: submount for 2.6 kernels PKGBUILD

I'm using submount with udev (last week at least) and I didn't notice any abnormal behaviour. I'm not using samba - maybe this is the problem?

Could you provide more info (logs, fstab, etc.)?
What was doing these 3-4 secs seeks? Was it submount or samba or ....?

I noticed that if something tries to access for example my /mnt/cd and there is no cd disc inside the drive, submount just generates an error in dmesg/kernel log. But this - I think - is ok. It happens for example when I'm updating my locate database. Maybe samba was doing smething like this?

I see that you (?) asked a question on submount devel list http://sourceforge.net/mailarchive/foru … m_id=36245
I think this is the best place also to ask about udev.
If you find any usefull info please post it here or to the wiki too.

Offline

#6 2004-08-02 00:21:47

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: submount for 2.6 kernels PKGBUILD

BTW: I also found this which seems to be similar to your problem: http://lists.suse.com/archive/suse-linu … /3311.html

Offline

#7 2004-08-02 01:49:06

IceRAM
Member
From: Bucharest, Romania
Registered: 2004-03-04
Posts: 772
Website

Re: submount for 2.6 kernels PKGBUILD

In my case it I had both floppy and CDROM seeks. I had in the log file double entries. I will test further.
Meanwhile, I've added again only the floppy and the CDROM with subfs and it also didn't work properly. Test this:

cd /mnt/floppy (the subfs mount point of the floppy, no floppy inside)
lsof /mnt/cdrom (with or without cdrom inside)

I get ~1 full screen of error messages from submountd in the kernel log in only 1-2secs and tons of floppy seeks. What happens in your case?

That would be one strange thing... another one: Every time I put a CDROM inside and do "cd /mnt/cdrom", the CDROM is mounted and the FDD is also checked. I don't know if that's normal.

After reading e-mails from the MailList you've linked me to, I've decided to give it another go, with new KDE settings (preload Konqueror: off). Thanks for the link.

IceRAM

Offline

#8 2004-08-02 23:36:16

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: submount for 2.6 kernels PKGBUILD

I can't test submount with floppy because... I don't have a floppy in my desktop machine :-) sorry.

With lsof /mnt/cd and no cd inside I get this in my kernel log:

kernel: cdrom: open failed.
kernel: subfs: submountd execution failure. Error 256

but only once and only the first time I run this command. I can force it to generate another error message with cd /mnt/cd and ls but this is normal since there is no cd inside the drive. With cd inside I get no errors at all. It seems that submount is working fine with udev (for me at least).

I see that you are using kde and I'm using xfce4 now. If I get some more time I'll try to run it in kde too. Do you have any other wm? Maybe just standard X twm run with startx (with kde disabled)? This could help us eliminate troublemakers really. It looks like kde/konqueror is the source of your problems. Like it is generating constant drive checking (any drive icons on the desktop?) or some kind of infinity loop. Do these errors stop after some time? Do they do any harm to the system or they are just in error logs? Maybe konqueror is just too aggressive when checking /mnt subdirs?. It would be ok if it's only once but I have no idea why it's doing it so many times? With ls and empty drive I get "No medium found" - why konqueror can't interpret this? That would also explain why it wants to mount a floppy at the same time - putting a medium inside forces to refresh all /mnt ? - I'm not kde expert unfortunatelly. But I really think it's not submount+udev fault but it's kde related. Please, also post info how it works with konqueror preload turned off.

BTW: this is my fstab line for cd and subfs:

/dev/cdroms/cdrom0      /mnt/cd         subfs           fs=iso9660,ro           0       0

Is yours more or less the same?

Offline

#9 2004-08-03 00:23:39

punkrockguy318
Member
From: New Jersey
Registered: 2004-02-15
Posts: 711
Website

Re: submount for 2.6 kernels PKGBUILD

I added this package to my repo (ftp://punkrockguy318.no-ip.org)

good work lanrat


If I have the gift of prophecy and can fathom all mysteries and all knowledge, and if I have a faith that can move mountains, but have not love, I am nothing.   1 Corinthians 13:2

Offline

#10 2004-08-03 03:33:27

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: submount for 2.6 kernels PKGBUILD

Thanks. I added your repo to my pacman.conf too :-)

Offline

#11 2004-08-03 09:30:30

IceRAM
Member
From: Bucharest, Romania
Registered: 2004-03-04
Posts: 772
Website

Re: submount for 2.6 kernels PKGBUILD

First, I need to say that the submount site needs some real updating.
Second of all, I need to say that it works great when you disable "preload konqueror" in KDE - this SHOULD BE said somewhere on that site. Thanks again for the link to that maillist, lanrat.
Third... it would be nice if there was a Wiki page

I still can't explain why "cd /mnt/floppy && lsof /mnt/cdrom" produces so much floppy seeks.
My fstab entries:

/dev/cdroms/cdrom0      /mnt/cdrom    subfs fs=cdfss,ro,iocharset=iso8859-1,umask=0 0 0
/dev/floppy/0           /mnt/floppy   subfs fs=floppyfss,iocharset=iso8859-1,sync,umask=0 0 0

Thanks again for the package.
Current status: all working, including samba shares

IceRAM

Offline

#12 2004-08-03 22:49:53

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: submount for 2.6 kernels PKGBUILD

I agree, submount site should be updated but it's probably the infamous "lack of time" :-)
Great to know submount works now with kde after preload konqueror is off (yes - this should be mentioned on submount page.)

Gentoo has wiki page about submount http://wiki.gentoo-portage.com/HOWTO_Submount but in arch 80% of it can be summarized with pacman -S submount because it's now in punkrockguy318 repo :-) But feel free to start submount wiki if you want ;-) The real contents would be examples of usage, I think.

Now, after searching and browsing I also found that gentoo forums have few interesting posts about submount and automounting stuff.
Examples of mounting usb removable pendrives/usb sticks etc. (to be included in future submount wiki?):
http://forums.gentoo.org/viewtopic.php? … t=submount
http://forums.gentoo.org/viewtopic.php? … t=submount
I don't have any usb device like mentioned there so If someone test this please post some info.

Possible explanation of mysterious floppy/cd seeks in konqueor with suggestion about fam:
http://forums.gentoo.org/viewtopic.php? … t=submount

As you can see below others had same problems (no solutions though):
http://forums.gentoo.org/viewtopic.php? … t=submount
http://forums.gentoo.org/viewtopic.php? … t=submount

Many people also suggest to move to ivman (new user space automounter):
http://ivman.sourceforge.net/wiki/tiki-index.php
http://forums.gentoo.org/viewtopic.php?t=185508
but for the time beeing I think it's still not complete and tested and submount does the job for me fine. Maybe in a few months....

...or more "exotic" solutions like this:
http://ericlathrop.com/cdde/

I hope above information will also help others understand what and how to use automounting systems.

Offline

#13 2004-08-04 01:12:44

punkrockguy318
Member
From: New Jersey
Registered: 2004-02-15
Posts: 711
Website

Re: submount for 2.6 kernels PKGBUILD

Submount is no longer in my personal repo (I moved to a TUR).  For the submount package, add this to your pacman.conf

[punkrockguy318]
Server = ftp://ftp.archlinux.org/tur/punkrockguy318

If I have the gift of prophecy and can fathom all mysteries and all knowledge, and if I have a faith that can move mountains, but have not love, I am nothing.   1 Corinthians 13:2

Offline

#14 2004-08-04 09:59:19

IceRAM
Member
From: Bucharest, Romania
Registered: 2004-03-04
Posts: 772
Website

Re: submount for 2.6 kernels PKGBUILD

Well.. I used successfully submount for a day or so...
Untill cron.daily started.. and filled my log again with unsuccessful seeks & so on. I removed the floppy, rebooted, but still... it was seeking the CD (it caused short computer hangs). Removed it totally in the end.

It might have something to do with KDE (I'm almost sure about this). I have no idea when it seeks and why it seeks the fdd/cd. I'll read all the links you've posted. Thanks for the effort.

Offline

#15 2004-12-12 15:13:56

tgc
Member
From: DK
Registered: 2004-03-09
Posts: 96

Re: submount for 2.6 kernels PKGBUILD

Hi!

I'm trying to get submount to work, but i can't write to floppies, all i get is permission denied, even as root!  Should i use supermount instead?
This is my submount entries in fstab:

/dev/cdroms/cdrom0      /mnt/cd      subfs       fs=cdfss,ro, users      0 0
/dev/fd0                /mnt/floppy   subfs      fs=floppyfss,rw,users   0 0

Offline

#16 2004-12-12 16:00:16

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: submount for 2.6 kernels PKGBUILD

I don't have a floppydisk in my desktop box so I can't test it but official submount webpage advises to use something like this:

/dev/fd0 /mnt/floppy subfs fs=floppyfss,iocharset=iso8859-1,sync,umask=0 0 0

Or could this be about your udev permissions for floppy drive ?

Offline

#17 2004-12-12 17:13:40

Father
Member
From: Australia
Registered: 2004-06-01
Posts: 209

Re: submount for 2.6 kernels PKGBUILD

it seems youve also got a space in your fstab file before ``users''

/dev/cdroms/cdrom0      /mnt/cd      subfs       fs=cdfss,ro, users      0 0 

Offline

#18 2004-12-13 14:05:38

tgc
Member
From: DK
Registered: 2004-03-09
Posts: 96

Re: submount for 2.6 kernels PKGBUILD

Thx, the example you posted works. btw, i don't use udev

Offline

Board footer

Powered by FluxBB