theweaselking: (Work now)
[personal profile] theweaselking
Is there an easy way to have the machine tell me which hard disks it can see, and what their device names/numbers are, even though they might be unmounted or unformatted? An equivalent to Windows' Disk Management?

Debian 4 in the specific case, but a general would also be nice.

EDIT: Hmm, /dev/disk/by-id/ is a veeeeeery interesting folder. Will that show disks that aren't partitioned, though?

(no subject)

Date: 2011-12-08 02:02 am (UTC)
From: [identity profile] mhoye.livejournal.com
lshw -businfo ?

(no subject)

Date: 2011-12-08 04:35 am (UTC)
ext_8707: Taken in front of Carnegie Hall (bofh)
From: [identity profile] ronebofh.livejournal.com
fdisk -l

(no subject)

Date: 2011-12-08 04:53 am (UTC)
From: [identity profile] theweaselking.livejournal.com
That requires a device ID, doesn't it?

And while going through /dev/sda1-X and /dev/hda1-X and /dev/md0-X works, it's less than ideal.

(no subject)

Date: 2011-12-08 05:10 am (UTC)
ext_8707: Taken in front of Carnegie Hall (bofh)
From: [identity profile] ronebofh.livejournal.com
Nope, just shows them all, at least on Pubuntu.

(no subject)

Date: 2011-12-08 03:05 pm (UTC)
From: [identity profile] theweaselking.livejournal.com
I was sure I'd tried that yesterday, so right now I tried it again, and got nothing.

Then I thought about it for a second.

When I told the machine to SUDO make me a sandwich, it worked.

I facepalmed.
I am clever.

(no subject)

Date: 2011-12-08 05:21 pm (UTC)
ext_8707: Taken in front of Carnegie Hall (simian)
From: [identity profile] ronebofh.livejournal.com
GOLD STAR!

(no subject)

Date: 2011-12-08 07:09 am (UTC)
From: [identity profile] alumiere.livejournal.com
To find the mounts try: cat /etc/fstab
That tells you what's being used in the file system, and should show unformatted stuff.

(no subject)

Date: 2011-12-08 03:02 pm (UTC)
From: [identity profile] theweaselking.livejournal.com
That tells you what the machine attempts to mount on startup. It doesn't tell you about anything that *isn't* mounted on startup.

"mount" tells you what's currently mounted even if you've manually mounted/unmounted devices after startup, but again, that won't tell me if there's a /dev/sdd that I don't have mounted.

(no subject)

Date: 2011-12-08 07:57 am (UTC)
From: [identity profile] bloodrage.livejournal.com
blkid

lists all block devices, including their UUID

(no subject)

Date: 2011-12-08 10:33 am (UTC)
From: [identity profile] luminalflux.livejournal.com
Doesn't show devices really, it shows filesystem labels from what I can tell. It will show the LVM volumes, but not the physical device they're on (i e /dev/var01/lv01 instead of /dev/sdc). But that's probably enough for our mustelid regent's purposes.

(no subject)

Date: 2011-12-08 10:29 am (UTC)
From: [identity profile] luminalflux.livejournal.com
/dev/disk/by-id/ in CentOS 5 on vmware only shows the virtual CDROM. /by-uuid/ shows sda1 and sdb1, which exist and are in use, but doesn't show sdc which is used for LVM. /by-path/ seems to show all partitions I have on that machine from what I can tell.

Of course, for the sake of consitency, my physical CentOS 5 machine only has by-label and by-uuid.

Profile

theweaselking: (Default)theweaselking
Page generated Feb. 5th, 2026 12:10 pm