LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-26-2020, 02:47 AM   #1
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,055

Rep: Reputation: Disabled
Request for probing some devices' types


Hello,

In the next Slint installer in 'auto' mode I plan to format the root partitions with a f2fs file system for these drives types in addition to USB sticks:
  1. eMMC drives (flash drives soldered to the motherboard with typically a 32G or 64G capacity found in cheap laptops)
  2. SD cards connected through an USB adapter (because not all machines can boot off an SD card inserted directly in an SD slot of the machine)
To minimize the need of user input I need to gather as much information as available about drives attached to or plugged in the system at time of installation, using the lsblk command.

I own neither eMMC nor USB adapter for SD cards, so you could help to find how to detect these configurations posting the output of this command:
Code:
lsblk -pPo name,rm,rota,hotplug,tran,disc-gran,type,subsystems,size,vendor,model|grep 'TYPE="disk"'
and tell for each line to which kind of device and connection mode it corresponds.

Thanks in advance,

Last edited by Didier Spaier; 06-26-2020 at 04:02 AM. Reason: disc-gra fields added.
 
Old 06-26-2020, 05:00 AM   #2
gouttegd
Member
 
Registered: Nov 2019
Location: London, UK
Distribution: Slackware
Posts: 92

Rep: Reputation: 161Reputation: 161
Hello,

Here’s the result for a micro-SD card in a USB card reader (“EMTEC USB2.0 23-in-1 CardReader”):
Code:
NAME="/dev/sdc" RM="1" ROTA="1" HOTPLUG="1" TRAN="usb" DISC-GRAN="0B" TYPE="disk" SUBSYSTEMS="block:scsi:usb:pci" SIZE="7.5G" VENDOR="Generic " MODEL="USB_SD_Reader"
For information, the same card when plugged directly into the built-in SD card reader of my laptop:
Code:
NAME="/dev/mmcblk0" RM="0" ROTA="0" HOTPLUG="1" TRAN="" DISC-GRAN="4M" TYPE="disk" SUBSYSTEMS="block:mmc:mmc_host:platform:pci" SIZE="7.5G" VENDOR="" MODEL=""
Of note, in both cases there is a microSD-to-SD adapter between the actual card and the reader.
 
1 members found this post helpful.
Old 06-26-2020, 05:05 AM   #3
3rensho
Senior Member
 
Registered: Mar 2008
Location: Deutschland
Distribution: Slackware64-current
Posts: 1,018

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Here is the info for the SD card from my camera in a usb card reader -

Code:
NAME="/dev/sdg" RM="1" ROTA="1" HOTPLUG="1" TRAN="usb" DISC-GRAN="0B" TYPE="disk" SUBSYSTEMS="block:scsi:usb:pci" SIZE="59.5G" VENDOR="Generic " MODEL="STORAGE_DEVICE"
 
1 members found this post helpful.
Old 06-26-2020, 06:08 AM   #4
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,147

Rep: Reputation: 855Reputation: 855Reputation: 855Reputation: 855Reputation: 855Reputation: 855Reputation: 855
Code:
NAME="/dev/sda" RM="0" ROTA="1" HOTPLUG="1" TRAN="usb" DISC-GRAN="0B" TYPE="disk" SUBSYSTEMS="block:scsi:usb:platform" SIZE="3.7T" VENDOR="WD      " MODEL="Elements 25A3   "
NAME="/dev/sdb" RM="0" ROTA="1" HOTPLUG="1" TRAN="usb" DISC-GRAN="0B" TYPE="disk" SUBSYSTEMS="block:scsi:usb:platform" SIZE="1.8T" VENDOR="WD      " MODEL="Ext HDD 1021    "
NAME="/dev/mmcblk0" RM="0" ROTA="0" HOTPLUG="1" TRAN="" DISC-GRAN="4M" TYPE="disk" SUBSYSTEMS="block:mmc:mmc_host:platform" SIZE="14.4G" VENDOR="" MODEL=""
ke
An SSD card, 1 4T usb, 1 2T usb plugged into a pi4
 
1 members found this post helpful.
Old 06-26-2020, 06:12 AM   #5
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,147

Rep: Reputation: 855Reputation: 855Reputation: 855Reputation: 855Reputation: 855Reputation: 855Reputation: 855
Code:
NAME="/dev/sda" RM="0" ROTA="1" HOTPLUG="0" TRAN="sata" DISC-GRAN="0B" TYPE="disk" SUBSYSTEMS="block:scsi:pci" SIZE="596.2G" VENDOR="ATA     " MODEL="WDC WD6400AAKS-2"
NAME="/dev/sdb" RM="0" ROTA="1" HOTPLUG="1" TRAN="usb" DISC-GRAN="0B" TYPE="disk" SUBSYSTEMS="block:scsi:usb:pci" SIZE="1.8T" VENDOR="Seagate " MODEL="Expansion Desk  "
NAME="/dev/sdh" RM="0" ROTA="1" HOTPLUG="1" TRAN="usb" DISC-GRAN="0B" TYPE="disk" SUBSYSTEMS="block:scsi:usb:pci" SIZE="931.5G" VENDOR="Seagate " MODEL="Expansion       "
NAME="/dev/sdi" RM="0" ROTA="1" HOTPLUG="1" TRAN="usb" DISC-GRAN="0B" TYPE="disk" SUBSYSTEMS="block:scsi:usb:pci" SIZE="931.5G" VENDOR="WD      " MODEL="Ext HDD 1021    "
From main desktop
 
1 members found this post helpful.
Old 06-27-2020, 05:42 AM   #6
ZhaoLin1457
Senior Member
 
Registered: Jan 2018
Posts: 1,005

Rep: Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196
Code:
root@darkstar:~# lsblk -pPo name,rm,rota,hotplug,tran,disc-gran,type,subsystems,size,vendor,model|grep 'TYPE="disk"'
NAME="/dev/sda" RM="1" ROTA="1" HOTPLUG="1" TRAN="usb" DISC-GRAN="0B" TYPE="disk" SUBSYSTEMS="block:scsi:usb:pci" SIZE="59.5G" VENDOR="Generic " MODEL="STORAGE_DEVICE"
NAME="/dev/mmcblk0" RM="0" ROTA="0" HOTPLUG="1" TRAN="" DISC-GRAN="4M" TYPE="disk" SUBSYSTEMS="block:mmc:mmc_host:platform" SIZE="58.2G" VENDOR="" MODEL=""
NAME="/dev/mmcblk0boot0" RM="0" ROTA="0" HOTPLUG="1" TRAN="" DISC-GRAN="4M" TYPE="disk" SUBSYSTEMS="block:mmc:mmc_host:platform" SIZE="4M" VENDOR="" MODEL=""
NAME="/dev/mmcblk0boot1" RM="0" ROTA="0" HOTPLUG="1" TRAN="" DISC-GRAN="4M" TYPE="disk" SUBSYSTEMS="block:mmc:mmc_host:platform" SIZE="4M" VENDOR="" MODEL=""
NAME="/dev/zram0" RM="0" ROTA="0" HOTPLUG="0" TRAN="" DISC-GRAN="4K" TYPE="disk" SUBSYSTEMS="block" SIZE="2G" VENDOR="" MODEL=""
NAME="/dev/zram1" RM="0" ROTA="0" HOTPLUG="0" TRAN="" DISC-GRAN="4K" TYPE="disk" SUBSYSTEMS="block" SIZE="256M" VENDOR="" MODEL=""
NAME="/dev/zram2" RM="0" ROTA="0" HOTPLUG="0" TRAN="" DISC-GRAN="4K" TYPE="disk" SUBSYSTEMS="block" SIZE="256M" VENDOR="" MODEL=""
NAME="/dev/zram3" RM="0" ROTA="0" HOTPLUG="0" TRAN="" DISC-GRAN="4K" TYPE="disk" SUBSYSTEMS="block" SIZE="256M" VENDOR="" MODEL=""
NAME="/dev/zram4" RM="0" ROTA="0" HOTPLUG="0" TRAN="" DISC-GRAN="4K" TYPE="disk" SUBSYSTEMS="block" SIZE="256M" VENDOR="" MODEL=""
root@darkstar:~#
The computer is a mini-pc, model: MinisForum Z83-F.

The Slackware is installed in a 64GB Sandisk Ultra SD-card, which contains two partitions: the first is an UEFI ESP of 400MB and the second is a 59GB partition with F2FS filesystem and it hosts the system. The SD-card in its adapter slot is not recognized directly by the Slackware, even the BIOS and Windows 10 see it correctly, that's why I put it in a no-name USB 3.0 SD-card adapter, where gives speeds around 80MB write and 100MB/s read. The USB 3.0 adapter with its SD-card is recognized as: /dev/sda

The eMMC have 64GB and contains the Windows 10 Pro shipped with the computer, and it is recognized as: /dev/mmcblk0

You can ignore the devices "/dev/zramX" as they are obviously ZRAM devices used for /tmp and swap.

As a side note, I would like to mention that F2FS is not compatible with LILO, and how my "Linux on SD-card" is intended to work with both UEFI with no CSM and classic BIOS, I'we reused the UEFI ESP partition as kernel and initrd loaded by LILO, and also put there the boot map, with this config option in /etc/lilo.conf :
Code:
map = /boot/efi/boot.map
Finally, I discovered that a good SD-card put in a USB 3.0 adapter will beat hands down even a good USB 3.0 flash drive, as durability, read speed and write speed. How many USB 3.0 flash drives writes consistently with 80MB/s ?

Last edited by ZhaoLin1457; 06-27-2020 at 06:10 AM.
 
3 members found this post helpful.
Old 06-27-2020, 07:26 AM   #7
Labinnah
Member
 
Registered: May 2014
Location: Łódź, Poland
Distribution: Slackware-current
Posts: 185

Rep: Reputation: 112Reputation: 112
Code:
NAME="/dev/sdc" RM="1" ROTA="1" HOTPLUG="1" TRAN="usb" DISC-GRAN="0B" TYPE="disk" SUBSYSTEMS="block" SIZE="1,9G" VENDOR="Generic-" MODEL="SD/MMC          "
NAME="/dev/sdg" RM="1" ROTA="1" HOTPLUG="1" TRAN="usb" DISC-GRAN="0B" TYPE="disk" SUBSYSTEMS="block" SIZE="1,9G" VENDOR="SD/MMC  " MODEL="Card  Reader    "
sdc - is stationary usb reader, and sdg - portable usb reader.
 
1 members found this post helpful.
Old 06-27-2020, 05:37 PM   #8
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,055

Original Poster
Rep: Reputation: Disabled
Thanks to all who responded so far.

First, a reminder of the fields names meanings, from "lsblk --help":
  • RM removable device
  • ROTA rotational device [1]
  • HOTPLUG removable or hotplug device (usb, pcmcia, ...) [2]
  • TRAN device transport type
  • DISC-GRAN discard granularity [3]
  • TYPE device type [4]
  • SUBSYSTEMS de-duplicated chain of subsystems [5]
From your answers, my tentative findings are as follows:
  • SD cards inserted directly the machine and eMMC drives are named /dev/mmcblk<device number> and members of subsystems mmc and mmc_host, with TRAN empty, ROTA=0 RM=0, discard
  • SD cards connected through an USB reader aka USB adapter named /dev/sd<device letter>, are members of the subsystems scsi and usb (but for Labinnah?) have tran=USB, ROTA=1 and RM=1, no discard
  • So it looks like the SD card be somehow "hidden" behind the USB reader
  • Nothing obvious distinguishes an eMMC from a SD card directly inserted in the machine.
  • Nothing obvious distinguishes an SD card in an USB reader from an USB stick (tested by me)
It looks like I can't avoid to ask a user "which the kind of device it is" to distinguish an eMMC from a SD card (that I plan to only accept as target drive for installation if connected through an USB reader)

Will I advise users not to install an an USB stick will depend on tests I will make using an f2fs vs an ext4 file system for the root partition.

If you made performance tests ext4 vs f2fs with an eMMC, please report your findings.

[1] I am puzzled as USB stick have ROTA=1. It looks like this field come from /sys/devices/*/queue/rotational
[2] I am puzzled that eMMC have HOTPLUG=1
[3] This answers the question: does the device supports discards (no if 0 else yes). This could be used to distinguish hard disks from SSD, but I plan to use ext4 for SSD anyway.
[4] Part for partition is considered as a device type as disk.
[5] It seems that a subsystem here means a bus listed in "ls /sys/bus" cf. this document, as for udev.

Answers are still welcome, including comments on these assumptions and tentative conclusions.

Last edited by Didier Spaier; 07-02-2020 at 03:35 AM. Reason: "as for udev" added.
 
  


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
Code location in kernel responsible for probing devices attached/detached ayyasprings Linux - Embedded & Single-board computer 3 06-22-2015 10:29 AM
[SOLVED] when booting from PSlinuxOs 2009.1 cd - segmentation fault when probing scsi devices Gusmyster Linux - Newbie 2 01-01-2011 09:06 PM
[Drivers] probing I2C devices kamou Programming 0 03-13-2009 04:45 AM
Solaris reboots after "probing System Devices" rajaniyer123 Solaris / OpenSolaris 1 02-06-2009 08:29 AM
Probing USB devices Cotobear Slackware 9 04-13-2008 04:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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