You are not logged in.

#1 2008-06-15 11:31:27

gyo
Member
From: France
Registered: 2007-04-14
Posts: 19

[pmount] mounting external hard drive

Hi all,

I've got an external hard drive on USB port.
When I try to mount it via pmount, I've got an error message :

$ pmount sda1
Error: device /dev/sda1 is not removable

(yes, my external hd is often named as sda, because I use "ide" hook in initcpio for my internal hd that is pata)

with the --debug pmount's option, I've got this output :

sda1 cannot be resolved to a proper device node
trying to prepend '/dev/' to device argument, now /dev/sda1
mount point to be used: /media/sda1
no iocharset given, current locale encoding is ANSI_X3.4-1968
Cleaning lock directory /var/lock/pmount_dev_sda1
device_whitelist: checking /etc/pmount.allow...
device_whitlisted(): nothing matched, returning 0
find_sysfs_device: looking for sysfs directory for device 8:1
find_sysfs_device: checking whether /dev/sda1 is on /sys/block/ram0 (1:0)
find_sysfs_device: checking whether /dev/sda1 is on /sys/block/ram1 (1:1)
find_sysfs_device: checking whether /dev/sda1 is on /sys/block/ram2 (1:2)
find_sysfs_device: checking whether /dev/sda1 is on /sys/block/ram3 (1:3)
find_sysfs_device: checking whether /dev/sda1 is on /sys/block/ram4 (1:4)
find_sysfs_device: checking whether /dev/sda1 is on /sys/block/ram5 (1:5)
find_sysfs_device: checking whether /dev/sda1 is on /sys/block/ram6 (1:6)
find_sysfs_device: checking whether /dev/sda1 is on /sys/block/ram7 (1:7)
find_sysfs_device: checking whether /dev/sda1 is on /sys/block/ram8 (1:8)
find_sysfs_device: checking whether /dev/sda1 is on /sys/block/ram9 (1:9)
find_sysfs_device: checking whether /dev/sda1 is on /sys/block/ram10 (1:10)
find_sysfs_device: checking whether /dev/sda1 is on /sys/block/ram11 (1:11)
find_sysfs_device: checking whether /dev/sda1 is on /sys/block/ram12 (1:12)
find_sysfs_device: checking whether /dev/sda1 is on /sys/block/ram13 (1:13)
find_sysfs_device: checking whether /dev/sda1 is on /sys/block/ram14 (1:14)
find_sysfs_device: checking whether /dev/sda1 is on /sys/block/ram15 (1:15)
find_sysfs_device: checking whether /dev/sda1 is on /sys/block/loop0 (7:0)
find_sysfs_device: checking whether /dev/sda1 is on /sys/block/loop1 (7:1)
find_sysfs_device: checking whether /dev/sda1 is on /sys/block/loop2 (7:2)
find_sysfs_device: checking whether /dev/sda1 is on /sys/block/loop3 (7:3)
find_sysfs_device: checking whether /dev/sda1 is on /sys/block/loop4 (7:4)
find_sysfs_device: checking whether /dev/sda1 is on /sys/block/loop5 (7:5)
find_sysfs_device: checking whether /dev/sda1 is on /sys/block/loop6 (7:6)
find_sysfs_device: checking whether /dev/sda1 is on /sys/block/loop7 (7:7)
find_sysfs_device: checking whether /dev/sda1 is on /sys/block/hda (3:0)
find_sysfs_device: checking whether /dev/sda1 is on /sys/block/hdc (22:0)
find_sysfs_device: checking whether /dev/sda1 is on /sys/block/sda (8:0)
find_sysfs_device: major device numbers match
find_sysfs_device: minor device numbers do not match, checking partitions...
find_sysfs_device: checking whether device /dev/sda1 matches partition 8:0
find_sysfs_device: checking whether device /dev/sda1 matches partition 8:1
find_sysfs_device: -> partition matches, belongs to block device /sys/block/sda
device_removable: corresponding block device for /dev/sda1 is /sys/block/sda
get_blockdev_attr: value of /sys/block/sda/removable == 0
find_bus_ancestry: device 1:0:0:0 (path /sys/devices/pci0000:00/0000:00:0c.2/usb3/3-1/3-1:1.0/host1/target1:0:0/1:0:0:0, bus ) does not match, trying parent
find_bus_ancestry: device target1:0:0 (path /sys/devices/pci0000:00/0000:00:0c.2/usb3/3-1/3-1:1.0/host1/target1:0:0, bus ) does not match, trying parent
find_bus_ancestry: device host1 (path /sys/devices/pci0000:00/0000:00:0c.2/usb3/3-1/3-1:1.0/host1, bus ) does not match, trying parent
find_bus_ancestry: device 3-1:1.0 (path /sys/devices/pci0000:00/0000:00:0c.2/usb3/3-1/3-1:1.0, bus ) does not match, trying parent
find_bus_ancestry: device 3-1 (path /sys/devices/pci0000:00/0000:00:0c.2/usb3/3-1, bus ) does not match, trying parent
find_bus_ancestry: device usb3 (path /sys/devices/pci0000:00/0000:00:0c.2/usb3, bus ) does not match, trying parent
find_bus_ancestry: device 0000:00:0c.2 (path /sys/devices/pci0000:00/0000:00:0c.2, bus ) does not match, trying parent
find_bus_ancestry: device pci0000:00 (path /sys/devices/pci0000:00, bus ) does not match, trying parent
find_bus_ancestry: dev == NULL, fail
Error: device /dev/sda1 is not removable
policy check failed

As you can see, pmount cannot determine the BUS, it should found USB

Yes, the sysfs confirms it :

$ udevinfo -a -p /sys/block/sda

Udevinfo starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/block/sda':
    KERNEL=="sda"
    SUBSYSTEM=="block"
    DRIVER==""
    ATTR{dev}=="8:0"
    ATTR{range}=="16"
    ATTR{removable}=="0"
    ATTR{size}=="625142448"
    ATTR{stat}=="    3649      165     4868    82440    53920     6433 12527561  5268885        0   436246  5351232"
    ATTR{capability}=="12"

  looking at parent device '/devices/pci0000:00/0000:00:0c.2/usb3/3-1/3-1:1.0/host1/target1:0:0/1:0:0:0':
    KERNELS=="1:0:0:0"
    SUBSYSTEMS=="scsi"
    DRIVERS=="sd"
    ATTRS{device_blocked}=="0"
    ATTRS{type}=="0"
    ATTRS{scsi_level}=="3"
    ATTRS{vendor}=="SAMSUNG "
    ATTRS{model}=="HM320JI         "
    ATTRS{rev}=="    "
    ATTRS{state}=="running"
    ATTRS{timeout}=="60"
    ATTRS{iocounterbits}=="32"
    ATTRS{iorequest_cnt}=="0xe0e8"
    ATTRS{iodone_cnt}=="0xe0e8"
    ATTRS{ioerr_cnt}=="0x0"
    ATTRS{modalias}=="scsi:t-0x00"
    ATTRS{evt_media_change}=="0"
    ATTRS{queue_depth}=="1"
    ATTRS{queue_type}=="none"
    ATTRS{max_sectors}=="240"

  looking at parent device '/devices/pci0000:00/0000:00:0c.2/usb3/3-1/3-1:1.0/host1/target1:0:0':
    KERNELS=="target1:0:0"
    SUBSYSTEMS==""
    DRIVERS==""

  looking at parent device '/devices/pci0000:00/0000:00:0c.2/usb3/3-1/3-1:1.0/host1':
    KERNELS=="host1"
    SUBSYSTEMS==""
    DRIVERS==""

  looking at parent device '/devices/pci0000:00/0000:00:0c.2/usb3/3-1/3-1:1.0':
    KERNELS=="3-1:1.0"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb-storage"
    ATTRS{bInterfaceNumber}=="00"
    ATTRS{bAlternateSetting}==" 0"
    ATTRS{bNumEndpoints}=="02"
    ATTRS{bInterfaceClass}=="08"
    ATTRS{bInterfaceSubClass}=="06"
    ATTRS{bInterfaceProtocol}=="50"
    ATTRS{modalias}=="usb:v04FCp0C15dF615dc00dsc00dp00ic08isc06ip50"
    ATTRS{interface}=="Bulk Only Interface"

  looking at parent device '/devices/pci0000:00/0000:00:0c.2/usb3/3-1':
    KERNELS=="3-1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{dev}=="189:258"
    ATTRS{configuration}=="Bulk Only Configuration"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="c0"
    ATTRS{bMaxPower}=="  2mA"
    ATTRS{urbnum}=="549079"
    ATTRS{idVendor}=="04fc"
    ATTRS{idProduct}=="0c15"
    ATTRS{bcdDevice}=="f615"
    ATTRS{bDeviceClass}=="00"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{speed}=="480"
    ATTRS{busnum}=="3"
    ATTRS{devnum}=="3"
    ATTRS{version}==" 2.00"
    ATTRS{maxchild}=="0"
    ATTRS{quirks}=="0x0"
    ATTRS{authorized}=="1"
    ATTRS{manufacturer}=="Sunplus Technology Co.,Ltd."
    ATTRS{product}=="USB to Serial-ATA bridge"
    ATTRS{serial}=="FAFFFFF0FFF16FF10F501592"

  looking at parent device '/devices/pci0000:00/0000:00:0c.2/usb3':
    KERNELS=="usb3"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{dev}=="189:256"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bMaxPower}=="  0mA"
    ATTRS{urbnum}=="66"
    ATTRS{idVendor}=="0000"
    ATTRS{idProduct}=="0000"
    ATTRS{bcdDevice}=="0206"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="01"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{speed}=="480"
    ATTRS{busnum}=="3"
    ATTRS{devnum}=="1"
    ATTRS{version}==" 2.00"
    ATTRS{maxchild}=="5"
    ATTRS{quirks}=="0x0"
    ATTRS{authorized}=="1"
    ATTRS{manufacturer}=="Linux 2.6.24-ARCH ehci_hcd"
    ATTRS{product}=="EHCI Host Controller"
    ATTRS{serial}=="0000:00:0c.2"
    ATTRS{authorized_default}=="1"

  looking at parent device '/devices/pci0000:00/0000:00:0c.2':
    KERNELS=="0000:00:0c.2"
    SUBSYSTEMS=="pci"
    DRIVERS=="ehci_hcd"
    ATTRS{vendor}=="0x1033"
    ATTRS{device}=="0x00e0"
    ATTRS{subsystem_vendor}=="0x104d"
    ATTRS{subsystem_device}=="0x8175"
    ATTRS{class}=="0x0c0320"
    ATTRS{irq}=="11"
    ATTRS{local_cpus}=="f"
    ATTRS{modalias}=="pci:v00001033d000000E0sv0000104Dsd00008175bc0Csc03i20"
    ATTRS{broken_parity_status}=="0"
    ATTRS{msi_bus}==""

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""

Even if pmount encounter the ATTR{removable} to zero, it should see that my device is an USB one and then mount. But, pmount is unable to check which BUS is used.

No problem with usb key flash based.

I use the last pmount, sysfsutils, udev packages. And I encountered this problem with other external usb hd.

So, what the matter?

Offline

#2 2008-06-15 20:56:48

jbromley
Member
From: Pasadena, CA
Registered: 2007-02-04
Posts: 268

Re: [pmount] mounting external hard drive

The problem is just as the error message says, though I'd agree with you if you wanted to argue. HAL doesn't consider USB hard drives to be removable. Removable in this case refers to CD/DVD ROMs, floppies, flash drives (I think). It's bogus, but what can you do short of patching HAL or pmount?

Oh wait, you can use /etc/pmount.allow to tell pmount to allow these drives to be mounted. You just have to list all of the drives you want to be able to mount. Here is my pmount.allow:

# /etc/pmount.allow
# pmount will allow users to additionally mount all devices that are
# listed here.
/dev/sdb1
/dev/sdb2
/dev/sdb3
/dev/sdb4
/dev/sdc1
/dev/sdc2
/dev/sdc3
/dev/sdc4

No, you can't use regexes or globbing. Oh well, it's pretty bogus but at least this way you can mount USB hard drives.

Regards.

Offline

#3 2008-06-16 13:53:16

zenlord
Member
From: Belgium
Registered: 2006-05-24
Posts: 1,221
Website

Re: [pmount] mounting external hard drive

or you can choose to only use udev for automounting USB-devices. Works for me + it doesn't use extra packages (>< pmount)+ it works even outside X (>< thunar-volman).

Zl.

Offline

#4 2008-06-16 20:46:41

jbromley
Member
From: Pasadena, CA
Registered: 2007-02-04
Posts: 268

Re: [pmount] mounting external hard drive

Do you have any pointers to how might one do this? Or do you just use udev's RUN option to run a mounting script? Right now I am using ivman, but I wouldn't mind getting rid of it. Other than there being less packages involved do you know if this has any advantage over ivman?

Regards.

Offline

#5 2008-06-17 10:34:13

zenlord
Member
From: Belgium
Registered: 2006-05-24
Posts: 1,221
Website

Re: [pmount] mounting external hard drive

It is described here: http://bbs.archlinux.org/viewtopic.php?id=46944 and itworks as advertised: 'it just works'.

I have no experience with ivman or pmount. I used to use the gnome DE of XFCE with thunar-volman, but now I use openbox, I'm giving the boot to all unnecessary packages.

Zl.

Offline

#6 2008-06-17 13:43:15

gyo
Member
From: France
Registered: 2007-04-14
Posts: 19

Re: [pmount] mounting external hard drive

jbromley wrote:

The problem is just as the error message says, though I'd agree with you if you wanted to argue. HAL doesn't consider USB hard drives to be removable. Removable in this case refers to CD/DVD ROMs, floppies, flash drives (I think). It's bogus, but what can you do short of patching HAL or pmount?

Some peoples report that it works with pmount on hdd external devices.
It seems that all hdd external are reported not to be removable by sysfs but pmount (tries?) mounts all usb device even if they are not removable.


Oh wait, you can use /etc/pmount.allow to tell pmount to allow these drives to be mounted. You just have to list all of the drives you want to be able to mount. Here is my pmount.allow:

Yes, I know this file but I would like to mount in a proper way, 'cause sd* devices can be things than usb devices.

Regards.

Offline

#7 2008-06-17 21:01:14

jbromley
Member
From: Pasadena, CA
Registered: 2007-02-04
Posts: 268

Re: [pmount] mounting external hard drive

gyo wrote:

Some peoples report that it works with pmount on hdd external devices.
It seems that all hdd external are reported not to be removable by sysfs but pmount (tries?) mounts all usb device even if they are not removable.

That would be odd, because the code for pmount 0.9.17 will only try to mount devices that have the sysfs removable attribute set to 1. I suppose it is possible, however, that some external hds get reported as removable by sysfs. I didn't delve into the sysfs code to see how it determines if a device is removable or not.

gyo wrote:

Oh wait, you can use /etc/pmount.allow to tell pmount to allow these drives to be mounted. You just have to list all of the drives you want to be able to mount. Here is my pmount.allow:

Yes, I know this file but I would like to mount in a proper way, 'cause sd* devices can be things than usb devices.

Yes, this is possible, but I imagine that most people know which sd* devices are static on their machines and so can avoid putting these in their pmount.allow. On my machine sda is the internal hard drive. Anything else that's gets plugged in and routed through the SCSI subsystem (i.e. sd hard drive devices) must be mountable. Of course, I've only really ever dealt with external hard drives, media players and cameras, so there could be other cases that I am not considering or odd instances of these cases like some cameras with proprietary transfer protocols.

Anyway, mounting this way doesn't seem "improper" to me. It seems like the pmount developers, in their wisdom and experience, saw that people would want to mount some devices that might not be reported as removable by sysfs and so provided a way to override the sysfs removable attribute. Also, having some device in pmount.allow doesn't force you to use pmount to mount it, unless you have some type of auto-mounter running.

Regards.

Offline

Board footer

Powered by FluxBB