Bug 449755

Summary: RFE: file magic for LVM persistent overlay snapshots
Product: [Fedora] Fedora Reporter: Jason Farrell <farrellj>
Component: fileAssignee: Tomas Smetana <tsmetana>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-06-06 11:50:49 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.