Bug 449755 - RFE: file magic for LVM persistent overlay snapshots
Summary: RFE: file magic for LVM persistent overlay snapshots
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: file
Version: rawhide
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Tomas Smetana
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-06-03 12:48 UTC by Jason Farrell
Modified: 2008-06-06 11:50 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-06-06 11:50:49 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jason Farrell 2008-06-03 12:48:43 UTC
Would be nice to get file magic added for LVM snapshots, especially now that the
persistent overlay image in Fedora 9 will be seen by more eyes. Having file
report that it's just "data" isn't very enlightening.

My ~/.magic:
-----------------------------------
# $ hexdump -C -n 512 /media/Patriot/LiveOS/overlay-Patriot-32B4-B464
# 00000000  53 6e 41 70 01 00 00 00  01 00 00 00 08 00 00 00  |SnAp............|
# 00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
# # hexdump -C -n 512 /dev/mapper/vgr0-0tmp--snap-cow
# 00000000  53 6e 41 70 01 00 00 00  01 00 00 00 08 00 00 00  |SnAp............|
# 00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

# header struct: 
http://fxr.watson.org/fxr/source//drivers/md/dm-exception-store.c?v=linux-2.6#L53
# lelongs:  magic, valid flag, version, chunk_size in sectors
0    string  SnAp        LVM Snapshot (CopyOnWrite store)
>4   lelong    !0        - valid,
>4   lelong    0         - invalid,
>8   lelong    x         version = %d,
>12  lelong    x         chunk_size = %d
-----------------------------------

e.g.:
$ file /media/Patriot/LiveOS/overlay-Patriot-32B4-B464
/media/Patriot/LiveOS/overlay-Patriot-32B4-B464: LVM Snapshot (CopyOnWrite
store) - valid, version = 1, chunk_size = 8

Comment 1 Tomas Smetana 2008-06-03 13:00:15 UTC
Thanks.  This looks OK to me.  Have you sent your patch upstream as well?

Comment 2 Jason Farrell 2008-06-03 13:15:55 UTC
Only here. Not sure who the keeper of the upstream magic is

Comment 3 Tomas Smetana 2008-06-03 13:39:49 UTC
Nevermind. I'll send it to him together with other updates I have.


Note You need to log in before you can comment on or make changes to this bug.