You are not logged in.
Great utility, but need little dirty hack. I need that skvm would mount device, with *specific* label box2 on existing /media/box2 directory.
I need it, because i have big external hard, where i hold all arch packages, but often download packages into internal hard to /media/box2. Then i trow everything to external hard, mount it on /media/box2 and pacman is hapy
Offline
Great utility, but need little dirty hack. I need that skvm would mount device, with *specific* label box2 on existing /media/box2 directory.
I need it, because i have big external hard, where i hold all arch packages, but often download packages into internal hard to /media/box2. Then i trow everything to external hard, mount it on /media/box2 and pacman is hapy
Try to use e2label to change the label of your external drive so that skvm can pick up the label and use it as a mount point.
Last edited by dimigon (2009-10-04 01:09:01)
Offline
Sorry, i wasn't clear enough. External hard has label "box2", and it works as it should.
But, because, /media/box2 already exists, (there are stored local arch packages), program creates /media/sdd1. If i delete /media/box2, skvm mounts external hard on /media/box2.
I need that it *over mount my external hard with specific label box2* on /media/box2, like with simple mount command (but for all others devices, it should work as it works now). I need to add *exception for label "box2"*
Then, when i unmount external hard, on system would remain local arch packages.
Offline
Sorry, i wasn't clear enough. External hard has label "box2", and it works as it should.
But, because, /media/box2 already exists, (there are stored local arch packages), program creates /media/sdd1. If i delete /media/box2, skvm mounts external hard on /media/box2.I need that it *over mount my external hard with specific label box2* on /media/box2, like with simple mount command (but for all others devices, it should work as it works now). I need to add *exception for label "box2"*
Then, when i unmount external hard, on system would remain local arch packages.
I've hacked together your request. Replace the get_mount_point function in the original skvm code with the one shown below.
static char *
get_mount_point(const char *dev, const char *label)
{
const char *extra;
char *mountp, *dev_tmp;
size_t len;
struct dirent *dirent;
DIR *dir;
/* ** hack begins ** */
if (!strcmp(label, "box2")) {
len = strlen("/media/box2") + 1;
mountp = malloc(len);
if (!mountp)
goto err;
snprintf(mountp, len, "/media/box2");
return mountp;
}
/* ** hack ends ** */
err:
if (!is_mounted(dev) || !(dev_tmp = strrchr(dev, '/')))
return NULL;
++dev_tmp;
len = strlen(dev_tmp) + 1 + strlen(BASE_MNT_DIR);
extra = dev_tmp;
if (label && strcmp(label, "")) {
if ((dir = opendir(BASE_MNT_DIR))) {
dirent = readdir(dir);
while (dirent) {
if (!strcmp(dirent->d_name, label))
goto out;
dirent = readdir(dir);
}
}
len = strlen(label) + 1 + strlen(BASE_MNT_DIR);
extra = label;
}
out:
mountp = malloc(len);
if (mountp)
snprintf(mountp, len, "%s%s", BASE_MNT_DIR, extra);
return mountp;
}
Make sure you do not have a rule in /etc/fstab for this particular volume, because subsequent code in skvm will alter the mount point selected at this point. As it stands at the moment when ejecting the volume skvm will try to rmdir the directory, if it is not empty it will create a syslog entry. I am sure that is not a problem to you, but if it is then you can just alter the function device_removed(...) to exclude the call to rmdir.
Last edited by dimigon (2009-10-04 12:07:21)
Offline
Hello!
I've compiled skvm from AUR(version 0.1), add "skvm" to my rc.conf, then reboted few times, but it did not do anythings.
Before that, i've tryed some other programs for same purposes, but no one couldnot helped.
Help me pls, give some advicec maybe... and sorry for my poor English
my mp3 player is recognized as well, but usb flash drive - not...
ADD:
I decide this problem with my own.
Thank you for making so usefull program.:)
Last edited by abursuk (2009-10-09 20:06:30)
Offline
this is great, skvm is exactly what I've been looking for.
Offline
@dimigon:
Just tried skvm because PCManFM and Thunar were giving me some grief and skvm has worked beautifully for all the devices I have accessed so far. Many thanks for all your hard work on this incredibly useful daemon.
PS: I am using emelFM2 to access the mount points and unmount the devices.
Offline
First of all, thanks a lot for your work!
I try to automount with udev/hal, but I have this problem. Unfortunately, your program is not different. The mounted directory under /media is also owned by user and group root. Therefore as a normal user I cannot do anything on it.
Any thoughts?
Offline
Nice work! This is really a super volume manager you've made here.
Of course after that kind of start, this message can only contain a feature request
And here it comes:
Is it possible to listen for a eject-cd event from the dvd drive and then unmount and eject the disc? This would make it a bit more intuitive to use for cd-/dvd-roms.
Most people reach for the eject button on their dvd drives without even thinking about it
I tried looking at the source code, but I'm afraid it's a bit beyond my abilities.
MadEye | Registered Linux user #167944 since 2000-02-28 | Homepage
Offline
Nice work! This is really a super volume manager you've made here.
Of course after that kind of start, this message can only contain a feature request
And here it comes:
Is it possible to listen for a eject-cd event from the dvd drive and then unmount and eject the disc? This would make it a bit more intuitive to use for cd-/dvd-roms.
Most people reach for the eject button on their dvd drives without even thinking about itI tried looking at the source code, but I'm afraid it's a bit beyond my abilities.
What if you load the cdrom driver without tray locking?
Offline
What if you load the cdrom driver without tray locking?
That would be worth a try. But... Ehm... How do I load it without tray locking?
MadEye | Registered Linux user #167944 since 2000-02-28 | Homepage
Offline
modinfo cdrom
Running modinfo cdrom gives me the following:
filename: /lib/modules/2.6.31-ARCH/kernel/drivers/cdrom/cdrom.ko
license: GPL
depends:
vermagic: 2.6.31-ARCH SMP preempt mod_unload
parm: debug:bool
parm: autoclose:bool
parm: autoeject:bool
parm: lockdoor:bool
parm: check_media_type:bool
parm: mrw_format_restart:bool
I then changed my modules.conf file to this:
#
# /etc/modprobe.d/modprobe.conf (for v2.6 kernels)
#
options cdrom lockdoor=false
I restarted the computer, as a modprobe -r was not possible.
It doesn't work though. I am afraid I'm not smart enough to figure out how it's supposed to be done.
Can you give me a hint here?
MadEye | Registered Linux user #167944 since 2000-02-28 | Homepage
Offline
Thanks! That worked like a charm.
I just had to used lockdoor=0 in modprobe.conf. Figures! I knew I had done something stupid
MadEye | Registered Linux user #167944 since 2000-02-28 | Homepage
Offline
Thanks! That worked like a charm.
I just had to used lockdoor=0 in modprobe.conf. Figures! I knew I had done something stupid
Good! Nevertheless, keep in mind that ejecting drives that are being worked at is not safe.
Offline
Don't know what's happened exactly, but after today's pacman -Syu, skvm will only mount VFAT USB flash drives for me as root; users don't have write permission. (ext2/3 formatted devices seem okay however.) Tried tinkering (for example, adding umask and dmask parameters) with the #define DEFAULT_MNT_OPTIONS "noexec,nosuid,nodev,users" in skvm.c to no avail. Another computer, essentially identical but with slightly older versions, still has skvm working with VFAT drives as expected. Hal or dbus upgrades maybe responsible?
However, PCManFM and emelFM2 can mount the drives fine!
Offline
Don't know what's happened exactly, but after today's pacman -Syu, skvm will only mount VFAT USB flash drives for me as root; users don't have write permission. (ext2/3 formatted devices seem okay however.) Tried tinkering (for example, adding umask and dmask parameters) with the #define DEFAULT_MNT_OPTIONS "noexec,nosuid,nodev,users" in skvm.c to no avail. Another computer, essentially identical but with slightly older versions, still has skvm working with VFAT drives as expected. Hal or dbus upgrades maybe responsible?
However, PCManFM and emelFM2 can mount the drives fine!
I've no idea. Mine seems to work okay.
Offline
dimigon, why are you not using http://aur.archlinux.org/packages.php?ID=24244 ?
Offline
@dimigon:
Thanks for the email. I'm running 32-bit Arch on 32-bit systems.
Just checked what happens on my Eee PC, which has the older hal 0.5.13-2 and dbus 1.2.14-1:
I load up emelfm2 and look at the /media directory; I plug in my VFAT-formatted USB flash drive and it appears as /media/UDISK, owned by root/root with permissions drwxrwxrwx. Then I successfully create a test file on the drive which shows as owned by root/root, but with permissions -rwxr-xr-x, so therefore I can't delete the file as user!
So, it looks as though there are some odd things happening with VFAT drives even before the latest hal and dbus updates. Curiouser and curiouser; hope I'm not doing something gross ...
PS: It's not just one USB flash drive which is problematic - I have several to test, some brand new.
Offline
From playing around with DEFAULT_MNT_OPTIONS in skvm.c, I can get VFAT USB drives writable by user as expected (for example, by adding 'users,umask=111,dmask=00'), but then user can't access the directories below root on ext2 drives. So, it looks as though the problem may be that one set of DEFAULT_MNT_OPTIONS can't satisfy both ext2/3 and VFAT requirements at the same time.
I've found to test things out that you've really got to create and delete directories, sub-directories and files.
Offline
Hi,
I've been using wmii for quite a while, and ran into your tool here. I installed if from the AUR today, added it to my daemons, and rebooted -- yet it isn't mounting when I plug something in. I have tried several devices (usb drives, sd card, cd, dvd, you name it), but it just isn't mounting anything.
I made sure that the daemon is running, I ensured that hal is working (lshal -m), and also ran skvm -d, and it would appear that it is not receiving any messages (and yes, dbus is running.
Any suggestions?
thanks
Offline
Hi,
I've been using wmii for quite a while, and ran into your tool here. I installed if from the AUR today, added it to my daemons, and rebooted -- yet it isn't mounting when I plug something in. I have tried several devices (usb drives, sd card, cd, dvd, you name it), but it just isn't mounting anything.
I made sure that the daemon is running, I ensured that hal is working (lshal -m), and also ran skvm -d, and it would appear that it is not receiving any messages (and yes, dbus is running.
Any suggestions?
thanks
Are you on a x86_64 system?
Offline
scire wrote:Hi,
I've been using wmii for quite a while, and ran into your tool here. I installed if from the AUR today, added it to my daemons, and rebooted -- yet it isn't mounting when I plug something in. I have tried several devices (usb drives, sd card, cd, dvd, you name it), but it just isn't mounting anything.
I made sure that the daemon is running, I ensured that hal is working (lshal -m), and also ran skvm -d, and it would appear that it is not receiving any messages (and yes, dbus is running.
Any suggestions?
thanksAre you on a x86_64 system?
Yes, I am.
Offline
thank you for this wonderful tool. I used udev automount before but things like deleting the directory when unplugging the usb device never worked for me.
With yout tool everything works.
To the previous poster, I also have x86_64 and had no problem.
You might want to use the latest version from suckless.org (in /tools) as the AUR version is rather old. It contains a PKGBUILD file so installing is very simple:
1. unzip it
2. makepkg -s
3. pacman -U yournewpackagefile.pkg.tar.gz
Offline