Can i list unmounted drives without fdisk or lsblk?
When the kernel looks for possible devices it looks at
cat /proc/partitions
Sample output:
major minor #blocks name
8 0 488386584 sda
8 1 472382464 sda1
8 2 1 sda2
8 5 16001024 sda5
11 0 1048575 sr0
The already mounted devices can nab found with
mount | grep ^/
Sample output:
/dev/sda1 on / type ext3 (rw,noatime,errors=remount-ro,data=ordered)
If you don't have the mount
command then
cat /etc/mtab
or
cat /proc/mounts
rasmus91
Updated on September 18, 2022Comments
-
rasmus91 almost 2 years
I have an Inteno dg200 Router running some Iopsys linux version (kernel 3.14 or so, I believe)
I've had some trouble getting a fileshare running using the USB ports and my external harddrive. The system supports it. But no matter what I put in, it does not automatically mount it. So today I decided to ssh into the system as root rather than use my webbased control panel.
To my surprise the system does not support the usual ways of finding information on the connected, unmounted drives. Allow me to elaborate:
# fdisk -l -ash: fdisk: not found
Very well, lets try something else then:
# lsblk -ash: lsblk: not found
And so I begin running into trouble. From what I have been able to learn online, when people have this problem it's usually because
fdisk
lies in /sbin, and that is not in their path as they are not root. Well, I am root here, but to be certain I checked both /sbin and /usr/sbin, but to no avail. Neither directory contained anything calledfdisk
orlsblk
, nor does thefind
command locate anything calledfdisk
.Is there another way to find out what exactly to mount from CLI or can I, perhaps install
fdisk
on the router? -
rasmus91 over 6 years
cat /proc/partitions
gives memajor minor #blocks name 31 0 5120 mtdblock0 31 1 5120 mtdblock1 31 2 384 mtdblock2 31 3 128 mtdblock3 31 4 119296 mtdblock4 31 5 52224 mtdblock5 31 6 67072 mtdblock6 31 7 55056 mtdblock7 31 8 55056 mtdblock8
I'm not sure how that is useful though.