You are not logged in.

#176 2012-11-22 15:03:12

TheLemonMan
Member
From: Italy
Registered: 2011-09-04
Posts: 214
Website

Re: ldm - Lightweight Device Mounter

Sure, this weekend il fix up the last couple of things and release a new stabile big_smile

Offline

#177 2012-11-22 15:06:17

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,845

Re: ldm - Lightweight Device Mounter

TheLemonMan wrote:

Sure, this weekend il fix up the last couple of things and release a new stabile big_smile

Many thanks. smile


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#178 2012-11-24 01:32:46

gogi-goji
Member
From: Canada
Registered: 2009-10-20
Posts: 73
Website

Re: ldm - Lightweight Device Mounter

I've been using ldm for a while now, and it's been totally fantastic for automounting my usb key.  However, today I noticed an issue.  When I shut down my computer, any devices that have been mounted in /media do not get removed.  Then, when I bring my computer back up, I'm left with a bunch of root-owned directories and my devices are automounted as devicename_.  This can quickly get unruly:

$ ls /media/
home  home_  home__  home___  home____  root  root_  root__  root___  root____  tmp  tmp_  tmp__  tmp___  tmp____  var  var_  var__  var___  var____

In that instance, only the ones with four underscores has anything in it and is owned by my user.  The rest are empty root-owned directories.  This does not seem to happen with my usb key, only these devices (home, root, tmp, and var are all luks-on-crypt partitions).

I'm using lmd-git, and running ldm through the systemd service.  USER_GID and USER_UID are set correctly in /etc/conf.d/ldm.  I'm not sure if this behavior existed before because a) I haven't rebooted my machine in absolute ages and b) I just transitioned to systemd so I'm not sure it that factors in, as I didn't notice this before the transition and I'm totally moved over to systemd now.

I'd be happy to help troubleshoot this some more, I'm just not sure how to help.  =P


My (sporadically updated) blog
My miscellaneous dotfiles

Offline

#179 2012-11-28 08:03:52

prazzb
Member
Registered: 2012-10-12
Posts: 14

Re: ldm - Lightweight Device Mounter

gogi-goji wrote:

I've been using ldm for a while now, and it's been totally fantastic for automounting my usb key.  However, today I noticed an issue.  When I shut down my computer, any devices that have been mounted in /media do not get removed.  Then, when I bring my computer back up, I'm left with a bunch of root-owned directories and my devices are automounted as devicename_.  This can quickly get unruly:

$ ls /media/
home  home_  home__  home___  home____  root  root_  root__  root___  root____  tmp  tmp_  tmp__  tmp___  tmp____  var  var_  var__  var___  var____

That is because this is ldm(m for mounter)... it doesn't unmount ..... use pumount to unmount EVERYTIME (pmount from community).... may be a bit of work but for the elegance ldm provides... that's worth

Offline

#180 2012-11-28 11:52:04

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,845

Re: ldm - Lightweight Device Mounter

This might be useful: https://bbs.archlinux.org/viewtopic.php … 5#p1118515 you can bind it to a key combo in your wm or Xbindkeys. See the follow up posts for removing the need for sudo.

I also use it with a dunst: https://bbs.archlinux.org/viewtopic.php … 4#p1118504 which pretty much resolves my mount/umount needs.

Last edited by skanky (2012-11-28 11:56:20)


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#181 2012-11-28 13:49:51

TheLemonMan
Member
From: Italy
Registered: 2011-09-04
Posts: 214
Website

Re: ldm - Lightweight Device Mounter

I pushed some fixes the other day, should fix the strange characters issue

Offline

#182 2012-12-01 15:03:11

prazzb
Member
Registered: 2012-10-12
Posts: 14

Re: ldm - Lightweight Device Mounter

TheLemonMan wrote:

I pushed some fixes the other day, should fix the strange characters issue

The new patch is giving me problems with ext4 partitions.... an ext4 partition on my drive and an ext4 usb drive

dmesg gave this

 EXT4-fs (sdc): Unrecognized mount option "Q_\xffffffb7" or missing value 

can anyone else confirm this so that i can confirm that my system is at fault and not ldm

Offline

#183 2012-12-01 16:09:09

TheLemonMan
Member
From: Italy
Registered: 2011-09-04
Posts: 214
Website

Re: ldm - Lightweight Device Mounter

Silly me, I rushed the fix and forgot a silly error in the code. Will fix asap tongue

Offline

#184 2012-12-02 02:36:06

duthils
Member
Registered: 2011-11-27
Posts: 2

Re: ldm - Lightweight Device Mounter

Hey there, thanks a lot for ldm, exactly what I needed.

On my machine, starting the latest git version of ldm makes it crash with segfault. Here's the backtrace if it can help:

(gdb) bt
#0  0x00007ffff77090d6 in __strcmp_sse42 () from /usr/lib/libc.so.6
#1  0x0000000000402048 in filesystem_quirks (fs=0x609b80 "LVM2_member") at ldm.c:189
#2  0x000000000040268e in device_mount (dev=dev@entry=0x60d890) at ldm.c:401
#3  0x000000000040295c in mount_plugged_devices (udev=udev@entry=0x606340) at ldm.c:535
#4  0x0000000000402d50 in main (argc=<optimized out>, argv=<optimized out>) at ldm.c:698

Skipping the last commit (bbbde5c) solves the problem.
I have LVM set up on one of my disk partitions.

Offline

#185 2012-12-22 16:36:56

Karl_Yeurl
Member
Registered: 2011-02-28
Posts: 27

Re: ldm - Lightweight Device Mounter

Hi, I'm using ldm with systemd on awesome. Almost nothing else is installed (there isn't any DM, I've installed some apps I need and that's all). The system has been completely reinstalled a month ago.
I wanted to add some easy way to mount and unmount devices. ldm seemed to be the easiest clean way to have automounting features. And I kind of like it.

I'm also using thunar, but obviously, there is some problems with permissions : if I want to unmount a device, it fails. It says: umount: /media/DISKNAME: umount failed: Operation not permitted. The same message displayed when I'm running umount through the CLI without root privileges.

Is there a way (again, the cleaner the better) to allow my user to unmount devices without having to run sudo umout /media/foo in the command line?

Edit. — Typo. Also, that *might* be an issue related to thunar, of course, but I guess people reading this topic are aware of the problem and know how to circumvent it.

Last edited by Karl_Yeurl (2012-12-22 16:39:24)

Offline

#186 2012-12-23 01:11:52

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,058

Re: ldm - Lightweight Device Mounter

I don't think ldm has user unmounting capabilities.

Offline

#187 2012-12-23 12:18:25

Karl_Yeurl
Member
Registered: 2011-02-28
Posts: 27

Re: ldm - Lightweight Device Mounter

I'm aware of that. The thing is that before my reinstall, I could mount/unmount drives without root privileges through Thunar in awesome. Now I can't anymore: I'm missing something (maybe I'm not part of the right group, or there's some extra software I'm not aware of which was granting me permissions I don't have anymore). I'm kind of asking this because I guess most people using ldm are likely to have had the same issue than me (since they're not using the automatic thingy from Gnome/KDE/Whatever). Either they lived with it or they found a fix, which I'm interested in.

There would be this radical solution of modifying umount's permissions, but I really don't want to do that.

Offline

#188 2012-12-23 14:02:52

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,058

Re: ldm - Lightweight Device Mounter

Karl_Yeurl wrote:

I'm aware of that. The thing is that before my reinstall, I could mount/unmount drives without root privileges through Thunar in awesome. Now I can't anymore: I'm missing something (maybe I'm not part of the right group, or there's some extra software I'm not aware of which was granting me permissions I don't have anymore).

Run "loginctl show-session $XDG_SESSION_ID" and check if you have Active=yes. You also need to have polkit installed. That should give you the right permissions.

Offline

#189 2012-12-24 04:16:43

prazzb
Member
Registered: 2012-10-12
Posts: 14

Re: ldm - Lightweight Device Mounter

No need of polkit.I don't have it installed
Try the package thunar-volman that ships with thunar.. I don't use it
may be thunar can't unmount with user privileges
best option is to use udevil ( as pmount is in aur now )

Offline

#190 2012-12-24 15:18:33

shetland_breeder
Member
From: England
Registered: 2010-05-17
Posts: 57
Website

Re: ldm - Lightweight Device Mounter

There's a bug in LDM on 64-bit machines whereby LDM crashes at line 189 with a segfault when a new drive is created e.g by partitioning a drive with fdisk.

The code at lines 175 to 189 is defective: the computation of the number of elements in fs_table doesn't work if the structure is packed with an alignment greater than the size of the 'quirks' element. On arch_64 the total size of the array is 112 bytes and the sum of *name and quirks is 12 bytes. So the loop runs for 9 iterations instead of 7 and passes null to strcmp.

The structure should be typedef'd, then the calculation will always work regardless of alignment. 

That code should be re-written like so:

    typedef struct {
        char *name;
        int quirks;
    } fs_entry_t;
    
    static const fs_entry_t fs_table[] = {
        { "msdos" , QUIRK_OWNER_FIX | QUIRK_UTF8_FLAG },
        { "umsdos", QUIRK_OWNER_FIX | QUIRK_UTF8_FLAG },
        { "vfat",   QUIRK_OWNER_FIX | QUIRK_UTF8_FLAG },
        { "exfat",  QUIRK_OWNER_FIX | QUIRK_UTF8_FLAG },
        { "ntfs",   QUIRK_OWNER_FIX | QUIRK_UTF8_FLAG },
        { "iso9660",QUIRK_OWNER_FIX | QUIRK_UTF8_FLAG },
        { "udf",    QUIRK_OWNER_FIX },
    };

    for (i = 0; i < sizeof(fs_table)/sizeof(fs_entry_t); i++) {
        if (!strcmp(fs_table[i].name, fs))
            return fs_table[i].quirks;
    }

Pete

Offline

#191 2013-01-15 15:07:03

TheLemonMan
Member
From: Italy
Registered: 2011-09-04
Posts: 214
Website

Re: ldm - Lightweight Device Mounter

Fixed smile Sorry for the delay but I've been really busy lately. Next time report it on github so I won't forget smile

Offline

#192 2013-02-16 10:15:34

TheLemonMan
Member
From: Italy
Registered: 2011-09-04
Posts: 214
Website

Re: ldm - Lightweight Device Mounter

It took some time but ldm 0.4 is out in the wild. It sports a brand new blacklisting feature and lots of bugfixes big_smile
What are you waiting for? Go and grab it!
(I've just emailed Rolinh, the pkgbuild mantainer, to bump the version. If you can't wait use the -git version *whoo bleeding edge*)

Offline

#193 2013-02-20 21:13:49

tonin
Member
Registered: 2013-02-20
Posts: 10

Re: ldm - Lightweight Device Mounter

Hello all.

I just try ldm in our "custom" ligthweigth linux for our university classrooms. We had a custom udisks wrapper in bash but it have problems with cd polling with udev 151 and udisks-1. After upgrade udev to 174 and compile udisks2, the madness of changes in "udisksctl monitor" output make the script unusable.

So we decided to uninstall all udisks shit and use an alternative as ldm. A very nice an simple tool.

All is ok, but doing "stress test" (pluging and unpluging quickly pendrives) we see the problem with bad unmounted drives that generate multiple mounts with underscores as prazzb said in this post.

Also sometimes ejecting a CD causes segfaults after umount /dev/sr0. Debugging for a while it seems a bug in udev that returns a pointer out of bounds sometimes, but it's only a preliminary test.

Before to try to debug in depth, can you tell me the udev and libmount versions that seems to be stable with ldm?

Regards.

P.D: Excuse my poor english.

Last edited by tonin (2013-02-20 21:14:29)

Offline

#194 2013-02-20 21:36:07

theGunslinger
Member
Registered: 2011-05-20
Posts: 300

Re: ldm - Lightweight Device Mounter

As said before it says Device Mounter, use something else for unmounting. Why do you use umount /dev/sr0? It's a block device not a partition/directory. Unmount /mnt/cdrom or whatever location your cd files are being mounted.

Last edited by theGunslinger (2013-02-20 21:37:24)

Offline

#195 2013-02-20 21:57:00

tonin
Member
Registered: 2013-02-20
Posts: 10

Re: ldm - Lightweight Device Mounter

theGunslinger wrote:

As said before it says Device Mounter, use something else for unmounting. Why do you use umount /dev/sr0? It's a block device not a partition/directory. Unmount /mnt/cdrom or whatever location your cd files are being mounted.

Hmmm, ldm 0.4 automagically umount cdrom when it's ejected, I'm not doing nothing special.

I said that /dev/sr0 was umounted because I put a printf before the conflictive line of code that segfaults to see the parameter and this was /dev/sr0. Any way, the real device is /dev/sr0 in my test computer, /dev/cdrom or /dev/dvd are links as udisksctl or udevadm informs.

regards.

Offline

#196 2013-02-22 12:41:08

tonin
Member
Registered: 2013-02-20
Posts: 10

Re: ldm - Lightweight Device Mounter

The problem is in device_umount with cdroms only.  As TheLemmonMan say in the comment, when using eject the remove command is issued 2 times. The first have a right udev_device struc in dev argument. The second call have a dev pointer inbound, but  the members of the struct are out of bounds, so the udev_device_get_devnode call segfaults, at least with udev 174.

Offline

#197 2013-02-22 20:54:50

TheLemonMan
Member
From: Italy
Registered: 2011-09-04
Posts: 214
Website

Re: ldm - Lightweight Device Mounter

hrm, i couldn't reproduce it here sad The dev pointer is always valid, at least udev should always return valid ones...Can you send me a nice gdb backtrace (compile it with make debug to get meaningful infos smile ?

Offline

#198 2013-02-22 21:57:07

tonin
Member
Registered: 2013-02-20
Posts: 10

Re: ldm - Lightweight Device Mounter

Here it's:

(gdb) backtrace
#0  __strcmp_sse4_2 () at ../sysdeps/i386/i686/multiarch/strcmp-sse4.S:250
#1  0x08049e3c in device_search (
    devnode=0x7665642f <Address 0x7665642f out of bounds>) at ldm.c:299
#2  0x0804a358 in device_unmount (dev=0x8df3770) at ldm.c:490
#3  0x0804a4df in check_registered_devices () at ldm.c:549
#4  0x0804abf3 in main (argc=3, argv=0xbf812c14) at ldm.c:788

To force the error ASAP it's better to start with a cd in the drive *before* starting ldm.

To stress ldm I use this script:

while [ 1 ]; 
do
     eject  /dev/sr0
    sleep 5
    df -t iso9660
    echo Closing tray
    eject -t /dev/sr0
    sleep 20
    df -t iso9660
    echo Opening tray
done

I can avoid the error checking if dev->devnode isn't NULL before calling udev_device_get_devnode. I must to include the struct udev_device definition from libudev_device.c to avoid "dereferencing pointer to incomplete type" compiler error, because this struct is "opaque" using only udev includes.

Another problem is that  many open/close cycles ldm stop mounting the cdrom ....

Offline

#199 2013-02-23 11:15:20

TheLemonMan
Member
From: Italy
Registered: 2011-09-04
Posts: 214
Website

Re: ldm - Lightweight Device Mounter

Meh, I could reproduce it just once, while gdb wasn't attached...Anyway a simple check for null values should be enough.
Could you dump the devpath (using udev_device_get_devpath) for the device with the NULL devnode ?

Offline

#200 2013-02-23 13:45:09

tonin
Member
Registered: 2013-02-20
Posts: 10

Re: ldm - Lightweight Device Mounter

Yes, but it must be at monday. I use a computer to test it at work and it seems to be off now.

The behaviour is so rare, if you use valgrind then never segfault. Running with gdb the probability as you say is lower, but I got some segfaults with gdb also. I suspect as valgrind show that there should be some free in not allocated memory pointers ...

I'll send more info after weekend.

Regards.

Offline

Board footer

Powered by FluxBB