Advertisement
OldManRiver

Find Flash Drive Size

Jan 13th, 2016
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.99 KB | None | 0 0
  1. PARTED -L:
  2. ***********************************************************************************************
  3. root/# parted -l
  4. Model: ATA WDC WD10EZEX-00B (scsi)
  5. Disk /dev/sda: 1000GB
  6. Sector size (logical/physical): 512B/4096B
  7. Partition Table: msdos
  8.  
  9. Number Start End Size Type File system Flags
  10. 1 1049kB 997GB 997GB primary ext4 boot
  11. 2 997GB 1000GB 3202MB extended
  12. 5 997GB 1000GB 3202MB logical linux-swap(v1)
  13.  
  14.  
  15. Model: (scsi)
  16. Disk /dev/sdb: 4010MB
  17. Sector size (logical/physical): 512B/512B
  18. Partition Table: msdos
  19.  
  20. Number Start End Size Type File system Flags
  21. 1 4129kB 4010MB 4006MB primary fat32 lba
  22.  
  23.  
  24. Model: (scsi)
  25. Disk /dev/sdc: 124GB
  26. Sector size (logical/physical): 512B/512B
  27. Partition Table: msdos
  28.  
  29. Number Start End Size Type File system Flags
  30. 1 16.0MB 124GB 124GB primary fat32 lba
  31. ***********************************************************************************************
  32.  
  33. FDISK -L
  34. ***********************************************************************************************
  35. root/# fdisk -l
  36.  
  37. Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
  38. 255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
  39. Units = sectors of 1 * 512 = 512 bytes
  40. Sector size (logical/physical): 512 bytes / 4096 bytes
  41. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  42. Disk identifier: 0x000742b2
  43.  
  44. Device Boot Start End Blocks Id System
  45. /dev/sda1 * 2048 1947267071 973632512 83 Linux
  46. /dev/sda2 1947269118 1953523711 3127297 5 Extended
  47. Partition 2 does not start on physical sector boundary.
  48. /dev/sda5 1947269120 1953523711 3127296 82 Linux swap / Solaris
  49.  
  50. Disk /dev/sdb: 4009 MB, 4009754624 bytes
  51. 23 heads, 23 sectors/track, 14804 cylinders, total 7831552 sectors
  52. Units = sectors of 1 * 512 = 512 bytes
  53. Sector size (logical/physical): 512 bytes / 512 bytes
  54. I/O size (minimum/optimal): 512 bytes / 512 bytes
  55. Disk identifier: 0x6f1dc27c
  56.  
  57. Device Boot Start End Blocks Id System
  58. /dev/sdb1 8064 7831551 3911744 c W95 FAT32 (LBA)
  59.  
  60. Disk /dev/sdc: 123.8 GB, 123765522432 bytes
  61. 66 heads, 2 sectors/track, 1831284 cylinders, total 241729536 sectors
  62. Units = sectors of 1 * 512 = 512 bytes
  63. Sector size (logical/physical): 512 bytes / 512 bytes
  64. I/O size (minimum/optimal): 512 bytes / 512 bytes
  65. Disk identifier: 0x84e4ee1c
  66.  
  67. Device Boot Start End Blocks Id System
  68. /dev/sdc1 31232 241729535 120849152 c W95 FAT32 (LBA)
  69. ***********************************************************************************************
  70.  
  71. OLD SCRIPT ROUTINE:
  72. ***********************************************************************************************
  73. for f in /sys/block/sd[cdef]/removable;
  74. do [ "$(cat $f)" = "1" ];
  75. SDDRV=$(basename $(dirname $f));
  76. echo "F=> " ${f};
  77. echo "DRV=> " ${SDDRV};
  78. # echo "SD => " ${SDDRV};
  79. SIZ=$(( (( $(cat $(dirname $f)/size) * 512 )) / 1000000000 ));
  80. echo "SIZ: ${SIZ}";
  81. getname ${SIZ}; # Set the SDNAM var
  82. DI="`df -h | grep -i ${SDDRV}`";
  83. if [ -z ${DI} ]; then
  84. DI="`df -h | grep -i sd[cdef]`";
  85. fi
  86. AV="`echo ${DI} | awk '{ print $4 }'`";
  87. MP="`echo ${DI} | awk '{ print $6 }'`";
  88. done
  89. ***********************************************************************************************
  90.  
  91. LSBLK
  92. ***********************************************************************************************
  93.  
  94. root/# lsblk
  95. NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
  96. sda 8:0 0 931.5G 0 disk
  97. ├─sda1 8:1 0 928.5G 0 part /
  98. ├─sda2 8:2 0 1K 0 part
  99. └─sda5 8:5 0 3G 0 part [SWAP]
  100. sdb 8:16 1 3.8G 0 disk
  101. └─sdb1 8:17 1 3.7G 0 part /media/ndavis/USB DISK
  102. sdc 8:32 1 115.3G 0 disk
  103. └─sdc1 8:33 1 115.3G 0 part
  104. sr0 11:0 1 21M 0 rom
  105. ***********************************************************************************************
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement