Code Monkey home page Code Monkey logo

Comments (3)

dankamongmen avatar dankamongmen commented on August 17, 2024
[growlight](0)> blockdev
Device     Model             Rev   Bytes PSect Flags Table WWN              PHY 
sdh        ST12000NM0007-2A SN02  12.00T 4096B ✔OW⚠. gpt   5000c500b1c2c393 SAT3
sdg        ST12000NM0007-2A SN02  12.00T 4096B ✔OW⚠. gpt   5000c500b56a29d4 SAT3
sdi        ST12000NM0007-2A SN02  12.00T 4096B ✔OW⚠. gpt   5000c500b56936d2 SAT3
sdf        ST12000NM0007-2A SN02  12.00T 4096B ✔OW⚠. gpt   5000c500b5685ea4 SAT3
sdb        ST12000NM0007-2A SN02  12.00T 4096B ✔OW⚠. gpt   5000c500b3f4afb4 SAT3
sdd        ST12000NM0007-2A SN02  12.00T 4096B ✔OW⚠. gpt   5000c500b49867e5 SAT3
sde        ST12000NM0007-2A SN03  12.00T 4096B ✔OW⚠. gpt   5000c500a5c0e61d SAT3
sda        ST12000NM0007-2A SN02  12.00T 4096B ✔OW⚠. gpt   5000c500b4104bf5 SAT3
sdc        ST12000NM0007-2A SN02  12.00T 4096B ✔OW⚠. gpt   5000c500b4984eca SAT3
sr0        iHBS112   2      CL0F   1.07G  512B UO... none  n/a              PATA
nvme0n1    WDS100T3X0C-00SJ  n/a   1.00T  512B ✔.... gpt   1908E1805012     NVMe
nvme1n1    WDS100T3X0C-00SJ  n/a   1.00T  512B ✔.... gpt   1908E1801188     NVMe
md127      Linux mdadm       1.2 106.23G  512B VM... none  root             NVMe
loop5      n/a               n/a    0.00  512B VO... none  n/a              n/a 
loop3      n/a               n/a    0.00  512B VO... none  n/a              n/a 
loop0      n/a               n/a    0.00  512B VO... none  n/a              n/a 
pktcdvd0   n/a               n/a    0.00 2048B RO... none  n/a              n/a 
loop2      n/a               n/a    0.00  512B VO... none  n/a              n/a 
loop7      n/a               n/a    0.00  512B VO... none  n/a              n/a 
loop4      n/a               n/a    0.00  512B VO... none  n/a              n/a 
loop6      n/a               n/a    0.00  512B VO... none  n/a              n/a 
loop1      n/a               n/a    0.00  512B VO... none  n/a              n/a 
sdl        MS/MS-PRO        1.03    0.00  512B UO... none  n/a              PATA
sdj        Compact Flash    1.01    0.00  512B UO... none  n/a              PATA
sdk        SD/MMC           1.00    0.00  512B UO... none  n/a              PATA
sdm        xD-Picture       1.02    0.00  512B UO... none  n/a              PATA

	Flags:	(R)emovable, (U)nloaded, (V)irtual, (M)dadm, (Z)pool,
		(D)M, r(O)tational, (r)ead-only, (W)ritecache enabled,
		(B)IOS bootable, v/⚠: Read-Write-Verify, ✓/✗/☠: SMART status
[growlight](0)> 

sr0 doesn't show up as removable, but pktcdvd0 helpfully does...

from growlight.

dankamongmen avatar dankamongmen commented on August 17, 2024

I think the way to do this is check /sys/block/DEV/device/type:

#define TYPE_DISK 0x00
#define TYPE_TAPE 0x01
#define TYPE_PRINTER 0x02
#define TYPE_PROCESSOR 0x03 /* HP scanners use this */
#define TYPE_WORM 0x04 /* Treated as ROM by our system */
#define TYPE_ROM 0x05
#define TYPE_SCANNER 0x06
#define TYPE_MOD 0x07 /* Magneto-optical disk -
* - treated as TYPE_DISK */
#define TYPE_MEDIUM_CHANGER 0x08
#define TYPE_COMM 0x09 /* Communications device */
#define TYPE_RAID 0x0c
#define TYPE_ENCLOSURE 0x0d /* Enclosure Services Device */
#define TYPE_RBC 0x0e
#define TYPE_NO_LUN 0x7f

This is 0 for every device I have save my cdrom, which is 0x05.

from growlight.

dankamongmen avatar dankamongmen commented on August 17, 2024

We now properly show "optical" for my BD-RW.

from growlight.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.