How do I find out the number of disks I have on my linux system?



  • There will be variations between various linux platforms with regard to looking for information.

    fdisk is found on all the common linux systems, so the easiest way is:

    # fdisk -l
    
    Disk /dev/sda: 72.9 GB, 72999763968 bytes
    255 heads, 63 sectors/track, 8875 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1               1        1306    10490413+  83  Linux
    /dev/sda2            1307        2612    10490445   83  Linux
    /dev/sda3            2613        3918    10490445   83  Linux
    
    Disk /dev/sdb: 72.9 GB, 72999763968 bytes
    255 heads, 63 sectors/track, 8875 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1   *           1          13      104391   83  Linux
    /dev/sdb2              14        2624    20972857+  82  Linux swap
    /dev/sdb3            2625        8874    50203125   8e  Linux LVM
    

    To find out the number of disks you have on the linux SuSE linux system you do the following:

    Here you can see two disks /dev/sda & /dev/sda, and the their partition information.

    On SuSE linux, you can also do the following:

    # cd /var/log
    # grep SCSI boot.msg
    <5>SCSI subsystem initialized
    <5> Type: Direct-Access ANSI SCSI revision: 02
    <5>SCSI device sda: 142577664 512-byte hdwr sectors (73000 MB)
    <5>SCSI device sda: drive cache: write through
    <5> Type: Direct-Access ANSI SCSI revision: 02
    <5>SCSI device sdb: 142577664 512-byte hdwr sectors (73000 MB)
    <5>SCSI device sdb: drive cache: write through
    

Log in to reply
 

© Lightnetics 2024