public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Why isn't this SDcard mounting?
@ 2017-08-29 13:53 Stroller
  2017-08-29 14:53 ` [gentoo-user] " Ian Zimmerman
  2017-08-31  9:42 ` Stroller
  0 siblings, 2 replies; 9+ messages in thread
From: Stroller @ 2017-08-29 13:53 UTC (permalink / raw
  To: gentoo-user

I can't make any sense of it.

It's doing this with 2 different SDcards, I think - this is the brand new replacement for one which I believe(d) to be knackered.

Instead of mounting the SDcard, it's mounting the loopback device.

A card, as /dev/sdb, was previously zeroed over and repartitioned a couple of days ago. I bet if I reboot the system it'll be recognised. How do I get it to be recognised now?

Thanks in advance for your thoughts,

Stroller.


   $ sudo grep  kernel /var/log/messages
   Aug 29 13:49:46 alrai kernel: usb 1-1: new high-speed USB device number 5 usingehci-pci
   Aug 29 13:49:46 alrai kernel: usb 1-1: New USB device found, idVendor=0bda, idProduct=0136
   Aug 29 13:49:46 alrai kernel: usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
   Aug 29 13:49:46 alrai kernel: usb 1-1: Product: USB2.0-CRW
   Aug 29 13:49:46 alrai kernel: usb 1-1: Manufacturer: Generic
   Aug 29 13:49:46 alrai kernel: usb 1-1: SerialNumber: 20060413092100000
   Aug 29 13:49:46 alrai kernel: usb-storage 1-1:1.0: USB Mass Storage device detected
   Aug 29 13:49:46 alrai kernel: scsi host6: usb-storage 1-1:1.0
   Aug 29 13:49:47 alrai kernel: scsi 6:0:0:0: Direct-Access     Generic- Card Reader      1.00 PQ: 0 ANSI: 0 CCS
   Aug 29 13:49:47 alrai kernel: sd 6:0:0:0: Attached scsi generic sg1 type 0
   Aug 29 13:49:48 alrai kernel: sd 6:0:0:0: [sdb] 62521344 512-byte logical blocks: (32.0 GB/29.8 GiB)
   Aug 29 13:49:48 alrai kernel: sd 6:0:0:0: [sdb] Write Protect is off
   Aug 29 13:49:48 alrai kernel: sd 6:0:0:0: [sdb] Mode Sense: 03 00 00 00
   Aug 29 13:49:48 alrai kernel: sd 6:0:0:0: [sdb] No Caching mode page found
   Aug 29 13:49:48 alrai kernel: sd 6:0:0:0: [sdb] Assuming drive cache: write through
   Aug 29 13:49:48 alrai kernel:  sdb: sdb1
   Aug 29 13:49:48 alrai kernel: sd 6:0:0:0: [sdb] Attached SCSI removable disk
   Aug 29 14:47:12 alrai kernel:  sdb: sdb1
   $
   $ sudo parted /dev/sdb p
   Model: Generic- Card Reader (scsi)
   Disk /dev/sdb: 32.0GB
   Sector size (logical/physical): 512B/512B
   Partition Table: msdos
   Disk Flags:
   
   Number  Start   End     Size    Type     File system  Flags
    1      4194kB  32.0GB  32.0GB  primary  fat32        lba
   
   $ sudo mount -v /dev/sdb1 /mnt/tmp
   mount: /dev/loop0 mounted on /mnt/tmp.
   $ du -sh /mnt/tmp
   10M     /mnt/tmp
   $ lsmod | grep fat
   vfat                   20480  1
   fat                    65536  1 vfat
   $



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [gentoo-user] Re: Why isn't this SDcard mounting?
  2017-08-29 13:53 [gentoo-user] Why isn't this SDcard mounting? Stroller
@ 2017-08-29 14:53 ` Ian Zimmerman
  2017-08-29 15:33   ` [gentoo-user] " Stroller
  2017-08-31  9:42 ` Stroller
  1 sibling, 1 reply; 9+ messages in thread
From: Ian Zimmerman @ 2017-08-29 14:53 UTC (permalink / raw
  To: gentoo-user

On 2017-08-29 14:53, Stroller wrote:

>    $ sudo parted /dev/sdb p
>    Model: Generic- Card Reader (scsi)
>    Disk /dev/sdb: 32.0GB
>    Sector size (logical/physical): 512B/512B
>    Partition Table: msdos
>    Disk Flags:
>    
>    Number  Start   End     Size    Type     File system  Flags
>     1      4194kB  32.0GB  32.0GB  primary  fat32        lba
>    
>    $ sudo mount -v /dev/sdb1 /mnt/tmp
>    mount: /dev/loop0 mounted on /mnt/tmp.

I don't have a quick solution, but I would look at the state of /dev
(not only /dev/sdb* but also the various /dev/disk/by-* directories)
both before and after running parted.  parted is my prime suspect for
messing things up here.

Also, is this the normal mount program from util-linux package, or some
"modern" replacement?

-- 
Please don't Cc: me privately on mailing lists and Usenet,
if you also post the followup to the list or newsgroup.
Do obvious transformation on domain to reply privately _only_ on Usenet.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Why isn't this SDcard mounting?
  2017-08-29 14:53 ` [gentoo-user] " Ian Zimmerman
@ 2017-08-29 15:33   ` Stroller
  2017-08-29 15:35     ` Alan McKinnon
  0 siblings, 1 reply; 9+ messages in thread
From: Stroller @ 2017-08-29 15:33 UTC (permalink / raw
  To: gentoo-user


> On 29 Aug 2017, at 15:53, Ian Zimmerman <itz@very.loosely.org> wrote:
> 
> I don't have a quick solution, but I would look at the state of /dev
> (not only /dev/sdb* but also the various /dev/disk/by-* directories)
> both before and after running parted.  parted is my prime suspect for
> messing things up here.

Indeed.

No sdb1 is mentioned, despite it apparently being recognised by the kernel when plugged in (from the last line of the `grep  kernel /var/log/messages` output in my previous post).

  $ ls -l /dev/disk/* | grep sdb
  lrwxrwxrwx 1 root root  9 Aug 29 14:51 usb-Generic-_Card_Reader_20060413092100000-0:0 -> ../../sdb
  lrwxrwxrwx 1 root root  9 Aug 29 14:51 pci-0000:00:12.2-usb-0:1:1.0-scsi-0:0:0:0 -> ../../sdb
  $ 

The same command, grepping sda, shows much longer output, with symlinks to all the partitions 

Is it udev that's responsible for populating the dev nodes?
(is that the right terminology?)

How do I force it to reconstruct the partition table? Surely one should expect to be able to format or partition a removable drive and have the dev nodes created without the necessity of rebooting?

> Also, is this the normal mount program from util-linux package, or some
> "modern" replacement?

It's the normal one:

  $ equery belongs `which mount`
   * Searching for /bin/mount ...
  sys-apps/util-linux-2.28.2 (/bin/mount)
  $ 

Stroller.






^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Why isn't this SDcard mounting?
  2017-08-29 15:33   ` [gentoo-user] " Stroller
@ 2017-08-29 15:35     ` Alan McKinnon
  2017-08-29 16:45       ` Stroller
  0 siblings, 1 reply; 9+ messages in thread
From: Alan McKinnon @ 2017-08-29 15:35 UTC (permalink / raw
  To: gentoo-user

On 29/08/2017 17:33, Stroller wrote:
> 
>> On 29 Aug 2017, at 15:53, Ian Zimmerman <itz@very.loosely.org> wrote:
>>
>> I don't have a quick solution, but I would look at the state of /dev
>> (not only /dev/sdb* but also the various /dev/disk/by-* directories)
>> both before and after running parted.  parted is my prime suspect for
>> messing things up here.
> 
> Indeed.
> 
> No sdb1 is mentioned, despite it apparently being recognised by the kernel when plugged in (from the last line of the `grep  kernel /var/log/messages` output in my previous post).
> 
>   $ ls -l /dev/disk/* | grep sdb
>   lrwxrwxrwx 1 root root  9 Aug 29 14:51 usb-Generic-_Card_Reader_20060413092100000-0:0 -> ../../sdb
>   lrwxrwxrwx 1 root root  9 Aug 29 14:51 pci-0000:00:12.2-usb-0:1:1.0-scsi-0:0:0:0 -> ../../sdb
>   $ 
> 
> The same command, grepping sda, shows much longer output, with symlinks to all the partitions 
> 
> Is it udev that's responsible for populating the dev nodes?
> (is that the right terminology?)
> 
> How do I force it to reconstruct the partition table? Surely one should expect to be able to format or partition a removable drive and have the dev nodes created without the necessity of rebooting?

run partprobe and see if that makes a difference. It forces the kernel
to re-organize it's idea of what partitions are available.

I would have thought SD Cards were treated like regular hotpluggable
devices like USB storage, but maybe not. I'd be interested to see the
results of running partprobe.


-- 
Alan McKinnon
alan.mckinnon@gmail.com



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Why isn't this SDcard mounting?
  2017-08-29 15:35     ` Alan McKinnon
@ 2017-08-29 16:45       ` Stroller
  2017-08-29 18:15         ` Mick
  0 siblings, 1 reply; 9+ messages in thread
From: Stroller @ 2017-08-29 16:45 UTC (permalink / raw
  To: gentoo-user


> On 29 Aug 2017, at 16:35, Alan McKinnon <alan.mckinnon@gmail.com> wrote:
>> 
>> Is it udev that's responsible for populating the dev nodes?
>> (is that the right terminology?)
>> 
>> How do I force it to reconstruct the partition table? Surely one should expect to be able to format or partition a removable drive and have the dev nodes created without the necessity of rebooting?
> 
> run partprobe and see if that makes a difference. It forces the kernel
> to re-organize it's idea of what partitions are available.
> 
> I would have thought SD Cards were treated like regular hotpluggable
> devices like USB storage, but maybe not. I'd be interested to see the
> results of running partprobe.

   $ sudo partprobe -s
   /dev/sda: gpt partitions 1 2 3 4 5
   /dev/sdb: msdos partitions 1
   $ 

The following is also dumped to /var/log/messages:

   Aug 29 17:31:13 alrai sudo[20565]: stroller : TTY=pts/1 ; PWD=/home/stroller ; USER=root ; COMMAND=/bin/bash -c partprobe
   Aug 29 17:31:13 alrai sudo[20565]: pam_unix(sudo:session): session opened for user root by (uid=0)
   Aug 29 17:31:13 alrai kernel:  sdb: sdb1
   Aug 29 17:31:13 alrai kernel:  sdb: sdb1
   Aug 29 17:31:13 alrai sudo[20565]: pam_unix(sudo:session): session closed for user root

However no new device nodes are added in /dev.

This is a headless system, mostly used as a file server. It doesn't run a desktop (although I've run X11 apps using xpra a few times in the past). I've never done anything to set up hotplugging.

Stroller.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Why isn't this SDcard mounting?
  2017-08-29 16:45       ` Stroller
@ 2017-08-29 18:15         ` Mick
  2017-08-29 21:27           ` Stroller
  0 siblings, 1 reply; 9+ messages in thread
From: Mick @ 2017-08-29 18:15 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1863 bytes --]

On Tuesday, 29 August 2017 17:45:48 BST Stroller wrote:
> > On 29 Aug 2017, at 16:35, Alan McKinnon <alan.mckinnon@gmail.com> wrote:
> >> Is it udev that's responsible for populating the dev nodes?
> >> (is that the right terminology?)
> >> 
> >> How do I force it to reconstruct the partition table? Surely one should
> >> expect to be able to format or partition a removable drive and have the
> >> dev nodes created without the necessity of rebooting?> 
> > run partprobe and see if that makes a difference. It forces the kernel
> > to re-organize it's idea of what partitions are available.
> > 
> > I would have thought SD Cards were treated like regular hotpluggable
> > devices like USB storage, but maybe not. I'd be interested to see the
> > results of running partprobe.
> 
>    $ sudo partprobe -s
>    /dev/sda: gpt partitions 1 2 3 4 5
>    /dev/sdb: msdos partitions 1
>    $
> 
> The following is also dumped to /var/log/messages:
> 
>    Aug 29 17:31:13 alrai sudo[20565]: stroller : TTY=pts/1 ;
> PWD=/home/stroller ; USER=root ; COMMAND=/bin/bash -c partprobe Aug 29
> 17:31:13 alrai sudo[20565]: pam_unix(sudo:session): session opened for user
> root by (uid=0) Aug 29 17:31:13 alrai kernel:  sdb: sdb1
>    Aug 29 17:31:13 alrai kernel:  sdb: sdb1
>    Aug 29 17:31:13 alrai sudo[20565]: pam_unix(sudo:session): session closed
> for user root
> 
> However no new device nodes are added in /dev.
> 
> This is a headless system, mostly used as a file server. It doesn't run a
> desktop (although I've run X11 apps using xpra a few times in the past).
> I've never done anything to set up hotplugging.
> 
> Stroller.

This may have been mentioned already, but do you have sys-fs/udisks installed?

Check the output of udisksctl status/monitor/info and see what it reveals.  
Then check if you can mount the device with udiskctl.
-- 
Regards,
Mick

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Why isn't this SDcard mounting?
  2017-08-29 18:15         ` Mick
@ 2017-08-29 21:27           ` Stroller
  2017-08-30  9:10             ` Mick
  0 siblings, 1 reply; 9+ messages in thread
From: Stroller @ 2017-08-29 21:27 UTC (permalink / raw
  To: gentoo-user


> On 29 Aug 2017, at 19:15, Mick <michaelkintzios@gmail.com> wrote:
> ...
> This may have been mentioned already, but do you have sys-fs/udisks installed?

I did not.

> Check the output of udisksctl status/monitor/info and see what it reveals.  
> Then check if you can mount the device with udiskctl.

Having installed it I got "Error connecting to the udisks daemon: Could not connect: No such file or directory" a few times, until it occurred to me to start dbus. This may be the first time I've ever done so.

I was then able to get a status and info for the drive. 

I cannot mount the drive using `sudo mount -v /dev/sdb1 /mnt/tmp`, but I am able to do so using `udisksctl`:

  $ sudo udisksctl mount -b /dev/sdb1                  
  Mounted /dev/sdb1 at /run/media/root/6D18-12B4.
  $

Unexpectedly I find 10MB of files on the device - the same size as the loopback device which previously claimed to be mounted (and 6MB less than the files I had intended to copy to it).

No /dev/sdb1 has been created.

There are aspects of this I still don't understand, but I am grateful to everyone who has provided their time.

Stroller.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Why isn't this SDcard mounting?
  2017-08-29 21:27           ` Stroller
@ 2017-08-30  9:10             ` Mick
  0 siblings, 0 replies; 9+ messages in thread
From: Mick @ 2017-08-30  9:10 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 2013 bytes --]

On Tuesday, 29 August 2017 22:27:36 BST Stroller wrote:
> > On 29 Aug 2017, at 19:15, Mick <michaelkintzios@gmail.com> wrote:
> > ...
> > This may have been mentioned already, but do you have sys-fs/udisks
> > installed?
> I did not.
> 
> > Check the output of udisksctl status/monitor/info and see what it reveals.
> > Then check if you can mount the device with udiskctl.
> 
> Having installed it I got "Error connecting to the udisks daemon: Could not
> connect: No such file or directory" a few times, until it occurred to me to
> start dbus. This may be the first time I've ever done so.
> 
> I was then able to get a status and info for the drive.
> 
> I cannot mount the drive using `sudo mount -v /dev/sdb1 /mnt/tmp`, but I am
> able to do so using `udisksctl`:
> 
>   $ sudo udisksctl mount -b /dev/sdb1
>   Mounted /dev/sdb1 at /run/media/root/6D18-12B4.
>   $

OK, this shows your kernel modules for mounting this device are not missing 
anything critical.


> Unexpectedly I find 10MB of files on the device - the same size as the
> loopback device which previously claimed to be mounted (and 6MB less than
> the files I had intended to copy to it).
> 
> No /dev/sdb1 has been created.
> 
> There are aspects of this I still don't understand, but I am grateful to
> everyone who has provided their time.
> 
> Stroller.

Many desktops use udisks to handle plugging/unplugging:

 https://wiki.gentoo.org/wiki/Udisks

which requires dbus and polkit.  However, if this is running headless and 
minimal without many of the desktop nice-to-have functionality, at least check 
you have added your user to the plugdev group and perhaps usb.

Instead of udisks you can also use:

- 'udevadm monitor' and plug your device to see what kernel and udev events it 
generates.

- 'lsblk -o +fstype,label,uuid,partuuid' to make sure the device mount point 
is not being claimed by some other mount like loopback - which I noticed in 
your output, but can't explain why it is happening ...  :-/

HTH.
-- 
Regards,
Mick

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Why isn't this SDcard mounting?
  2017-08-29 13:53 [gentoo-user] Why isn't this SDcard mounting? Stroller
  2017-08-29 14:53 ` [gentoo-user] " Ian Zimmerman
@ 2017-08-31  9:42 ` Stroller
  1 sibling, 0 replies; 9+ messages in thread
From: Stroller @ 2017-08-31  9:42 UTC (permalink / raw
  To: gentoo-user


> On 29 Aug 2017, at 14:53, Stroller <stroller@stellar.eclipse.co.uk> wrote:
> ...
> Instead of mounting the SDcard, it's mounting the loopback device.
> 
> A card, as /dev/sdb, was previously zeroed over and repartitioned a couple of days ago. I bet if I reboot the system it'll be recognised. How do I get it to be recognised now?

At some point yesterday, making no progress with `udisksctl` (I think that mounted the loopback device, too, despite claiming to have succeeded in mounting /dev/sdb1 as described in my email of 10:20pm 29-8-2017), I just wanted to use the SDcard and rebooted the system.

As expected, when I put the card back in, everything worked perfectly.

My belief is that this is related to zeroing out or recreating the partition table.

Stroller.



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-08-31  9:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-29 13:53 [gentoo-user] Why isn't this SDcard mounting? Stroller
2017-08-29 14:53 ` [gentoo-user] " Ian Zimmerman
2017-08-29 15:33   ` [gentoo-user] " Stroller
2017-08-29 15:35     ` Alan McKinnon
2017-08-29 16:45       ` Stroller
2017-08-29 18:15         ` Mick
2017-08-29 21:27           ` Stroller
2017-08-30  9:10             ` Mick
2017-08-31  9:42 ` Stroller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox