From 74ac0f9ffa028d234bc68f0709828145467ae7a8 Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Tue, 25 Jan 2011 18:38:17 +0000 Subject: [PATCH] better printing for lvm partitions --- magic/Magdir/linux | 54 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 9 deletions(-) diff --git a/magic/Magdir/linux b/magic/Magdir/linux index 3f07c176..08158e25 100644 --- a/magic/Magdir/linux +++ b/magic/Magdir/linux @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: linux,v 1.36 2010/09/20 19:19:17 rrt Exp $ +# $File: linux,v 1.37 2010/12/17 14:19:51 christos Exp $ # linux: file(1) magic for Linux files # # Values for Linux/i386 binaries, from Daniel Quinlan @@ -244,19 +244,55 @@ # # 0x200 seems to be the common case -0x218 string LVM2\ 001 LVM2 (Linux Logical Volume Manager) +0x218 string LVM2\ 001 LVM2 PV (Linux Logical Volume Manager) # read the offset to add to the start of the header, and the header # start in 0x200 ->(0x214.l+0x200) string >\0 , UUID: %s +>&(&-12.l-0x21) byte x +# display UUID in LVM format + display all 32 bytes (instead of max string length: 31) +>>&0x0 string >0x2f \b, UUID: %.6s +>>&0x6 string >0x2f \b-%.4s +>>&0xa string >0x2f \b-%.4s +>>&0xe string >0x2f \b-%.4s +>>&0x12 string >0x2f \b-%.4s +>>&0x16 string >0x2f \b-%.4s +>>&0x1a string >0x2f \b-%.6s +>>&0x20 lequad x \b, size: %lld -0x018 string LVM2\ 001 LVM2 (Linux Logical Volume Manager) ->(0x014.l) string >\0 , UUID: %s +0x018 string LVM2\ 001 LVM2 PV (Linux Logical Volume Manager) +>&(&-12.l-0x21) byte x +# display UUID in LVM format + display all 32 bytes (instead of max string length: 31) +>>&0x0 string >0x2f \b, UUID: %.6s +>>&0x6 string >0x2f \b-%.4s +>>&0xa string >0x2f \b-%.4s +>>&0xe string >0x2f \b-%.4s +>>&0x12 string >0x2f \b-%.4s +>>&0x16 string >0x2f \b-%.4s +>>&0x1a string >0x2f \b-%.6s +>>&0x20 lequad x \b, size: %lld -0x418 string LVM2\ 001 LVM2 (Linux Logical Volume Manager) ->(0x414.l+0x400) string >\0 , UUID: %s +0x418 string LVM2\ 001 LVM2 PV (Linux Logical Volume Manager) +>&(&-12.l-0x21) byte x +# display UUID in LVM format + display all 32 bytes (instead of max string length: 31) +>>&0x0 string >0x2f \b, UUID: %.6s +>>&0x6 string >0x2f \b-%.4s +>>&0xa string >0x2f \b-%.4s +>>&0xe string >0x2f \b-%.4s +>>&0x12 string >0x2f \b-%.4s +>>&0x16 string >0x2f \b-%.4s +>>&0x1a string >0x2f \b-%.6s +>>&0x20 lequad x \b, size: %lld -0x618 string LVM2\ 001 LVM2 (Linux Logical Volume Manager) ->(0x614.l+0x600) string >\0 , UUID: %s +0x618 string LVM2\ 001 LVM2 PV (Linux Logical Volume Manager) +>&(&-12.l-0x21) byte x +# display UUID in LVM format + display all 32 bytes (instead of max string length: 31) +>>&0x0 string >0x2f \b, UUID: %.6s +>>&0x6 string >0x2f \b-%.4s +>>&0xa string >0x2f \b-%.4s +>>&0xe string >0x2f \b-%.4s +>>&0x12 string >0x2f \b-%.4s +>>&0x16 string >0x2f \b-%.4s +>>&0x1a string >0x2f \b-%.6s +>>&0x20 lequad x \b, size: %lld # LVM snapshot # from Jason Farrel -- 2.40.0