Advertisement
sany_ok

disk_info

Nov 11th, 2014
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.74 KB | None | 0 0
  1. #=====begin of copyright notice=====
  2. copyright()
  3. {
  4.         echo -e "
  5.  
  6.        THE AULIX_UTILS FOR DEBIAN AND CENTOS \n
  7.        The AUTHOR of this file is Alexander Borisovich Prokopyev, Kurgan, Russia \n
  8.        More info can be found at the AUTHOR's website: http://www.aulix.com/resume \n
  9.        Contact: alexander.prokopyev at aulix dot com \n
  10.        
  11.        Copyright (c) Alexander Prokopyev, 2006-2014 \n
  12.  
  13.        All materials contained in this file are protected by copyright law. \n
  14.        Nobody except the AUTHOR may alter or remove this copyright notice from copies of the content. \n
  15.        
  16.        The AUTHOR allows to use this content under AGPL v3 license:
  17.        http://opensource.org/licenses/agpl-v3.html
  18.  
  19.        ";
  20. }
  21.  
  22. copyright;
  23. #=====end of copyright notice=====
  24.  
  25. show_partitions()
  26. {
  27.         DevPart=$(mount | grep "on / type" | awk '{ print $1 }');
  28.         #Extract ../../sdXN part:
  29.         Dev=$(ls -al $DevPart | awk '{ print $11 }');
  30.         #Extract pure sdXN:
  31.         Dev=$(perl -e 'my $S="'$Dev'"; $S =~ s/^(?P<Before>[.\/]*)(?P<Dev>sd.)\d$/$+{Dev}/; print $S;');
  32.         echo "===== sfdisk: ";
  33.         sfdisk -d /dev/$Dev;
  34.  
  35.         echo "===== /dev/disk: ";
  36.         ls -al /dev/disk/by-id/;
  37.         ls -al /dev/disk/by-uuid/;
  38.  
  39.         echo "===== /proc/partitions: ";
  40.         cat /proc/partitions;
  41.  
  42. #       echo "===== /utils/disk/info.sh: ";
  43. #       /utils/disk/info.sh;
  44. }
  45.  
  46.  
  47. lsblk --output name,MOUNTPOINT,SIZE,model,TYPE,PHY-SEC,LOG-SEC,MIN-IO,OPT-IO;
  48. echo "===============================================================================================";
  49. di | sort;
  50. echo "===============================================================================================";
  51. show_partitions;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement