balena-io-modules / drivelist

List all connected drives in your computer, in all major operating systems
Apache License 2.0
242 stars 90 forks source link

Invalid or Inconsistent device parameter #361

Closed sudhakar3697 closed 4 years ago

sudhakar3697 commented 4 years ago

Platform: Ubuntu

I get the below using this library,

{
  enumerator: 'lsblk:json',
  busType: 'USB',
  device: '/dev/sdb',
  devicePath: '/dev/disk/by-path/pci-0000:00:15.0-usb-0:4:1.0-scsi-0:0:0:0',
  raw: '/dev/sdb',
  mountpoints: [ { path: '/media/bremen/TEST 12', label: 'TEST 12' } ],
  isUSB: true
}

I get the below path using df command

/dev/sdb1 31249232 2544 31246688 1% /media/bremen/TEST 12

lurch commented 4 years ago

The /dev/sdb being displayed by drivelist refers to the raw block-device (e.g. a specific USB flash drive or SD-card). The /dev/sdb1 being displayed by df refers to the first partition on the /dev/sdb block-device. It's possible for a block-device to contain multiple partitions (although most external media only contains a single partition).

You may find the output of the lsblk command useful :wink: