Debian: how to see files in a camera being an "USB mass storage"?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Debian: how to see files in a camera being an "USB mass storage"?
We have a camera Sony Cybershot. In Ubuntu 10.04, we simply conect its USB cable to the computer and the system automatically mounts two "media disks" for it. There we may copy or delete the pictures stored inside it (card and internal memory).
I tried to plug this camera in a Debian 9 machine, but nothing apparently happens! The camera screen shows its expected "USB mode | Mass Storage", but I cannot see it as a mounted media or a device which I may mount with my user by clicking on it in the file manager (similar to what happens with pendrives).
I would start by seeing if the kernel has recognised the new drives. The command dmesg|tail should do it. dmesg prints out the contents of the kernel's message ring and |tail passes it through a filter that just selects and prints the last ten lines.
For example, I have a printer with a built-in disk, and when I switch the printer on, dmesg shows the lines:
Code:
[18976.226295] scsi 5:0:0:0: Direct-Access HP Photosmart C4700 1.00 PQ: 0 ANSI: 5
[18976.226902] sd 5:0:0:0: Attached scsi generic sg7 type 0
[18976.229860] sd 5:0:0:0: [sdg] Attached SCSI removable disk
So that built-in disk is being recognised as /dev/sdg.
Once you have a device name for it, you should be able to mount it. I don't know why your desktop is not mounting it automatically. Probably it is not the same desktop that you used in Ubuntu.
Just completing the first post and adding some info after haze first replied
Just completing the first post and adding some info after haze first replied:
Before, I tried the mount command, which showed nothing new, which I found strange (since I expected it to be automatically mounted). See:
Code:
$ mount| tail
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=32,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=1535)
mqueue on /dev/mqueue type mqueue (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=1634320k,mode=700,uid=1000,gid=1000)
/dev/sda6 on /media/user/ubu10 type ext4 (rw,nosuid,nodev,relatime,data=ordered,uhelper=udisks2)
$
That sda6 is a network mount of one Ubuntu 10 disk.
The window manager used in the Debian 9 machine is Mate Desktop, file manager is Caja (which is the same as Nautilus in Ubuntu 10 Gnome 2). So most things are (have been) similar in both. At least similar, very few changes I could notice.
I find the situation strange because it should not need any extra driver to access that generic "USB mass Storage". That we may do when accessing this camera in Windows.
I suspect the last two disk partitions (sdc1 and sdd1) are your camera disks. You may indeed need to install extra software to get them automounted, but you shouldn't have any problems adding them to /etc/fstab so that you can mount them by hand when you need to.
I recently installed Pardus, which is a debian distro. To get it to mount things normally I had to install "gvfs". "autofs" and "udisks2".
I will check those, DVOM. Thank you. I manually mounted the camera using sudo mount /dev/sdb1 /media/user/camera, after creating the /media/user/camera dir. Doing that automatically in the future would be my next post, and you guessed it! hehe
(:
I suspect the last two disk partitions (sdc1 and sdd1) are your camera disks. You may indeed need to install extra software to get them automounted, but you shouldn't have any problems adding them to /etc/fstab so that you can mount them by hand when you need to.
Yes, the camera files (due a config in it) are in sdb1 directories, which is an 8GiB card. They could be in sdc1 or sdd1 too (not both, but I do not know from memory which one is that).
I was about to look around exactly about that, haze. Thank you very much!
By default debian does not AUTO mount drives. Install autofs and reboot plus other stuff. Or manually mount the storage device. I normally $(cat /proc/partitions) before and after attaching the camera to see what drive designation it got. There also gphoto2 to get pictures from cameras that act as PTP (peer-to-peer) devices. Be sure to umount the device before unplugging it.
By default debian does not AUTO mount drives. Install autofs and reboot plus other stuff. Or manually mount the storage device. I normally $(cat /proc/partitions) before and after attaching the camera to see what drive designation it got. There also gphoto2 to get pictures from cameras that act as PTP (peer-to-peer) devices. Be sure to umount the device before unplugging it.
I had to stop looking at this problem for a few hours, got back just now.
Umount before unplugging is really important, since there could be pending file operations (removed, renamed, copying files). Mate is good, it even asked me about cleaning camera Trash folder - which I choose never to do, to use the whole SD card physical media as distributedly as possible. This helps maximizing its life.
Now I will be looking into these:
- check if I can use /etc/fstab to enable normal users manually mounting the camera; my doubt is if camera main disk will always be /dev/sdb1, which I think is not true: what if a pendrive is inserted and mounted before inserting camera?
- check autofs and the other options already pointed above
If you want to make sure you have the right disk specified in fstab, use the UUID and not the device name. The command ls -l /dev/disk/by-uuid will show the UUIDs of all your mounted disks.
To make the disk mountable on demand by ordinary users, just add the user,noauto options to the line. For example, I have this line in my Debian fstab:
/dev/sda1 /mnt/crux ext4 user,noauto 0 0
I installed autofs, but did not reboot the computer. Is it really needed? I checked autofs status, seems normal:
Code:
# /etc/init.d/autofs status
● autofs.service - Automounts filesystems on demand
Loaded: loaded (/lib/systemd/system/autofs.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2017-11-30 19:33:28 -02; 2min 30s ago
Main PID: 29200 (automount)
CGroup: /system.slice/autofs.service
└─29200 /usr/sbin/automount --pid-file /var/run/autofs.pid
Nov 30 19:33:28 debian systemd[1]: Starting Automounts filesystems on demand...
Nov 30 19:33:28 debian systemd[1]: Started Automounts filesystems on demand.
I read autofs(5) and auto.master(5), but I am pretty lost on what I should do now.
The only thing that I am sure now is: camera device will be different (sdb, sdc, sdd, ...) when a pendrive (or possibly other USB devices) is inserted before. So that 'ls -l /dev/disk/by-uuid' will probably be really useful. For example, it showed:
Code:
$ ls -l /dev/disk/by-uuid/
total 0
0 lrwxrwxrwx 1 root root 10 nov 14 16:05 111a1111-aaa1-1111-aaa1-a1aa11111a11 -> ../../sda6
0 lrwxrwxrwx 1 root root 10 nov 14 16:05 1111111a-a1aa-11aa-a111-11a1111a11a1 -> ../../sda4
0 lrwxrwxrwx 1 root root 10 nov 14 16:05 1a1aaa11-a11a-1a1a-a1a1-111aa11111a1 -> ../../sda3
0 lrwxrwxrwx 1 root root 10 nov 14 16:05 1a1aaaaa-1aa1-11aa-a1a1-11a11111a1aa -> ../../sda5
0 lrwxrwxrwx 1 root root 10 nov 14 16:05 a11aaa11-11aa-1111-11aa-aa1111a111aa -> ../../sda1
The only thing that changed since I started playing with pendrive, camera and installing autofs is that now there is one CPU core at 100%:
Code:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
366 root 20 0 583692 539868 2168 R 100,0 3,3 297:57.39 systemd-udevd
Is there something wrong here? Possibly, I imagine. I removed the pendrive and the camera sometime ago, but that process still at 100%.
Forgot to note: the process uptime shows that is has been running since the computer last booted. But it surely was not fixed at 100% CPU, like it is now.
Forgot to note: the process uptime shows that is has been running since the computer last booted. But it surely was not fixed at 100% CPU, like it is now.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.