LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 12-06-2017, 10:43 AM   #1
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 732

Rep: Reputation: Disabled
Puzzle to find which SD card is which


I have (4) SD cards.

#1 is 8GB, and came pre-loaded with raspbian noobs.
#2 is 32GB and I successfully copied a raspbian image to it and it is working.
#3 is 32GB, and I think I might have broken a while back.
#4 is 32GB, and I which I don't recall but likely did nothing.

Can you guess which one is which? I "think" I put them in order but am not sure as all 4 of them were mixed up in a small bag. Other than the first one which is obvious, how did you tell?

I will be writing a new image to one of the 32GB SDs and ideally not #2 (the 32GB one with raspbian on it). When I saw the device is sda, I was worried as typically I use another machine to view the SDs and on that machine sda is my hard dirve.
Code:
sudo dd bs=4M if=2017-04-10-raspbian-jessie-lite.img of=/dev/sda
Think the #3 broken one is really broken?

When you look at the below outputs, what information do you find important and how do you interpret it? Are there other applicable commands I should have executed to provide additional information?

Is there a way to get some sort of ID from the cards so I know for sure which one is which?

Thanks

#1
Code:
michael@pi-c72eb01a:~ $ dmesg | tail
[1188349.708301] scsi host0: usb-storage 1-1.4.4:1.0
[1188350.766556] scsi 0:0:0:0: Direct-Access     Multiple Card  Reader     1.00 PQ: 0 ANSI: 0
[1188350.767830] sd 0:0:0:0: Attached scsi generic sg0 type 0
[1188351.088973] sd 0:0:0:0: [sda] 15523840 512-byte logical blocks: (7.95 GB/7.40 GiB)
[1188351.089401] sd 0:0:0:0: [sda] Write Protect is off
[1188351.089413] sd 0:0:0:0: [sda] Mode Sense: 03 00 00 00
[1188351.089831] sd 0:0:0:0: [sda] No Caching mode page found
[1188351.089840] sd 0:0:0:0: [sda] Assuming drive cache: write through
[1188351.111378]  sda: sda1 sda2 < sda5 sda6 > sda3
[1188351.115048] sd 0:0:0:0: [sda] Attached SCSI removable disk
michael@pi-c72eb01a:~ $ cat /proc/partitions
major minor  #blocks  name

 179        0   31166976 mmcblk0
 179        1      42811 mmcblk0p1
 179        2   31119872 mmcblk0p2
   8        0    7761920 sda
   8        1     838677 sda1
   8        2          1 sda2
   8        3      32768 sda3
   8        5      61440 sda5
   8        6    6815744 sda6
michael@pi-c72eb01a:~ $ 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: 0xd19c6641

Device         Boot Start      End  Sectors  Size Id Type
/dev/mmcblk0p1       8192    93813    85622 41.8M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      94208 62333951 62239744 29.7G 83 Linux


Disk /dev/sda: 7.4 GiB, 7948206080 bytes, 15523840 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: 0x00005c05

Device     Boot    Start      End  Sectors  Size Id Type
/dev/sda1           8192  1685546  1677355  819M  e W95 FAT16 (LBA)
/dev/sda2        1687552 15458303 13770752  6.6G 85 Linux extended
/dev/sda3       15458304 15523839    65536   32M 83 Linux
/dev/sda5        1695744  1818623   122880   60M  c W95 FAT32 (LBA)
/dev/sda6        1826816 15458303 13631488  6.5G 83 Linux

Partition table entries are not in disk order.
michael@pi-c72eb01a:~ $
#2
Code:
michael@pi-c72eb01a:~ $ dmesg | tail
[1188632.809693] scsi host0: usb-storage 1-1.4.4:1.0
[1188633.888009] scsi 0:0:0:0: Direct-Access     Multiple Card  Reader     1.00 PQ: 0 ANSI: 0
[1188633.889296] sd 0:0:0:0: Attached scsi generic sg0 type 0
[1188634.138572] sd 0:0:0:0: [sda] 60751872 512-byte logical blocks: (31.1 GB/29.0 GiB)
[1188634.139009] sd 0:0:0:0: [sda] Write Protect is off
[1188634.139022] sd 0:0:0:0: [sda] Mode Sense: 03 00 00 00
[1188634.139443] sd 0:0:0:0: [sda] No Caching mode page found
[1188634.139453] sd 0:0:0:0: [sda] Assuming drive cache: write through
[1188634.143270]  sda: sda1 sda2
[1188634.150702] sd 0:0:0:0: [sda] Attached SCSI removable disk
michael@pi-c72eb01a:~ $ cat /proc/partitions
major minor  #blocks  name

 179        0   31166976 mmcblk0
 179        1      42811 mmcblk0p1
 179        2   31119872 mmcblk0p2
   8        0   30375936 sda
   8        1      64512 sda1
   8        2   30307328 sda2
michael@pi-c72eb01a:~ $ 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: 0xd19c6641

Device         Boot Start      End  Sectors  Size Id Type
/dev/mmcblk0p1       8192    93813    85622 41.8M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      94208 62333951 62239744 29.7G 83 Linux


Disk /dev/sda: 29 GiB, 31104958464 bytes, 60751872 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: 0xbad84222

Device     Boot  Start      End  Sectors  Size Id Type
/dev/sda1         8192   137215   129024   63M  c W95 FAT32 (LBA)
/dev/sda2       137216 60751871 60614656 28.9G 83 Linux
michael@pi-c72eb01a:~ $
#3
Code:
michael@pi-c72eb01a:~ $ dmesg | tail
[1188141.067437] scsi host0: usb-storage 1-1.4.4:1.0
[1188142.125596] scsi 0:0:0:0: Direct-Access     Multiple Card  Reader     1.00 PQ: 0 ANSI: 0
[1188142.126817] sd 0:0:0:0: Attached scsi generic sg0 type 0
[1188142.532785] sd 0:0:0:0: [sda] 62333952 512-byte logical blocks: (31.9 GB/29.7 GiB)
[1188142.533200] sd 0:0:0:0: [sda] Write Protect is off
[1188142.533213] sd 0:0:0:0: [sda] Mode Sense: 03 00 00 00
[1188142.533623] sd 0:0:0:0: [sda] No Caching mode page found
[1188142.533633] sd 0:0:0:0: [sda] Assuming drive cache: write through
[1188142.546917]  sda: sda1
[1188142.549436] sd 0:0:0:0: [sda] Attached SCSI removable disk
michael@pi-c72eb01a:~ $ cat /proc/partitions
major minor  #blocks  name
 179        0   31166976 mmcblk0
 179        1      42811 mmcblk0p1
 179        2   31119872 mmcblk0p2
   8        0   31166976 sda
   8        1   31162880 sda1
michael@pi-c72eb01a:~ $ 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: 0xd19c6641

Device         Boot Start      End  Sectors  Size Id Type
/dev/mmcblk0p1       8192    93813    85622 41.8M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      94208 62333951 62239744 29.7G 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: 0x00000000

Device     Boot Start      End  Sectors  Size Id Type
/dev/sda1        8192 62333951 62325760 29.7G  c W95 FAT32 (LBA)
michael@pi-c72eb01a:~ $
#4
Code:
michael@pi-c72eb01a:~ $ dmesg | tail
[1188519.659198] scsi host0: usb-storage 1-1.4.4:1.0
[1188520.687431] scsi 0:0:0:0: Direct-Access     Multiple Card  Reader     1.00 PQ: 0 ANSI: 0
[1188520.688688] sd 0:0:0:0: Attached scsi generic sg0 type 0
[1188520.941226] sd 0:0:0:0: [sda] 60751872 512-byte logical blocks: (31.1 GB/29.0 GiB)
[1188520.941658] sd 0:0:0:0: [sda] Write Protect is off
[1188520.941671] sd 0:0:0:0: [sda] Mode Sense: 03 00 00 00
[1188520.942084] sd 0:0:0:0: [sda] No Caching mode page found
[1188520.942094] sd 0:0:0:0: [sda] Assuming drive cache: write through
[1188520.947809]  sda: sda1
[1188520.951934] sd 0:0:0:0: [sda] Attached SCSI removable disk
michael@pi-c72eb01a:~ $ cat /proc/partitions
major minor  #blocks  name

 179        0   31166976 mmcblk0
 179        1      42811 mmcblk0p1
 179        2   31119872 mmcblk0p2
   8        0   30375936 sda
   8        1   30374912 sda1

   michael@pi-c72eb01a:~ $ 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: 0xd19c6641

Device         Boot Start      End  Sectors  Size Id Type
/dev/mmcblk0p1       8192    93813    85622 41.8M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      94208 62333951 62239744 29.7G 83 Linux


Disk /dev/sda: 29 GiB, 31104958464 bytes, 60751872 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: 0x0004a452

Device     Boot Start      End  Sectors Size Id Type
/dev/sda1        2048 60751871 60749824  29G 83 Linux
michael@pi-c72eb01a:~ $
Note that I removed some of the RAM entries in the above to reduce clutter.
 
Old 12-06-2017, 11:06 AM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,614

Rep: Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576
Usually, the output from "blkid" and/or "lsblk -f" will give you a pretty good idea of what is what.
 
Old 12-06-2017, 11:27 AM   #3
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 732

Original Poster
Rep: Reputation: Disabled
Thanks rknichols, lsblk -f gives similar information as the others, but is a little more to the point. Thanks. I was previously trying blkid, but it appears to only provide information about the sd card actually being used by the RPi I am access the sd from. Looking through the man,can't seem to figure out how to have it use sda1, etc.
 
Old 12-06-2017, 11:39 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 16,412

Rep: Reputation: 1936Reputation: 1936Reputation: 1936Reputation: 1936Reputation: 1936Reputation: 1936Reputation: 1936Reputation: 1936Reputation: 1936Reputation: 1936Reputation: 1936
Without mounting the cards and examining the contents there is not much that you can guess from the posted information.

SD #4 Looks like you reformatted the drive with a linux file system.

SD #3 Could be you have not done anything.

SD #2 Looks like it might be the copy of your raspbian system.

SD #1 Looks like a NOOBS installed OS.
 
Old 12-06-2017, 11:53 AM   #5
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 732

Original Poster
Rep: Reputation: Disabled
Thanks michaelk. Looks like I was right on #1 and #2, but not #3 and #4. How did you come to your conclusion?

PS. I had tried mounting them, but still blkid did not appear to target them.
 
Old 12-06-2017, 02:46 PM   #6
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,614

Rep: Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576
Quote:
Originally Posted by NotionCommotion View Post
I was previously trying blkid, but it appears to only provide information about the sd card actually being used by the RPi I am access the sd from. Looking through the man,can't seem to figure out how to have it use sda1, etc.
If you run blkid as root, it should probe all attached devices. When run as a non-root user, it can't do that and has to rely on cached information.
 
Old 12-06-2017, 03:34 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 16,412

Rep: Reputation: 1936Reputation: 1936Reputation: 1936Reputation: 1936Reputation: 1936Reputation: 1936Reputation: 1936Reputation: 1936Reputation: 1936Reputation: 1936Reputation: 1936
Just a big guess...

Code:
SD #3
Device     Boot Start      End  Sectors  Size Id Type
/dev/sda1        8192 62333951 62325760 29.7G  c W95 FAT32 (LBA)
It depends on the manufacture but typically drives are formatted as FAT32 if less then 32GB and greater as exFAT or NTFS. The start sector is 8192 which could mean original partition table.

Code:
SD #4
Device     Boot Start      End  Sectors Size Id Type
/dev/sda1        2048 60751871 60749824  29G 83 Linux
Since the partition ID is 83 and the start sector is 2048 that probably means you created a new partition table and formatted with a linux file system.

What happens when you try to mount 3 & 4?
 
Old 12-06-2017, 09:37 PM   #8
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 3,327
Blog Entries: 1

Rep: Reputation: 690Reputation: 690Reputation: 690Reputation: 690Reputation: 690Reputation: 690
They're kind of small. Take images of them, then zero them out. Various ways to mount the partitions of a dd image. With partx and other things. Fedora being an odd one with lvm2 stuff. Worst case dd the image back on them if you figure out you wanted it that way in the first place. Otherwise blkid can give details like UUID, LABEL, and such. I tend to zero out storage devices then use $(cmp) to verify that they're still zero. The failed ones fail that check.
 
Old 12-09-2017, 11:54 AM   #9
dave@burn-it.co.uk
Member
 
Registered: Sep 2011
Distribution: Puppy
Posts: 361

Rep: Reputation: 134Reputation: 134
I would run with one at a time and put a named file on each that identifies it when all are present.
 
  


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
Puzzle Didier Spaier Slackware 9 04-30-2015 05:59 AM
find hidden files from wild card path using 'find' nagendrar Linux - Newbie 5 10-13-2011 11:48 PM
[SOLVED] a little puzzle Ramurd Slackware 7 02-10-2011 01:21 PM
Solaris + find -prune command puzzle dazdaz Solaris / OpenSolaris 1 02-28-2008 07:29 PM
wvdial puzzle..... Can't find phone number! Adrian Baker Linux - Newbie 20 05-10-2004 12:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 01:46 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration