Determine primary hard drive?


Recommended Posts

I'm writing a small script that detects hard drive's serial with hdparm,

but hdparm is accepting /dev/hda or /dev/sda

What's the easieast way to determine on what /dev/ is system installed?

Link to comment
Share on other sites

A command to fdisk -l (that is a lowercase letter "L", not the number one) will list your partitions. You will need to either be root, or use sudo to assume root privileges to run that command. This will be a pure listing, and not tell you what is in-use where. You will need to reason out what partition is for what with this command.

On the other hand, there is the mount command, which will show you what filesystems are mounted (in use) and where they are mounted to (for example /home may be a separate mounted partition). This may be the command you are after.

Link to comment
Share on other sites

mark, I wonder if we counted how many times you gave the advice to use the command "sudo fdisk -l" what the number would be. I'm willing to bet at least 1500 times :p. Anyway The2, just do exactly what markjensen said.

Link to comment
Share on other sites

mark, I wonder if we counted how many times you gave the advice to use the command "sudo fdisk -l" what the number would be. I'm willing to bet at least 1500 times :p.

I agree......... he should just place it somewhere on his computer so he can copy and paste it........ :p

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.