Udisks2: mount only usb flash

Hello, Arch users!
How can I configure udisks2 to permit mounting only usb flash drives and similiar for users in "storage" group, not internal drives?
Here are the contents of my /etc/polkit-1/localauthority/50-local.d/10-storage-group-mount-override.pkla:
[storage group mount override]
Identity=unix-group:storage
Action=org.freedesktop.udisks2.filesystem-mount-system
ResultAny=no
ResultInactive=yes
ResultActive=yes
Or I must create another group "storage-flashonly" for this and configure something for it?
My use-case: I want to protect guest users from mounting my windows partitions, but allow them automounting of their usb flash drives.
Any thoughts aprreciated.
Last edited by dontbugme (2012-05-26 02:28:00)

Change Action line from
Action=org.freedesktop.udisks2.filesystem-mount-system
to
Action=org.freedesktop.udisks2.filesystem-mount
and it will be mount only removable devices, internal drives won't be mounted

Similar Messages

  • 10.5.1:  Unable to mount a USB flash drive.

    I've seen this problem posted elsewhere, but so far I have yet to see a solution:
    After upgrading my MacBook Pro to 10.5.1, it can no longer mount USB flash drives. They show up in System Profiler as well as the USB Probe tool, but do not show up in Disk Utility (and, obviously, not on the Desktop or listed in /Volumes).
    I checked the drives on a co-worker's MBP, also running 10.5, and the problem persisted there. The drives mount and work fine under 10.4, as well as various flavors of Windows. When plugged into the MBPs, the status LEDs light up, so they are getting power, and mice plugged into the USB ports work fine.
    So, the problem seems to be specific to mounting a USB flash drive in 10.5/10.5.1. I'm not sure if this is specific to MacBook Pros, or if the issue is the same on all 10.5 machines.
    Any help would be appreciated.

    I have the USB problem. When I insert my USB memory pen, it flashes then stops. The icon doesn't come up on the Desktop, but the memory shows up on the System Profiler.
    My USB telephone responds in Skype, but the sound input and output don't show up in Preferences, and so the phone doesn't work.
    My Vodaphone USB internet modem won't connect.
    This morning, I have no sound at all.
    All these problems are resolved if the computer is restarted with the external source already plugged in, but it's a big hassle and must be solvable............

  • OS refuses to mount external USB flash drive. Says a piece of OS software is missing.

    OS refuses to mount external USB flash drive. Says a piece of OS software is missing. The flash drive (thumb drive) usually lights up but does not go through the flashing on/off that was tyjpical when first inserting it.
    I tried an external hard drive and got the same results; that is, no result, as if it wasn't connected. No icon appears on the desktop and no device shows up in the sidebar. It (10.6.8, Mac Pro Duo) had worked perfectly before this, of course.

    Hmmmmm,,,,
    Disconnected all peripherals. Did a Safe Mode startup and that worked fine. Very limited features, of course.
    Started up with the Snow Leopart (10.6.3) disk. Used disk utility to verify permissions and ran disk repair on all three internal HDs. No repairs needed.
    Ran Drive Genius and did the same things, as a double-check.
    Plugged in the flash drive (thumb drive) and it came up fine (still operating the OS from the Sno-Leop disk). 
    I wanted to re-start with the disk and bring up the Apple Hardware Test as you suggested. I had lots of kernal panics on a previous machine, a G4 desktop, and has used that at that time (with a 10.2 or 10.4 disk). thought I remembered that you hold the D key down when starting up from the disk and it would open the hardware test, but either I remember wrong or it works different in 10.6 because it was just a normal startup.
    How do I get to the Hardware Test on the 10.6 Snow Leopard disk?
    Restarted without the disk and the Mac Pro desktop still showed the gray screen with what Apple calls the "prohibitory" sign, the circle with the diagonal line in it.
    I decided to load the OS disk onto HD 3 and designate that as the startup disk, which I did and it works fine. The USB flash drive loads properly, opens, etc. just as it should. I haven't yet plugged in the peripherals (scanner, printer, second DVD/CD recorder, tablet, an external drive, or connected to ethernet yet. Will do those one at a time and see if any of them casued a problem.)
    Am I right in thinking:
    A) HD One might have bad sections. I didn't defrag with Drive Genius (26% fragged) or look for bad blocks, which I'll probably do tonight.
    or B) the OS has been slightly corrupted and may need reloading
    or C) I have a virus or conflict (though I haven't added anything new lately). I do have the ButtonManager loading problem for Mac. which is talked about on MacRumors site, etc. but the timing of its appearance and this problem don't match.
    Apologies for being so wordy; want to get all information that may be helpful. I appreciate your interest.

  • Mount a USB flash drive from a shell

    I am about six months new to Linux; I have installed my first arch system but not yet installed a desktop environment.  I am trying to mount a USB flash drive from the shell but I am not having much luck.  I have tried following the instructions in the archwiki, http://wiki.archlinux.org/index.php/USB_Storage_Devices. I am having a problem with the following command:
    mount -t vfat /dev/sda1 /mnt/usbstick
    I get an error message saying that the mount point does not exist.  I have in the /mnt directory the following:
    cd cdrom dvd fd0 f1
    (I am not sure what fd0 and fl are, if somebody could please tell me I would appreciate it.  Also I do not have a DVD-ROM on my computer is the dvd listed by default or do I have a package installed I do not need?)  I did some searching online and came across the following site, http://linuxcommando.blogspot.com/2007/ … -from.html. I followed the instructions to identify the correct partition name corresponding to the USB drive by running the following command:
    grep SCSI /var/log/messages.log
    and I get the following results:
    Dec 30 22:16:17 morgan-desktop scsi2 : SCSI emulation for USB Mass Storage divices
    Dec 30 22:16:22 morgan-desktop sd 2:0:0:0: [sdb] Attached SCSI removable disk
    The next steps in the instructions are to mount the partition to the existing mount point (directory) by using the following command.
    mkdir -p /mnt/myusb
    mount -t vfat -o rw,users /dev/sda1 /mnt/myusb
    This is where I am having a problem, I do not understand the results and how to proceed to the next step, please help me.
    One other small question what is the best command to shut down the computer as a normal user?
    Thank you
    Morgan Smith

    Ok, Lots of different advice here, let's see if I can explain it all together, and clear up a few bits...
    I'll try to explain why I'm saying what I am, it doesn't matter if you don't follow it all, commands are below.
    You are on the right lines here, but a few things missing.  Firstly, to mount the USB stick you are using the correct command, but the locations are a problem.  The command is "mount -t type what/to/mount where/to/mount".   You can find out more about the mount command with "mount --help" or "man mount"
    You have correctly identified type as vfat - this means the pen is formated as FAT.
    To find out what to mount, you can check /var/log/messages.log, the second command you posted searches trough that file and prints out lines including the phrase SCSI, and the result tells you that a usb storage device had been attached as sdb, so the correct device is /dev/sdb1.  Storage devices are named sda sdb sdc etc in the order they are attached, and the numbers refer to the partitions on the disk.
    You can mount it anywhere you want, as any existing directory, but the one you tried to use /mnt/usbstick doesn't exist, so create it, using mkdir.
    The commands you need therefore are:
    mkdir /mnt/usbstick
    mount -t vfat /dev/sdb1 /mnt/usbstick
    This will work as root.  There is also, as byte said, a program called pmount (which you can get with pacman -S pmount) which works the same way for a standard user.
    Finally, there are also a number of tools like HAL which can be used to automate the process.
    As for shutting down, as has been said you must be root or in the power group, then you can use 'halt' 'poweroff' 'reboot' or 'shutdown'. All have slightly different effects, and poweroff is probably the easiest.
    Hope this helps
    Jack

  • Mount a USB Flash Drive

    I am running a 1998 iMac with a PowerPC Processor. It has MacOS 8.5.1. I have a PNY 2 GB USB Flash Drive. How do I mount this.

    The link says it won't work with G3(which is what I have).
    Where does it say that? Both the 8.6 update and the USB Mass Storage Support 1.3.5 are OK for a 1998 iMac (with 8.5.1 right now). Since the USB Mass Storage Support 1.3.5 requires 8.6, install that update first.
    Oh, and I forgot to mention the only means of transporting data is through a CD(which I can burn).
    Yes, you can transfer files on a CD. Use a CD-R (not CD-RW).
    If you are using a PC for the downloads, make sure that the files are kept unaltered. Do not try to decode the MacBinary (.bin) on the PC. Once on the iMac, use an appropriate version of StuffIt Expander (which, hopefully, is there already) for the decoding (drag the .bin file onto the StuffIt Expander program icon). Otherwise, special software (such as TransMac) will be needed on the PC in order to correctly handle Mac files.
    The iMac is not connected to the internet.
    If necessary, that can be resolved within minutes. The iMac has a built-in modem for a dial-up connection, or it can be connected to a broadband router by means of an RJ-45 Ethernet cable.
    Jan

  • Mount FAT32 USB flash storage in Solaris 10

    Hi guys, girls, and undecided.
    I've just upgraded my Winblows XP laptop to dual-boot Solaris 10. I've been trying in vain to get a few things working, the most annoying of which is my USB flash storage disk.
    I've tried 'pkill -HUP vold', to no avail
    'iostat -En' shows my CDRW/DVD drive, but no USB drive.
    Help would be muchly appreciated.

    Congratulations on your choice of Os ;-)
    To solve this problem you can try and create a directory called /rmdisk , then start vold running:
    /etc/init.d/volmgt stop
    /etc/init.d/volmgt start
    if you are lucky your USB flash will show up under /rmdisk/<name> after a few seconds.
    If not you should be able to see the flash with cfgadm, which list the status of USB ports (among other things).
    Solaris should automatically create a /dev/dsk/ and /dev/rdsk/ entries for your flash memory, if its not automatically mounted by vold, try and stop vold using
    /etc/init.d/volmgt stop
    Then do a cd /dev/dsk and run an ls -lart, the USB devices should be among the last devices in that list, then mount it using:
    mount -F pcfs /dev/dsk/<device> /some/directory
    the device should end with s2 or p2, some flash devices might also need :c, aka /dev/dsk/<device>:c, it depends how its configured.
    See man mount_pcfs for more information...
    Hope this helps a bit (:
    //Magnus

  • How to mount fat32 usb flash drive on 10.6.8?

    Hello there,
    I've read many posts about this problem but they don't work for me.
    I've a Kingstone flash drive 16GB that I use mainly to record videos from a Digital terrestrial tuner box or to watch vieos from internet on my videoprojector.
    It used to work fine, then I re formatted it  on the DTV box and recorded a couple of programs with the tuner and they show up correctly, but once connected to my iMac mid2011 usb port or MBPro I'm asked to initialize the drive or ignore, eject.
    - It doesn't show up in DiskUtility.
    - It does show up in System Profiler:
    DT R500:
      Capacity:    15.99 GB (15,988,686,848 bytes)
      Removable Media:    Yes
      Detachable Drive:    Yes
      BSD Name:    disk1
      Product ID:    0x1654
      Vendor ID:    0x0951  (Kingston Technology Company)
      Version:     1.00
      Serial Number:   
      Speed:    Up to 480 Mb/sec
      Manufacturer:    Kingston
      Location ID:    0xfd130000 / 6
      Current Available (mA):    500
      Current Required (mA):    300
      Partition Map Type:    MBR (Master Boot Record)
      S.M.A.R.T. status:    Not Supported
      Volumes:
      Capacity:    15.99 GB (15,988,654,080 bytes)
      Writable:    Yes
      BSD Name:    disk1s1
    - It does show up with mount command in Terminal:
    /dev/disk1
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:     FDisk_partition_scheme                        *16.0 GB    disk1
       1:             Windows_FAT_32                         16.0 GB    disk1s1
    - Tried to make a dir and then mount but with no success:
    sh-3.2# mount -t msdos  /dev/disk1s1 /Volumes/Kingstone/
    mount_msdos: /dev/disk1s1 on /Volumes/Kingstone: Invalid argument
    I just need to copy the recorded files and then format again the flash drive.
    Any suggestion?
    Thank you in advance!
    Piero

    "DTV box may not have formatted properly" --> I'd suspect something like that too...
    FAT32 is limited to file size of 4GB actually (minus one byte).
    In my experience you can copy a larger file to a FAT32 volume, let's say a video file, but when the copying process is finished, you notice the size is 4GB, and when you play the video it ends abruptly at this point.
    (another limit is limited file name length and limited use of characters in the filename. A slash for instance is not allowed.)
    Piero, did you try to connect your flash drive to a windows machine?

  • External USB drive wont mount but USB Flash Drive Wll?

    I have an external usb hard drive formatted to NTFS. When I plug it in it shows up in my file manager as New Volume.
    When I click on it I get an error message that says
    "Cannot get volume fstype alternative"
    I have made changes to PolicyKit and it didnt fix it.
    I also have a Corsair Flash Drive that has no problem mounting and I can access it without errors.
    I dont have a clue how to fix it since one works and the other doesnt.
    Any help would be greatly appreciated
    Last edited by ziegen (2009-06-07 02:22:15)

    Have you got ntfs-3g installed?

  • Format read only usb flash

    hi guys,
    I've an usb (8GB) after I installed kaspersky bootable rescue disk I couldn't remove or format flash.
    I tried mkfs.vfat & gpart & partitionmanager in kde

    dmesg output is:
    [ 194.900344] usb 2-2: new high-speed USB device number 3 using ehci-pci
    [ 200.016793] usb 2-2: device descriptor read/64, error -71
    [ 200.459575] usb-storage 2-2:1.0: USB Mass Storage device detected
    [ 200.459710] scsi host2: usb-storage 2-2:1.0
    [ 200.459848] usbcore: registered new interface driver usb-storage
    [ 200.462201] usbcore: registered new interface driver uas
    [ 201.461472] scsi 2:0:0:0: Direct-Access JetFlash Transcend 8GB 8.07 PQ: 0 ANSI: 2
    [ 201.466264] sd 2:0:0:0: [sdb] 15687680 512-byte logical blocks: (8.03 GB/7.48 GiB)
    [ 201.466876] sd 2:0:0:0: [sdb] Write Protect is off
    [ 201.466884] sd 2:0:0:0: [sdb] Mode Sense: 03 00 00 00
    [ 201.467511] sd 2:0:0:0: [sdb] No Caching mode page found
    [ 201.467518] sd 2:0:0:0: [sdb] Assuming drive cache: write through
    [ 201.479153] sdb: sdb1
    [ 201.481757] sd 2:0:0:0: [sdb] Attached SCSI removable disk
    [ 373.667900] cfg80211: Calling CRDA to update world regulatory domain
    [ 1461.637851] perf interrupt took too long (2544 > 2495), lowering kernel.perf_event_max_sample_rate to 50100
    [ 5662.434764] perf interrupt took too long (4996 > 4960), lowering kernel.perf_event_max_sample_rate to 25200
    [ 7248.393740] sd 2:0:0:0: [sdb]
    [ 7248.393752] Result: hostbyte=0x00 driverbyte=0x08
    [ 7248.393759] sd 2:0:0:0: [sdb]
    [ 7248.393764] Sense Key : 0x2 [current]
    [ 7248.393772] Info fld=0x0
    [ 7248.393778] sd 2:0:0:0: [sdb]
    [ 7248.393782] <<vendor>> ASC=0xff ASCQ=0xffASC=0xff <<vendor>> ASCQ=0xff
    [ 7248.393791] sd 2:0:0:0: [sdb] CDB:
    [ 7248.393795] cdb[0]=0x2a: 2a 00 00 00 00 00 00 00 08 00
    [ 7248.393816] end_request: I/O error, dev sdb, sector 0
    [ 7248.393825] Buffer I/O error on device sdb, logical block 0
    [ 7248.393830] lost page write due to I/O error on sdb
    [ 7248.993670] sd 2:0:0:0: [sdb] Write Protect is on
    [ 7248.993677] sd 2:0:0:0: [sdb] Mode Sense: 03 00 80 00
    [ 7249.000140] sdb: sdb1
    [ 7328.412684] raid6: sse2x1 3012 MB/s
    [ 7328.469327] raid6: sse2x2 3079 MB/s
    [ 7328.526004] raid6: sse2x4 3540 MB/s
    [ 7328.526011] raid6: using algorithm sse2x4 (3540 MB/s)
    [ 7328.526014] raid6: using ssse3x2 recovery algorithm
    [ 7328.583897] xor: measuring software checksum speed
    [ 7328.615969] prefetch64-sse: 8005.200 MB/sec
    [ 7328.649321] generic_sse: 7046.400 MB/sec
    [ 7328.649327] xor: using function: prefetch64-sse (8005.200 MB/sec)
    [ 7328.766567] Btrfs loaded
    [ 7328.865929] JFS: nTxBlock = 8192, nTxLock = 65536
    [ 7328.892242] NILFS version 2 loaded
    [ 7329.002056] SGI XFS with ACLs, security attributes, realtime, no debug enabled
    [ 7330.208007] mmcblk0: p1
    [ 7360.645827] mmcblk0: error -110 transferring data, sector 7744248, nr 8, cmd response 0x900, card status 0x80000b00
    [ 7360.645836] mmcblk0: retrying using single block read
    [ 7360.924458] mmcblk0: p1
    Last edited by morteza (2014-11-05 03:13:58)

  • How to mount USB Flash Drive

    Hello again Arch-Linux users,
    I always search google very hard and for months (off and on) I search for how to mount a USB Flash Drive.  Nothing ever work so I give up than try again months latter.  I don't want to give up anymore and that is why I join this forum.
    Here are some of the code I found on the net.  Some of these commands will only re-mount the entire Arch-Linux running system in  /mnt/usbstick.
    sudo mount -o rw,noauto,async,user,umask=1000 /dev/sda1 /mnt/usbstick
    ... don't work it only re-mount the entire system
    /dev/sda15 /mnt/usbstick  vfat   user,noauto,unhide   0      0
    ... don't work... I found nothing inside /mnt/usbstick
    mount -t vfat -o rw,nosuid,nodev,quiet,shortname=mixed,uid=1001,gid=100,umask=077,iocharset=utf8 /dev/sda1 /mnt/usbstick
    ... don't work... here is the error i get:
    mount: /dev/sda1 already mounted or /mnt/usbstick busy
    mount: according to mtab, /dev/sda1 is mounted on /
    It strange that most USB mount commands use the operating system partition itself- example: /dev/sda1 as the device for USB device, while others use /dev/cdrom for cd - /dev/dvd for dvd and /dev/fd0 for floppy.
    Could someone post the code that will easily mount a usb device under Arch_Linux.
    I'm using Arch-Linux core-64 (08-2009)
    Thanks in advance
    Last edited by sharris (2010-06-17 21:58:43)

    Thanks fsckd,
    I needed a rapid reply because I been wasting too much time not getting anything done because I needed to get pass this flash-drive thing.  I can now have a secure back-up in my pocket on USB to go.  Arch-Linux does it better for what I seen while just dd'ing on disk.
    ...lsusb
    Found it
    http://gd.tuwien.ac.at/linuxcommand.org … susb8.html
    Thanks demian,
    sdb is the location for my single hard-drive machine.  I saw it before in my list above but I changed it to sda1 because I knew no better.  I had no clue it represent a 2nd hard-drive for LINUX if one is not already present.
    This did it for me
    Thanks again

  • How to use USB flash drive in XFCE?

    Hello,
    How to mount/unmount USB flash drive in XFCE?
    Thanks for your help,
    Anand

    http://wiki.archlinux.org/index.php/AutoFS_HowTo might be interesting

  • Procedure to Mount ejected Memory Flash Cards without reinserting or rebooting

    The following Terminal command works to Mount ejected USB flash drives without reinserting or rebooting:
    sudo kextunload /System/Library/Extensions/IOUSBMassStorageClass.kext ; sudo kextload /System/Library/Extensions/IOUSBMassStorageClass.kext
    Source: http://ask.metafilter.com/241301/Mac-Mount-ejected-flash-drive-without-reinserti ng
    yet, it does NOT work for Memory Flash Cards like the SanDisk Extreme 128 GB SDXC Class 10 UHS-1 Flash Memory Card 45MB/s SDSDX-128G-X46
    http://www.amazon.com/SanDisk-Extreme-Class-Memory-SDSDX-128G-X46/dp/B00720TE1M
    How to accomplish that with such Memory Flash Cards in Mac with OS X 10.8.4 (Mountain Lion)?
    Is there a procedure that could work with both USB flash drives and also Memory Flash Cards at once?
    Thanks.

    OK, I have found this:
    re-mount ejected SD card without reinserting
    http://apple.stackexchange.com/questions/62478/re-mount-ejected-sd-card-without- reinserting
    with the following Terminal command:
    sudo kextunload /System/Library/Extensions/AppleStorageDrivers.kext/Contents/PlugIns/AppleUSBCa rdReader.kext; sudo kextload /System/Library/Extensions/AppleStorageDrivers.kext/Contents/PlugIns/AppleUSBCa rdReader.kext
    which I belive is wrong, because it generates an error:
    (kernel) Kext com.apple.driver.AppleUSBCardReader not found for unload request.
    Failed to unload com.apple.driver.AppleUSBCardReader - (libkern/kext) not found.
    I think that the right command is this (added space before semicolon):
    sudo kextunload /System/Library/Extensions/AppleStorageDrivers.kext/Contents/PlugIns/AppleUSBCa rdReader.kext ; sudo kextload /System/Library/Extensions/AppleStorageDrivers.kext/Contents/PlugIns/AppleUSBCa rdReader.kext
    But unfortunately, it does nothing. The Memory Flash Card is NOT mounted.
    Any idea?
    Thanks.

  • Time Maching backup and USB flash drives problem with TC

    I have a time capsule that is currently backing up my computer for the first time. I want to add a USB hub to the USB port so I can add my flash drives and setup a printer wirelessly. I plugged in one of my flash drives into the USB port and a folder popped up that was titled "NO NAME". Is there any reason why TC isn't recognizing this as a disk and letting me move files to/from the flash drive. Additionally, is there anyway to backup the day-to-day Time Machine files to the flash drives instead of to the TC, or would this not be recommended?
    Thanks to all who can help!

    I have successfully mounted a USB flash drive but had to first reformat and name it using Disk utility. I am also using a USB hub with an external 750G drive attached through the USB hub.

  • USB flash storage mounted as read-only filesystem

    Hello all,
    I'm new to Arch Linux and trying to migrate all my works to arch. Installed KDE, GNOME3, and hardware drivers successfully But I have problems with USB flash disks. When plugging a usb device, system mounts it as a readonly filesystem. so I can't change its contents. It always happens to my flash disk, but flash disk of my friend is ok!
    I tried to mount manually with super user access, but no hope. It says:
    [root@myhost soroush]# mount /dev/sdb1 /mnt/
    mount: warning: /mnt/ seems to be mounted read-only.

    roygbiv wrote:Maybe you can post your /etc/fstab?
    # /etc/fstab: static file system information
    # <file system> <dir> <type> <options> <dump> <pass>
    tmpfs /tmp tmpfs nodev,nosuid 0 0
    /dev/sda2 / ext4 defaults 0 1
    /dev/sda3 /home ext4 defaults 0 1
    /dev/sda4 swap swap defaults 0 0

  • USB Flash Drive: Read-only filesystem

    Hi
    I'm trying to format a usb flash drive using various tools but they all say that it's a read-only file system. The drive is not mounted and I'm running as root. If I try to mount the drive like so with the command
    sudo mount -o rw,users /dev/sdc1 /media/myflashdrive
    I don't get any errors and when I go to /media/myflashdrive I can see and edit all the files (only as root however). However, any changes are not persistent. For example, if I delete any files or run
    sudo rm -rf /media/myflashdrive/*
    it seems to work and ls doesn't show anything, but then if a reopen the drive, the files are back.
    I've tried this on other computers and even in Windows but nothing can put a scratch on it. I heard something about there being a certain bit in the first sector which can be flipped to make a drive read-only but I think it only applied to Windows.
    Any advice would be greatly appreciated, but if I can't format the drive I'll probably use some thermite to toast the data on it.

    Hmm. I wasn't very clear: my drive was usable originally but it stopped working while I was using Windows (I just plugged it in one day and it was read-only) and now that I use Linux I thought I'd try to fix it (I have been told that linux can do anything but I'm not so sure). I suppose it could just be a physical error on the drive but it's not got any marks or anything.
    Just a thought here, if it was a physical problem, would it be possible to 'reset' it with an electromagnet or by shorting it out or would this just frazzle the chip? Maybe not the right forums for that kind of question.
    Last edited by JJ.Eastwood (2011-05-26 19:50:56)

Maybe you are looking for