5

I would like to mount my Nikon Coolpix camera as a disk on my CentOS 7. Following

http://hintshop.ludvig.co.nz/show/persistent-names-usb-serial-devices/

and

https://www.suse.com/communities/blog/manually-mounting-a-usb-flash-drive-in-linux/

I have found my camera's data in dmesg:

[  559.605914] usb 2-1.2: new high-speed USB device number 4 using ehci-pci
[  559.694657] usb 2-1.2: New USB device found, idVendor=04b0, idProduct=0360
[  559.694664] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  559.694669] usb 2-1.2: Product: NIKON DSC COOLPIX L31-PTP
[  559.694672] usb 2-1.2: Manufacturer: NIKON
[  559.694676] usb 2-1.2: SerialNumber: VNA871EA41018279

and so created

/etc/udev/rules.d/99-usb-nikon.rules

with the content

SUBSYSTEM=="usb", ATTRS{idVendor}=="04b0", ATTRS{idProduct}=="0360", ATTRS{serial}=="VNA871EA41018279", SYMLINK+="nikon"

I unplugged my camera and plugged it again, so /dev/nikon now points to the proper device file:

lrwxrwxrwx. 1 root root 15 Mar 18 17:34 /dev/nikon -> bus/usb/002/006

which is a character device file:

crw-rw-r--+ 1 root root 189, 133 Mar 18 17:34 /dev/bus/usb/002/006

trying to mount it I get

$ sudo mount /dev/nikon /mnt/nikon
mount:  /dev/bus/usb/002/006 is not a block device

What should I do here to mount my camera device file as a disk? Should I use mknod somehow to create a block device file and then mount it?

3
  • 2
    Check if your camera has a menu setup option to go to mass-storage mode instead of PTP. If it does not you need to look at utilities that manage PTP; google suggests gtkam, gnome shotwell.
    – meuh
    Mar 18, 2017 at 18:05
  • mass-storage mode means it will be a block device?
    – Gergely
    Mar 18, 2017 at 18:13
  • 1
    Yes, it should appear as a mountable block device and you should be able to read/write files on the camera's sdcard (if that is what it uses).
    – meuh
    Mar 18, 2017 at 18:19

1 Answer 1

10

Only way I found to mount a camera which uses solely PTP, is to use gphotofs with Gphoto2:

sudo apt-get install gphoto2 gphotofs

mounting:

gphotofs /mnt/mountlocation

unmounting:

fusermount -u /mnt/mountlocation
1
  • Perfect, works with my Nikon Z30 Apr 6, 2023 at 23:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .