LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 12-12-2017, 09:48 AM   #1
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

Rep: Reputation: Disabled
Get information about a SD card


Trying to better understand devices and how to be able to uniquely identify a SD card. I've included comments on my understanding as well as a couple questions. If anything looks out of whack or there are other steps I should be doing, please comment. Also, as mentioned below, I never really did find a unique identifier for the actual SD device. Thanks

Find recent attached devices.
Code:
michael@rpi1:~ $ dmesg | tail
[123374.657782] scsi host0: usb-storage 1-1.5.4:1.0
[123375.684169] scsi 0:0:0:0: Direct-Access     Multiple Card  Reader     1.00 PQ: 0 ANSI: 0
[123375.697864] sd 0:0:0:0: Attached scsi generic sg0 type 0
[123376.098651] sd 0:0:0:0: [sda] 62333952 512-byte logical blocks: (31.9 GB/29.7 GiB)
[123376.099185] sd 0:0:0:0: [sda] Write Protect is off
[123376.099202] sd 0:0:0:0: [sda] Mode Sense: 03 00 00 00
[123376.099689] sd 0:0:0:0: [sda] No Caching mode page found
[123376.099701] sd 0:0:0:0: [sda] Assuming drive cache: write through
[123376.111471]  sda: sda1 sda2 < sda5 sda6 sda7 >
[123376.116459] sd 0:0:0:0: [sda] Attached SCSI removable disk
A couple ways to determine what is currently mounted.
Code:
michael@rpi1:~ $ mount
/dev/mmcblk0p2 on / type ext4 (rw,noatime,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=468152k,nr_inodes=117038,mode=755)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)
tmpfs on /etc/machine-id type tmpfs (ro,mode=755)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=22,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
/dev/mmcblk0p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)

michael@rpi1:~ $ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        15G  3.8G   11G  28% /
devtmpfs        458M     0  458M   0% /dev
tmpfs           462M     0  462M   0% /dev/shm
tmpfs           462M   47M  416M  11% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           462M     0  462M   0% /sys/fs/cgroup
/dev/mmcblk0p1   41M   21M   20M  52% /boot
A couple ways to find out what can be mounted.
Code:
michael@rpi1:~ $ lsblk -f
NAME        FSTYPE LABEL UUID MOUNTPOINT
sda
├─sda2
├─sda7
├─sda5
├─sda1
└─sda6
mmcblk0
├─mmcblk0p2                   /
└─mmcblk0p1                   /boot

michael@rpi1:~ $ cat /proc/partitions
major minor  #blocks  name

   1        0       4096 ram0
   1        1       4096 ram1
   1        2       4096 ram2
   1        3       4096 ram3
   1        4       4096 ram4
   1        5       4096 ram5
   1        6       4096 ram6
   1        7       4096 ram7
   1        8       4096 ram8
   1        9       4096 ram9
   1       10       4096 ram10
   1       11       4096 ram11
   1       12       4096 ram12
   1       13       4096 ram13
   1       14       4096 ram14
   1       15       4096 ram15
 179        0   15558144 mmcblk0
 179        1      41984 mmcblk0p1
 179        2   15512064 mmcblk0p2
   8        0   31166976 sda
   8        1    1243951 sda1
   8        2          1 sda2
   8        5      32767 sda5
   8        6      67584 sda6
   8        7   29815296 sda7

michael@rpi1:~ $ sudo fdisk -l

Disk /dev/ram0: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram1: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram2: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram3: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram4: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram5: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram6: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram7: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram8: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram9: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram10: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram11: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram12: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram13: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram14: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram15: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mmcblk0: 14.9 GiB, 15931539456 bytes, 31116288 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x73ecdf7d

Device         Boot Start      End  Sectors  Size Id Type
/dev/mmcblk0p1       8192    92159    83968   41M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      92160 31116287 31024128 14.8G 83 Linux

Disk /dev/sda: 29.7 GiB, 31914983424 bytes, 62333952 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00009590

Device     Boot   Start      End  Sectors  Size Id Type
/dev/sda1          8192  2496093  2487902  1.2G  e W95 FAT16 (LBA)
/dev/sda2       2496094 62333951 59837858 28.5G  5 Extended
/dev/sda5       2498560  2564093    65534   32M 83 Linux
/dev/sda6       2564096  2699263   135168   66M  c W95 FAT32 (LBA)
/dev/sda7       2703360 62333951 59630592 28.4G 83 Linux
Mount some devices. Questions:
1. Why can I mount sda1, 5, 6, and 7, but sda?
2. Why can't I mount /dev/sda2? What does "superblock" mean?
3. sda7 seems like /root when accessing the device, right? What is the purpose of the other partitions?

Code:
michael@rpi1:~ $ sudo mount /dev/sda /mnt
mount: wrong fs type, bad option, bad superblock on /dev/sda,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.
michael@rpi1:~ $ sudo mount /dev/sda1 /mnt
michael@rpi1:~ $ ls /mnt
bcm2708-rpi-b.dtb       bcm2709-rpi-2-b.dtb  bootcode.bin  defaults                 os        recovery7.img     recovery.elf                recovery.img  riscos-boot.bin
bcm2708-rpi-b-plus.dtb  bcm2710-rpi-3-b.dtb  BUILD-DATA    INSTRUCTIONS-README.txt  overlays  recovery.cmdline  RECOVERY_FILES_DO_NOT_EDIT  recovery.rfs  System Volume Information
michael@rpi1:~ $ sudo umount /dev/sda1
michael@rpi1:~ $ sudo mount /dev/sda2 /mnt
mount: /dev/sda2: can't read superblock
michael@rpi1:~ $ sudo mount /dev/sda5 /mnt
michael@rpi1:~ $ ls /mnt
cache  installed_os.json  lost+found  noobs.conf  os  wpa_supplicant.conf
michael@rpi1:~ $ sudo umount /dev/sda5
michael@rpi1:~ $ sudo mount /dev/sda6 /mnt
michael@rpi1:~ $ ls /mnt
bcm2708-rpi-0-w.dtb  bcm2708-rpi-b-plus.dtb  bcm2709-rpi-2-b.dtb  bcm2710-rpi-cm3.dtb  cmdline.txt  COPYING.linux  fixup.dat     fixup_x.dat  kernel7.img  LICENCE.broadcom  os_config.json  start_cd.elf  start.elf
bcm2708-rpi-b.dtb    bcm2708-rpi-cm.dtb      bcm2710-rpi-3-b.dtb  bootcode.bin         config.txt   fixup_cd.dat   fixup_db.dat  issue.txt    kernel.img   LICENSE.oracle    overlays        start_db.elf  start_x.elf
michael@rpi1:~ $ sudo umount /dev/sda6
michael@rpi1:~ $ sudo mount /dev/sda7 /mnt
michael@rpi1:~ $ ls /mnt
bin  boot  dev  etc  home  lib  lost+found  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var
michael@rpi1:~ $ df -h
michael@rpi1:~ $ sudo umount /dev/sda7
Get info using blkid. Why can I only see /dev/mmcblk0 using sudo? While some of the UUIDs might be unique, surely 3461-3439 and others are not. What is the purpose of these UUIDs? There still does not appear anything which uniquely identifies the device but only some partitions on the device.
Code:
michael@rpi1:~ $ blkid
/dev/mmcblk0p1: LABEL="boot" UUID="70CE-EB76" TYPE="vfat" PARTUUID="73ecdf7d-01"
/dev/mmcblk0p2: UUID="f2100b2f-ed84-4647-b5ae-089280112716" TYPE="ext4" PARTUUID="73ecdf7d-02"
/dev/sda1: LABEL="RECOVERY" UUID="3461-3439" TYPE="vfat" PARTUUID="00009590-01"
/dev/sda5: LABEL="SETTINGS" UUID="85cbdbf9-b8b0-4629-b25d-860937c2c0e0" TYPE="ext4" PARTUUID="00009590-05"
/dev/sda6: LABEL="boot" UUID="7060-423E" TYPE="vfat" PARTUUID="00009590-06"
/dev/sda7: LABEL="root0" UUID="ce42dd60-6b4c-46be-9e92-066555a5467f" TYPE="ext4" PARTUUID="00009590-07"

michael@rpi1:~ $ sudo blkid
/dev/mmcblk0p1: LABEL="boot" UUID="70CE-EB76" TYPE="vfat" PARTUUID="73ecdf7d-01"
/dev/mmcblk0p2: UUID="f2100b2f-ed84-4647-b5ae-089280112716" TYPE="ext4" PARTUUID="73ecdf7d-02"
/dev/sda1: LABEL="RECOVERY" UUID="3461-3439" TYPE="vfat" PARTUUID="00009590-01"
/dev/sda5: LABEL="SETTINGS" UUID="85cbdbf9-b8b0-4629-b25d-860937c2c0e0" TYPE="ext4" PARTUUID="00009590-05"
/dev/sda6: LABEL="boot" UUID="7060-423E" TYPE="vfat" PARTUUID="00009590-06"
/dev/sda7: LABEL="root0" UUID="ce42dd60-6b4c-46be-9e92-066555a5467f" TYPE="ext4" PARTUUID="00009590-07"
/dev/mmcblk0: PTUUID="73ecdf7d" PTTYPE="dos"
Well, this is a little overwhelming
Code:
michael@rpi1:~ $ sudo udevadm info -a -n /dev/sda

Udevadm info 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 '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5.4/1-1.5.4:1.0/host0/target0:0:0/0:0:0:0/block/sda':
    KERNEL=="sda"
    SUBSYSTEM=="block"
    DRIVER==""
    ATTR{badblocks}==""
    ATTR{range}=="16"
    ATTR{capability}=="51"
    ATTR{inflight}=="       0        0"
    ATTR{ext_range}=="256"
    ATTR{ro}=="0"
    ATTR{stat}=="     576      442     9464     1130        2        0        2        0        0      480     1130"
    ATTR{events_poll_msecs}=="2000"
    ATTR{events_async}==""
    ATTR{removable}=="1"
    ATTR{size}=="62333952"
    ATTR{events}=="media_change"
    ATTR{alignment_offset}=="0"
    ATTR{discard_alignment}=="0"

  looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5.4/1-1.5.4:1.0/host0/target0:0:0/0:0:0:0':
    KERNELS=="0:0:0:0"
    SUBSYSTEMS=="scsi"
    DRIVERS=="sd"
    ATTRS{evt_soft_threshold_reached}=="0"
    ATTRS{evt_mode_parameter_change_reported}=="0"
    ATTRS{inquiry}==""
    ATTRS{evt_capacity_change_reported}=="0"
    ATTRS{vendor}=="Multiple"
    ATTRS{timeout}=="30"
    ATTRS{evt_lun_change_reported}=="0"
    ATTRS{evt_media_change}=="0"
    ATTRS{queue_type}=="none"
    ATTRS{device_busy}=="0"
    ATTRS{eh_timeout}=="10"
    ATTRS{model}=="Card  Reader    "
    ATTRS{iocounterbits}=="32"
    ATTRS{queue_depth}=="1"
    ATTRS{type}=="0"
    ATTRS{evt_inquiry_change_reported}=="0"
    ATTRS{max_sectors}=="240"
    ATTRS{iodone_cnt}=="0x47b"
    ATTRS{state}=="running"
    ATTRS{iorequest_cnt}=="0x47b"
    ATTRS{rev}=="1.00"
    ATTRS{ioerr_cnt}=="0x2"
    ATTRS{scsi_level}=="0"
    ATTRS{device_blocked}=="0"

  looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5.4/1-1.5.4:1.0/host0/target0:0:0':
    KERNELS=="target0:0:0"
    SUBSYSTEMS=="scsi"
    DRIVERS==""

  looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5.4/1-1.5.4:1.0/host0':
    KERNELS=="host0"
    SUBSYSTEMS=="scsi"
    DRIVERS==""

  looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5.4/1-1.5.4:1.0':
    KERNELS=="1-1.5.4:1.0"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb-storage"
    ATTRS{bInterfaceProtocol}=="50"
    ATTRS{bInterfaceNumber}=="00"
    ATTRS{bInterfaceSubClass}=="06"
    ATTRS{bInterfaceClass}=="08"
    ATTRS{bAlternateSetting}==" 0"
    ATTRS{authorized}=="1"
    ATTRS{bNumEndpoints}=="02"
    ATTRS{supports_autosuspend}=="1"

  looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5.4':
    KERNELS=="1-1.5.4"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{bDeviceClass}=="00"
    ATTRS{manufacturer}=="Generic"
    ATTRS{bmAttributes}=="80"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{version}==" 2.00"
    ATTRS{devnum}=="5"
    ATTRS{bMaxPower}=="100mA"
    ATTRS{idProduct}=="6366"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{urbnum}=="3250"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{maxchild}=="0"
    ATTRS{bcdDevice}=="0100"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{idVendor}=="058f"
    ATTRS{product}=="Flash Card Reader/Writer"
    ATTRS{speed}=="480"
    ATTRS{removable}=="unknown"
    ATTRS{ltm_capable}=="no"
    ATTRS{serial}=="058F63666438"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{busnum}=="1"
    ATTRS{authorized}=="1"
    ATTRS{quirks}=="0x0"
    ATTRS{configuration}==""
    ATTRS{devpath}=="1.5.4"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bNumInterfaces}==" 1"

  looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5':
    KERNELS=="1-1.5"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{version}==" 2.00"
    ATTRS{devnum}=="4"
    ATTRS{bMaxPower}=="100mA"
    ATTRS{idProduct}=="0101"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{urbnum}=="28"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{maxchild}=="4"
    ATTRS{bcdDevice}=="0111"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{idVendor}=="1a40"
    ATTRS{product}=="USB 2.0 Hub"
    ATTRS{speed}=="480"
    ATTRS{removable}=="removable"
    ATTRS{ltm_capable}=="no"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{busnum}=="1"
    ATTRS{authorized}=="1"
    ATTRS{quirks}=="0x0"
    ATTRS{configuration}==""
    ATTRS{devpath}=="1.5"
    ATTRS{bDeviceProtocol}=="01"
    ATTRS{bNumInterfaces}==" 1"

  looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1':
    KERNELS=="1-1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{version}==" 2.00"
    ATTRS{devnum}=="2"
    ATTRS{bMaxPower}=="2mA"
    ATTRS{idProduct}=="9514"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{urbnum}=="43"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{maxchild}=="5"
    ATTRS{bcdDevice}=="0200"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{idVendor}=="0424"
    ATTRS{speed}=="480"
    ATTRS{removable}=="unknown"
    ATTRS{ltm_capable}=="no"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{busnum}=="1"
    ATTRS{authorized}=="1"
    ATTRS{quirks}=="0x0"
    ATTRS{configuration}==""
    ATTRS{devpath}=="1"
    ATTRS{bDeviceProtocol}=="02"
    ATTRS{bNumInterfaces}==" 1"

  looking at parent device '/devices/platform/soc/3f980000.usb/usb1':
    KERNELS=="usb1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{bDeviceClass}=="09"
    ATTRS{manufacturer}=="Linux 4.9.28-v7+ dwc_otg_hcd"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{version}==" 2.00"
    ATTRS{devnum}=="1"
    ATTRS{bMaxPower}=="0mA"
    ATTRS{idProduct}=="0002"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{urbnum}=="25"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{maxchild}=="1"
    ATTRS{bcdDevice}=="0409"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{idVendor}=="1d6b"
    ATTRS{product}=="DWC OTG Controller"
    ATTRS{speed}=="480"
    ATTRS{authorized_default}=="1"
    ATTRS{interface_authorized_default}=="1"
    ATTRS{removable}=="unknown"
    ATTRS{ltm_capable}=="no"
    ATTRS{serial}=="3f980000.usb"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{busnum}=="1"
    ATTRS{authorized}=="1"
    ATTRS{quirks}=="0x0"
    ATTRS{configuration}==""
    ATTRS{devpath}=="0"
    ATTRS{bDeviceProtocol}=="01"
    ATTRS{bNumInterfaces}==" 1"

  looking at parent device '/devices/platform/soc/3f980000.usb':
    KERNELS=="3f980000.usb"
    SUBSYSTEMS=="platform"
    DRIVERS=="dwc_otg"
    ATTRS{wr_reg_test}=="Time to write GNPTXFSIZ reg 10000000 times: 500 msecs (50 jiffies)"
    ATTRS{grxfsiz}=="GRXFSIZ = 0x00000306"
    ATTRS{srpcapable}=="SRPCapable = 0x1"
    ATTRS{buspower}=="Bus Power = 0x1"
    ATTRS{bussuspend}=="Bus Suspend = 0x0"
    ATTRS{hptxfsiz}=="HPTXFSIZ = 0x02000406"
    ATTRS{hnp}=="HstNegScs = 0x0"
    ATTRS{mode}=="Mode = 0x1"
    ATTRS{mode_ch_tim_en}=="Mode Change Ready Timer Enable = 0x0"
    ATTRS{hsic_connect}=="HSIC Connect = 0x1"
    ATTRS{gsnpsid}=="GSNPSID = 0x4f54280a"
    ATTRS{driver_override}=="(null)"
    ATTRS{hcd_frrem}=="HCD Dump Frame Remaining"
    ATTRS{gotgctl}=="GOTGCTL = 0x001c0001"
    ATTRS{gpvndctl}=="GPVNDCTL = 0x00000000"
    ATTRS{hnpcapable}=="HNPCapable = 0x1"
    ATTRS{spramdump}=="SPRAM Dump"
    ATTRS{regoffset}=="0xffffffff"
    ATTRS{gnptxfsiz}=="GNPTXFSIZ = 0x01000306"
    ATTRS{guid}=="GUID = 0x2708a000"
    ATTRS{regdump}=="Register Dump"
    ATTRS{hprt0}=="HPRT0 = 0x00001005"
    ATTRS{hcddump}=="HCD Dump"
    ATTRS{rem_wakeup_pwrdn}==""
    ATTRS{regvalue}=="invalid offset"
    ATTRS{gusbcfg}=="GUSBCFG = 0x20001700"
    ATTRS{fr_interval}=="Frame Interval = 0x1d4b"
    ATTRS{busconnected}=="Bus Connected = 0x1"
    ATTRS{remote_wakeup}=="Remote Wakeup Sig = 0 Enabled = 0 LPM Remote Wakeup = 0"
    ATTRS{devspeed}=="Device Speed = 0x0"
    ATTRS{rd_reg_test}=="Time to read GNPTXFSIZ reg 10000000 times: 1400 msecs (140 jiffies)"
    ATTRS{enumspeed}=="Device Enumeration Speed = 0x1"
    ATTRS{inv_sel_hsic}=="Invert Select HSIC = 0x0"
    ATTRS{ggpio}=="GGPIO = 0x00000000"
    ATTRS{srp}=="SesReqScs = 0x1"

  looking at parent device '/devices/platform/soc':
    KERNELS=="soc"
    SUBSYSTEMS=="platform"
    DRIVERS==""
    ATTRS{driver_override}=="(null)"

  looking at parent device '/devices/platform':
    KERNELS=="platform"
    SUBSYSTEMS==""
    DRIVERS==""
 
Old 12-12-2017, 09:55 AM   #2
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Code:
$ ls -al /dev/disk/by-uuid
will give you a unique identifier for each drive. Dev/sda is the whole disk. It contains a number of file systems. You can mount the file systems, but not the whole drive. There are some exceptions, but that's why in your case.

Dev/sda2 might be a swap area, which won't mount with mount.
 
Old 12-12-2017, 10:21 AM   #3
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

Original Poster
Rep: Reputation: Disabled
Thanks AwesomeMachine,

So, I have a UUID for sda1, sda5, sda6, and sda7. sda2 as you indicate is likely for swap. Any reason there is not a sda3 or sda4?

sda1. Looks like a partition for NOOBs?
sda5 and sd6. Also looks like it is related to installation? Or maybe a boot (what does this really mean?) partition?
sda7. The filesystem which will be mounted as /. Other than looking for familiar files or directories, how would one know this?

Would sda7 be the most appropriate?

Code:
michael@rpi1:~ $ ls -al /dev/disk/by-uuid
total 0
drwxr-xr-x 2 root root 160 Dec 12 13:24 .
drwxr-xr-x 7 root root 140 Dec 11 03:06 ..
lrwxrwxrwx 1 root root  10 Dec 12 13:24 3461-3439 -> ../../sda1
lrwxrwxrwx 1 root root  10 Dec 12 13:24 7060-423E -> ../../sda6
lrwxrwxrwx 1 root root  15 Dec 11 03:06 70CE-EB76 -> ../../mmcblk0p1
lrwxrwxrwx 1 root root  10 Dec 12 13:24 85cbdbf9-b8b0-4629-b25d-860937c2c0e0 -> ../../sda5
lrwxrwxrwx 1 root root  10 Dec 12 13:24 ce42dd60-6b4c-46be-9e92-066555a5467f -> ../../sda7
lrwxrwxrwx 1 root root  15 Dec 11 03:06 f2100b2f-ed84-4647-b5ae-089280112716 -> ../../mmcblk0p2
michael@rpi1:~ $
 
Old 12-12-2017, 10:58 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,486

Rep: Reputation: 5838Reputation: 5838Reputation: 5838Reputation: 5838Reputation: 5838Reputation: 5838Reputation: 5838Reputation: 5838Reputation: 5838Reputation: 5838Reputation: 5838
Your trying to figure out the Pi NOOBS layout. Depends on the version but look at this link.

https://github.com/raspberrypi/noobs...ning-explained

sda2 is an extended partition which is a container for logical partitions (5,6,7). Its how you can create more then 4 partitions using a legacy MBR formatted disk. It can not be mounted.

A superblock basically is the metadata of the filesystem. It contains all the information about the filesystem and files stored within.

Hard disk drives contain firmware which contains the model number, serial number etc. USB flash drives have the same information but is read when the drive is enumerated i.e. when it is plugged in to the computer. I have never tried running the hdparm -I command to see what happens.

Looks like most of the USB attributes are from the card reader and host controller.

Last edited by michaelk; 12-12-2017 at 11:01 AM.
 
Old 12-12-2017, 11:03 AM   #5
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

Original Poster
Rep: Reputation: Disabled
I think I am blind. I didn't notice this one (copied from my previous post).

Code:
michael@rpi1:~ $ ls -al /dev/disk/by-uuid
total 0
drwxr-xr-x 2 root root 160 Dec 12 13:24 .
drwxr-xr-x 7 root root 140 Dec 11 03:06 ..
lrwxrwxrwx 1 root root  10 Dec 12 13:24 3461-3439 -> ../../sda1
lrwxrwxrwx 1 root root  10 Dec 12 13:24 7060-423E -> ../../sda6
lrwxrwxrwx 1 root root  15 Dec 11 03:06 70CE-EB76 -> ../../mmcblk0p1
lrwxrwxrwx 1 root root  10 Dec 12 13:24 85cbdbf9-b8b0-4629-b25d-860937c2c0e0 -> ../../sda5
lrwxrwxrwx 1 root root  10 Dec 12 13:24 ce42dd60-6b4c-46be-9e92-066555a5467f -> ../../sda7
lrwxrwxrwx 1 root root  15 Dec 11 03:06 f2100b2f-ed84-4647-b5ae-089280112716 -> ../../mmcblk0p2
michael@rpi1:~ $
And then when I remove the SD reader:
Code:
michael@rpi1:~ $ ls -al /dev/disk/by-uuid
total 0
drwxr-xr-x 2 root root  80 Dec 12 15:14 .
drwxr-xr-x 7 root root 140 Dec 11 03:06 ..
lrwxrwxrwx 1 root root  15 Dec 11 03:06 70CE-EB76 -> ../../mmcblk0p1
lrwxrwxrwx 1 root root  15 Dec 11 03:06 f2100b2f-ed84-4647-b5ae-089280112716 -> ../../mmcblk0p2
michael@rpi1:~ $
And then when I put the SD in another RPi, and do the same, I get the following..

Code:
michael@rpi2:~ $ ls -al /dev/disk/by-uuid
total 0
drwxr-xr-x 2 root root 120 Dec 12 15:52 .
drwxr-xr-x 7 root root 140 Dec 12 15:52 ..
lrwxrwxrwx 1 root root  15 Dec 12 15:52 3461-3439 -> ../../mmcblk0p1
lrwxrwxrwx 1 root root  15 Dec 12 15:52 7060-423E -> ../../mmcblk0p6
lrwxrwxrwx 1 root root  15 Dec 12 15:52 85cbdbf9-b8b0-4629-b25d-860937c2c0e0 -> ../../mmcblk0p5
lrwxrwxrwx 1 root root  15 Dec 12 15:52 ce42dd60-6b4c-46be-9e92-066555a5467f -> ../../mmcblk0p7
michael@rpi2:~ $ sudo fdisk -l

...

Disk /dev/mmcblk0: 29.7 GiB, 31914983424 bytes, 62333952 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00009590

Device         Boot   Start      End  Sectors  Size Id Type
/dev/mmcblk0p1         8192  2496093  2487902  1.2G  e W95 FAT16 (LBA)
/dev/mmcblk0p2      2496094 62333951 59837858 28.5G  5 Extended
/dev/mmcblk0p5      2498560  2564093    65534   32M 83 Linux
/dev/mmcblk0p6      2564096  2699263   135168   66M  c W95 FAT32 (LBA)
/dev/mmcblk0p7      2703360 62333951 59630592 28.4G 83 Linux

michael@rpi2:~ $
Okay, rpi1 has a 16GB SD, and maybe two partitions (mmcblk0p1 and mmcblk0p2).
And rpi2 has a 32GB SD, and maybe four partitions (mmcblk0p1 and mmcblk0p5 plus mmcblk0p6 and mmcblk0p7 plus the elusive sda2).
And I see the UUIDs on the SD as well as the device.
Still don't know what it all means, but definitely a pattern

Last edited by NotionCommotion; 12-12-2017 at 11:12 AM.
 
Old 12-12-2017, 11:09 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,486

Rep: Reputation: 5838Reputation: 5838Reputation: 5838Reputation: 5838Reputation: 5838Reputation: 5838Reputation: 5838Reputation: 5838Reputation: 5838Reputation: 5838Reputation: 5838
I'm not sure what you are looking at but the only difference is the device ID. /dev/mmcblk0 is the SD card slot on the PI and /dev/sda is when you plug the card into a USB card reader.
 
Old 12-12-2017, 11:15 AM   #7
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

Original Poster
Rep: Reputation: Disabled
Thanks michaelk, that was becoming my conclusion. I edited my previous post, and showed some of that.
 
Old 12-12-2017, 11:23 AM   #8
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 15.0
Posts: 8,238
Blog Entries: 61

Rep: Reputation: Disabled
I usually stick a bit of a label on them to keep track of what's on which. I've got cards with r2s and r2r: slackwarearm for pi2 & raspbian for pi2.
 
Old 12-12-2017, 11:35 AM   #9
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by brianL View Post
I usually stick a bit of a label on them to keep track of what's on which. I've got cards with r2s and r2r: slackwarearm for pi2 & raspbian for pi2.
My previous approach has been taping (blue painters tape) them to an 11 x 8-1/2 piece of paper with the info written on the paper. Harder to lose!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] Network Card For Slackware, Information Needed LionOfGod Slackware 22 03-14-2011 02:42 PM
Graphics card information cusri2004 Linux - Newbie 2 08-02-2009 10:33 PM
Network (card) information v8hadas Programming 2 03-22-2007 04:18 AM
Red Hat Subscription Information Card w3bbuilder Linux - Newbie 0 10-28-2004 02:10 AM
general video card information versaulis Linux - Hardware 1 06-14-2004 03:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 05:35 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