Find the answer to your Linux question:
Results 1 to 4 of 4
Hi all, I have to write a script or program to log the details of the primary partition of a linux server which should be generic. Can anyone tel what ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2009
    Posts
    85

    How to know the primary partition of a linux system


    Hi all, I have to write a script or program to log the details of the primary partition of a linux server which should be generic. Can anyone tel what is the command in linux to get the list of the partitions and how to find the primary partition among the other. Or can I know from proc filesystem.

    Thanks in advance

  2. #2
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,769
    fdisk -l
    and look out for primary denoted by "*"
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

  3. #3
    Just Joined!
    Join Date
    Oct 2009
    Posts
    85
    thnks for the reply. I have seen the output itz giving /dev/sda1 as the partition. I can see that a boot partition.
    then how will I know the partition of RFS ???

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,769
    Quote Originally Posted by Lakshmipathi View Post
    and look out for primary denoted by "*"
    Sorry.Yes * denotes boot not primary. Primaries denoted by nos 1-4 .

    Checkout "Id" field - It has an unique magic signature for each FS.
    another way would be checking out "cat /proc/mounts" output

    HTH
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •