Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: return all partitions in linux, regardless of mount status #1251

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SunPodder
Copy link

fix #1181

It lists all the actual disks in the first place, so pseudo fs checks can be avoided altogether.

@GuillaumeGomez
Copy link
Owner

Here's a part of the output on my computer:

Disk("/dev/loop30")[FS: "squashfs"][Type: SSD][removable: no] mounted on "/snap/core20/2264": 0/67108864 B
Disk("/dev/loop0")[FS: "squashfs"][Type: SSD][removable: no] mounted on "/snap/amberol/30": 0/6291456 B
Disk("/dev/loop10")[FS: "squashfs"][Type: SSD][removable: no] mounted on "/snap/core22/1122": 0/77856768 B
Disk("/dev/loop14")[FS: "squashfs"][Type: SSD][removable: no] mounted on "/snap/firefox/3972": 0/281411584 B
Disk("/dev/loop13")[FS: "squashfs"][Type: SSD][removable: no] mounted on "/snap/firefox/3941": 0/280494080 B
Disk("/dev/nvme0n1p1")[FS: "vfat"][Type: SSD][removable: no] mounted on "/boot/efi": 521060352/535805952 B
Disk("/dev/loop9")[FS: "squashfs"][Type: SSD][removable: no] mounted on "/snap/core22/1033": 0/77725696 B
Disk("/dev/nvme0n1p3")[FS: ""][Type: SSD][removable: no] mounted on "": 0/0 B
Disk("/dev/loop22")[FS: "squashfs"][Type: SSD][removable: no] mounted on "/snap/just/1": 0/1441792 B
Disk("/dev/loop25")[FS: "squashfs"][Type: SSD][removable: no] mounted on "/snap/quadrapassel/483": 0/655360 B
Disk("/dev/nvme0n1")[FS: ""][Type: SSD][removable: no] mounted on "": 0/0 B
Disk("/dev/loop15")[FS: "squashfs"][Type: SSD][removable: no] mounted on "/snap/gnome-3-38-2004/140": 0/366739456 B
Disk("/dev/loop4")[FS: "squashfs"][Type: SSD][removable: no] mounted on "/snap/chromium/2805": 0/168427520 B
Disk("/dev/dm-2")[FS: ""][Type: SSD][removable: no] mounted on "": 0/0 B

It's definitely not actual disks, just all FS.

@SunPodder
Copy link
Author

Sorry I wasn't aware that /proc/partitions also contains loop devices. Fixed it.

@GuillaumeGomez
Copy link
Owner

Now my disk isn't listed anymore and I have:

Disk("/dev/nvme0n1p1")[FS: "vfat"][Type: SSD][removable: no] mounted on "/boot/efi": 521060352/535805952 B
Disk("/dev/nvme0n1p2")[FS: "ext4"][Type: SSD][removable: no] mounted on "/boot": 400248832/737214464 B
Disk("/dev/loop8")[FS: ""][Type: SSD][removable: no] mounted on "": 0/0 B
Disk("/dev/loop4")[FS: ""][Type: SSD][removable: no] mounted on "": 0/0 B
Disk("/dev/dm-2")[FS: ""][Type: SSD][removable: no] mounted on "": 0/0 B
Disk("/dev/loop24")[FS: ""][Type: SSD][removable: no] mounted on "": 0/0 B
Disk("/dev/loop15")[FS: ""][Type: SSD][removable: no] mounted on "": 0/0 B
Disk("/dev/loop3")[FS: ""][Type: SSD][removable: no] mounted on "": 0/0 B
Disk("/dev/loop13")[FS: ""][Type: SSD][removable: no] mounted on "": 0/0 B
Disk("/dev/loop10")[FS: ""][Type: SSD][removable: no] mounted on "": 0/0 B

@SunPodder SunPodder marked this pull request as draft April 14, 2024 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disks only returns the mounted partitions
2 participants