LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 11-30-2017, 10:31 AM   #1
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,372

Rep: Reputation: 51
Question 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).

What should we do to access those camera files?

Last edited by dedec0; 11-30-2017 at 10:32 AM.
 
Old 11-30-2017, 10:51 AM   #2
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,615
Blog Entries: 19

Rep: Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460
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.
 
Old 11-30-2017, 11:06 AM   #3
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,372

Original Poster
Rep: Reputation: 51
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.

Last edited by dedec0; 11-30-2017 at 11:22 AM.
 
Old 11-30-2017, 11:16 AM   #4
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,372

Original Poster
Rep: Reputation: 51
Smile

In Debian, dmesg is not allowed to non root user. Is this normal? In Ubuntu I did it with my user (which can also use sudo, both users may use it).

dmesg has lines showing the camera being disconnected and connected again, as you pointed:

Code:
[2138899.842881] usb 1-7: USB disconnect, device number 13
[2138905.245459] usb 1-7: new high-speed USB device number 14 using xhci_hcd
[2138905.386539] usb 1-7: New USB device found, idVendor=054c, idProduct=046a
[2138905.386545] usb 1-7: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[2138905.386548] usb 1-7: Product: DSC-S2100
[2138905.386552] usb 1-7: Manufacturer: Sony
[2138905.386555] usb 1-7: SerialNumber: a12a1234a1a1
[2138905.387449] usb-storage 1-7:1.0: USB Mass Storage device detected
[2138905.388295] scsi host3: usb-storage 1-7:1.0
[2138906.390327] scsi 3:0:0:0: Direct-Access     Sony     DSC              1.00 PQ: 0 ANSI: 0
[2138906.390898] scsi 3:0:0:1: Direct-Access     Sony     DSC              1.00 PQ: 0 ANSI: 0
[2138906.391316] scsi 3:0:0:2: Direct-Access     Sony     DSC              1.00 PQ: 0 ANSI: 0
[2138906.392397] sd 3:0:0:0: Attached scsi generic sg1 type 0
[2138906.392526] sd 3:0:0:0: [sdb] 15646720 512-byte logical blocks: (8.01 GB/7.46 GiB)
[2138906.393115] sd 3:0:0:1: Attached scsi generic sg2 type 0
[2138906.394238] sd 3:0:0:2: Attached scsi generic sg3 type 0
[2138906.403241] sd 3:0:0:0: [sdb] Write Protect is off
[2138906.403252] sd 3:0:0:0: [sdb] Mode Sense: 0f 00 00 00
[2138906.414216] sd 3:0:0:0: [sdb] No Caching mode page found
[2138906.414232] sd 3:0:0:0: [sdb] Assuming drive cache: write through
[2138906.414912] sd 3:0:0:1: [sdc] 12353 512-byte logical blocks: (6.32 MB/6.03 MiB)
[2138906.415166] sd 3:0:0:2: [sdd] 25601 512-byte logical blocks: (13.1 MB/12.5 MiB)
[2138906.426252] sd 3:0:0:1: [sdc] Write Protect is on
[2138906.426257] sd 3:0:0:1: [sdc] Mode Sense: 0f 00 80 00
[2138906.426433] sd 3:0:0:2: [sdd] Write Protect is off
[2138906.426438] sd 3:0:0:2: [sdd] Mode Sense: 0f 00 00 00
[2138906.437188] sd 3:0:0:1: [sdc] No Caching mode page found
[2138906.437195] sd 3:0:0:1: [sdc] Assuming drive cache: write through
[2138906.448236] sd 3:0:0:2: [sdd] No Caching mode page found
[2138906.448249] sd 3:0:0:2: [sdd] Assuming drive cache: write through
[2138906.472257]  sdb: sdb1
[2138906.530250] sd 3:0:0:0: [sdb] Attached SCSI removable disk
[2138906.531460]  sdc: sdc1
[2138906.533991]  sdd: sdd1
[2138906.553057] sd 3:0:0:1: [sdc] Attached SCSI removable disk
[2138906.576286] sd 3:0:0:2: [sdd] Attached SCSI removable disk
Now I will try to mount those devices... be right back! (:

Last edited by dedec0; 11-30-2017 at 11:18 AM.
 
Old 11-30-2017, 11:23 AM   #5
DVOM
Member
 
Registered: Nov 2010
Posts: 223

Rep: Reputation: 48
I recently installed Pardus, which is a debian distro. To get it to mount things normally I had to install "gvfs". "autofs" and "udisks2".
 
1 members found this post helpful.
Old 11-30-2017, 11:30 AM   #6
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,615
Blog Entries: 19

Rep: Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460
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.
 
1 members found this post helpful.
Old 11-30-2017, 11:34 AM   #7
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,372

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by DVOM View Post
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
(:

Be right back again...
 
Old 11-30-2017, 11:56 AM   #8
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,372

Original Poster
Rep: Reputation: 51
Smile

Quote:
Originally Posted by hazel View Post
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!
 
Old 11-30-2017, 01:02 PM   #9
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,671
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
Also note that "some devices expose the 'I am a disk drive'" protocol, while others do not. If their firmware doesn't support this, it can't be done.
 
Old 11-30-2017, 01:08 PM   #10
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
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.
 
1 members found this post helpful.
Old 11-30-2017, 01:09 PM   #11
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,615
Blog Entries: 19

Rep: Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460
Quote:
Originally Posted by sundialsvcs View Post
Also note that "some devices expose the 'I am a disk drive'" protocol, while others do not. If their firmware doesn't support this, it can't be done.
I doubt if that's the problem here because these disks did automount in gnome. Also the kernel recognises them.
 
1 members found this post helpful.
Old 11-30-2017, 03:07 PM   #12
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,372

Original Poster
Rep: Reputation: 51
Smile

Quote:
Originally Posted by Shadow_7 View Post
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

(:
 
Old 11-30-2017, 04:05 PM   #13
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,615
Blog Entries: 19

Rep: Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460
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

Last edited by hazel; 11-30-2017 at 04:06 PM.
 
1 members found this post helpful.
Old 11-30-2017, 04:44 PM   #14
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,372

Original Poster
Rep: Reputation: 51
Question

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.

Last edited by dedec0; 11-30-2017 at 04:46 PM.
 
Old 11-30-2017, 04:47 PM   #15
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,372

Original Poster
Rep: Reputation: 51
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem mounting USB Mass Storage Interface (Camera) brina Linux - Software 4 02-03-2008 03:23 PM
Digikam won't connect to usb mass storage camera can564 Linux - Software 2 03-10-2005 10:31 AM
Unusual difficulty with USB Mass Storage Compatible Digital Camera davidbalt Linux - Hardware 2 07-08-2004 12:10 PM
Linux "broke" USB-mass storage device? - no longer workable in Windows XP lrt2003 Linux - Hardware 3 06-13-2004 10:56 PM
USB mass storage (camera) vexer Linux - General 4 05-24-2004 11:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration