Manully Detect Partition for a Block Device

Posted on Sun 24 March 2019 in linux

Block Device Detected

After a usb stick inserted, the block device (e.g., sdc) can be seen:

$ ls -l /dev/sdc*
brw-rw---- 1 root disk 8, 0 Mar 24 19:20 /dev/sdc

But the partition (sdc1) fails to appear.

The partition actually exists:

# fdisk -l /dev/sdc
Disk /dev/sdc: 15 GiB, 16060055552 bytes, 31367296 sectors
Disk model: DISK
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: 0x019dcfba

Device     Boot Start      End  Sectors Size Id Type
/dev/sdc1  *       46 31367279 31367234  15G  c W95 FAT32 (LBA)

Fix it simply by:

# partprobe

And here it is:

$ ls -l /dev/sdc*
brw-rw---- 1 root disk 8, 0 Mar 24 19:20 /dev/sdc
brw-rw---- 1 root disk 8, 1 Mar 24 19:20 /dev/sdc1

Go on mount it!

Ref: https://unix.stackexchange.com/a/198280

Another possible solution: https://unix.stackexchange.com/a/401671

Block Device Undetected

partx [-a|-d|-s|-u] [--nr <n:m> | <partition>] <disk>

gw