Hey guys,
I need to use iostat to diagnose a disk latency problem we think we may be having.
So if I have this disk partition:
[root@uszmpdblp010la mysql]# df -h /mysql Filesystem Size Used Avail Use% Mounted on /dev/mapper/MysqlVG-MysqlVol 9.9G 1.1G 8.4G 11% /mysql
And I want to correlate that to the output of fdisk -l, so that I can feed the disk partition I want to iostat, how would I go about that?
Here is my output from fdisk -l
[root@uszmpdblp010la mysql]# fdisk -l
Disk /dev/cciss/c0d0: 146.7 GB, 146778685440 bytes 255 heads, 32 sectors/track, 35132 cylinders Units = cylinders of 8160 * 512 = 4177920 bytes
Device Boot Start End Blocks Id System /dev/cciss/c0d0p1 * 1 120 488281 83 Linux Partition 1 does not end on cylinder boundary. /dev/cciss/c0d0p2 121 35131 142841947+ 8e Linux LVM Partition 2 does not end on cylinder boundary.
Disk /dev/cciss/c0d1: 1199.8 GB, 1199865640960 bytes 255 heads, 32 sectors/track, 287192 cylinders Units = cylinders of 8160 * 512 = 4177920 bytes
Device Boot Start End Blocks Id System /dev/cciss/c0d1p1 1 287192 1171743344 8e Linux LVM
Disk /dev/dm-0: 2147 MB, 2147483648 bytes 255 heads, 63 sectors/track, 261 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/dm-0 doesn't contain a valid partition table
Disk /dev/dm-1: 2147 MB, 2147483648 bytes 255 heads, 63 sectors/track, 261 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/dm-1 doesn't contain a valid partition table
Disk /dev/dm-2: 4294 MB, 4294967296 bytes 255 heads, 63 sectors/track, 522 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/dm-2 doesn't contain a valid partition table
Disk /dev/dm-3: 6442 MB, 6442450944 bytes 255 heads, 63 sectors/track, 783 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/dm-3 doesn't contain a valid partition table
Disk /dev/dm-4: 6442 MB, 6442450944 bytes 255 heads, 63 sectors/track, 783 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/dm-4 doesn't contain a valid partition table
Disk /dev/dm-5: 6442 MB, 6442450944 bytes 255 heads, 63 sectors/track, 783 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/dm-5 doesn't contain a valid partition table
Disk /dev/dm-6: 17.1 GB, 17179869184 bytes 255 heads, 63 sectors/track, 2088 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/dm-6 doesn't contain a valid partition table
Thanks, Tim
On Thu, Feb 19, 2015 at 12:27 PM, Tim Dunphy bluethundr@gmail.com wrote:
And I want to correlate that to the output of fdisk -l, so that I can feed the disk partition I want to iostat, how would I go about that?
lsblk
On 2/19/2015 9:27 AM, Tim Dunphy wrote:
So if I have this disk partition:
[root@uszmpdblp010la mysql]# df -h /mysql Filesystem Size Used Avail Use% Mounted on /dev/mapper/MysqlVG-MysqlVol 9.9G 1.1G 8.4G 11% /mysql
thats not a partition thats a file system on a logical volume...
# df -h /mirror Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_sg1data-lvmirror 1.0T 736G 289G 72% /mirror
# pvs PV VG Fmt Attr PSize PFree /dev/sdb2 vg_sg1 lvm2 a-- 2.00t 0 /dev/sdc1 vg_sg1data lvm2 a-- 16.37t 415.80g /dev/sdd1 vg_sg1data lvm2 a-- 16.37t 7.87t
or, a gnarlier case...
# df -h /home2 Filesystem Size Used Avail Use% Mounted on /dev/mapper/vgdata-lvhome2 1.8T 306G 1.6T 17% /home2
# pvs PV VG Fmt Attr PSize PFree /dev/md127 vgdata lvm2 a-- 1.82t 19.68g
# mdadm -D /dev/md127 /dev/md127: Version : 1.2 Creation Time : Sat Jun 14 13:18:25 2014 Raid Level : raid1 Array Size : 1953383232 (1862.89 GiB 2000.26 GB) Used Dev Size : 1953383232 (1862.89 GiB 2000.26 GB) Raid Devices : 2 Total Devices : 2 Persistence : Superblock is persistent
Update Time : Thu Feb 19 18:40:15 2015 State : clean Active Devices : 2 Working Devices : 2 Failed Devices : 0 Spare Devices : 0
Name : new.freescruz.com:0 (local to host new.freescruz.com) UUID : d9c90fda:9a0e5d4f:d27cf1f6:19d0b43a Events : 1485
Number Major Minor RaidDevice State 0 8 17 0 active sync /dev/sdb1 1 8 33 1 active sync /dev/sdc1
On 02/19/2015 09:27 AM, Tim Dunphy wrote:
And I want to correlate that to the output of fdisk -l, so that I can feed the disk partition I want to iostat, how would I go about that?
lvdisplay --maps /dev/mapper/MysqlVG-MysqlVol
That'll show you which PVs are used for the LV. But, just given your fdisk output, I'd guess that you're going to find that all of the extents are on /dev/cciss/c0d1p1, and watching that will produce exactly the same output as watching /dev/mapper/MysqlVG-MysqlVol.
Try it:
iostat -x 2 /dev/mapper/MysqlVG-MysqlVol /dev/cciss/c0d1p1
Or just watch all of your block devices by not naming any:
iostat -x 2