(as)  [sysadmin] [blog]

User Tools

Site Tools


showmydisks

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
showmydisks [2015-10-27 22:32]
andreas [Limitations] Does not support disks with GUID Partition Table (GTP)
showmydisks [2020-10-12 21:12] (current)
andreas Archived discussion, disabled commenting
Line 117: Line 117:
 Please accept my sincere apology for the horrible coding style of this script. I am not a programmer, and when I started to write this script some 15 years ago my style was indeed worse than today. Please accept my sincere apology for the horrible coding style of this script. I am not a programmer, and when I started to write this script some 15 years ago my style was indeed worse than today.
  
-~~DISCUSSION~~+===== Discussion ===== 
 + 
 +<markdown> 
 +*Andreas Schamanek, 2009-09-15 13:20* 
 + 
 +See also my blog posting [Listing disks, partitions, and more]. 
 + 
 +---- 
 + 
 +*Andreas Schamanek, 2009-09-23 09:47, 2009-09-23 09:48* 
 + 
 +If on a system [GNU parted] is available one might want to use `parted -l` to list disks, partitions, sizes and file systems. It features nicely formatted output (see below) and detects NTFS file systems. It does not show mount points and free disk spaces, though. 
 + 
 +``` 
 +debian:~# parted -l 
 +Model: SAMSUNG HM120JC (ide) 
 +Disk /dev/hda: 120GB 
 +Sector size (logical/physical): 512B/512B 
 +Partition Table: msdos 
 + 
 +Number  Start   End     Size    Type      File system  Flags 
 +      32.3kB  41.1MB  41.1MB  primary   ext3         boot 
 +      41.1MB  543MB   502MB   primary   ext3 
 +      543MB   120GB   119GB   extended 
 +      543MB   1546MB  1003MB  logical   ext3 
 +      1546MB  1744MB  197MB   logical   linux-swap 
 +      1744MB  2040MB  296MB   logical   ext3 
 +      2040MB  3537MB  1497MB  logical   ext3 
 +      3537MB  120GB   116GB   logical   ext3 
 + 
 + 
 +Model: WDC WD5000AAKB-00H8A (scsi) 
 +Disk /dev/sda: 500GB 
 +Sector size (logical/physical): 512B/512B 
 +Partition Table: msdos 
 + 
 +Number  Start  End    Size   Type     File system  Flags 
 +      512B   500GB  500GB  primary  ext3 
 +``` 
 + 
 +---- 
 + 
 +*Andreas Schamanek, 2015-09-12 22:43* 
 + 
 +Only recently I found the wonderful `lsblk` from the util-linux collection. This is a great alternative providing more details and a beautiful output with several options to configure it. `lsblk` should be available on all major Linux distributions by default. 
 + 
 +Example output: 
 + 
 +``` 
 +# lsblk --ascii -o "NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT" 
 +NAME    TYPE   SIZE FSTYPE MOUNTPOINT 
 +sda     disk 465.3G 
 +`-sda1  part 465.3G ext4   /home.nobak 
 +sdb     disk 223.1G 
 +|-sdb1  part   3.7G ext4   / 
 +|-sdb2  part   5.6G swap   \[SWAP\] 
 +|-sdb3  part     1K 
 +|-sdb5  part   9.3G ext4   /usr 
 +|-sdb6  part   4.7G ext4   /tmp 
 +|-sdb7  part   4.7G ext4   /var 
 +|-sdb8  part   4.7G ext4   /var/lib/mysql 
 +|-sdb9  part   4.7G ext4   /var/mail 
 +|-sdb10 part  97.8G ext4   /home 
 +`-sdb11 part    88G ext4 
 +``` 
 + 
 +[Listing disks, partitions, and more]: https://fam.tuwien.ac.at/~schamane/_/blog:090914_listing_disks_partitions_and_more "blog:090914_listing_disks_partitions_and_more" 
 +[GNU parted]: http://www.gnu.org/software/parted/ "http://www.gnu.org/software/parted/" 
 + 
 +</markdown>
  
  
showmydisks.txt · Last modified: 2020-10-12 21:12 by andreas