Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Analyze Filesystem in Virtual Machine Image

Masahiro331
September 01, 2022

Analyze Filesystem in Virtual Machine Image

Masahiro331

September 01, 2022
Tweet

More Decks by Masahiro331

Other Decks in Technology

Transcript

  1. എܠ Filesystem (Required) Virtual Machine Image (Required) Disk Partition 


    (Required) Logical Volume (Optional) File (Required) w Ծ૝ϚγϯΠϝʔδ͔ΒಁաతʹϑΝΠϧγεςϜΛղੳ͢Δ࢓૊ΈΛ։ൃ͍ͨ͠ w কདྷతʹ੬ऑੑݕ஌ͳͲʹԠ༻͢Δ͜ͱΛ໨ඪʹ͍ͯ͠Δ ੲ4FD)BDLͰগ͠΍͍ͬͯͨʢઌߦݚڀతͳ΍ͭʣIUUQTTFDIBDLOJDUHPKQBDIJFWFNFOUQEG@QEG Ծ૝ϚγϯΠϝʔδ͔ΒಁաతʹϑΝΠϧΛಡΈࠐΉͨΊʹ͸ɺ ͭͷσʔλߏ଄ΛಡΈࠐΜͰ͍͘ඞཁ͕͋Δɻ ࠓ೔͸͜ΕΒͷσʔλΛಡΈࠐΜͰ͍͘࿩Λ͠·͢ɻ
  2. ิ଍ѹॖͷྲྀΕ σΟεΫ σʔλ͋Γ Ծ૝σΟεΫ Πϝʔδϔομ /CZUFͷ#MPDL ɾɾɾ ɾɾɾ ɾɾɾ ɾɾɾ

    ࣮ࡍʹ͸σΟεΫྖҬΛ೚ҙͷϒϩοΫαΠζͰ෼ׂͯ͠ɺσʔλ͕ଘࡏͨ͠Βѹॖͯ͠ Ծ૝σΟεΫʹ֨ೲ͠ɺσʔλ͕ͳ͍৔߹͸ແࢹ͢Δɻͱ͍ͬͨ࢓૊Έ
  3. Ծ૝ϚγϯΠϝʔδͷ͋Δ͋Δߏ଄ ΄ͱΜͲͷԾ૝ϚγϯΠϝʔδ͸)FBEFS 5BCMF &OUSZͷͭͷσʔλΛ͍࣋ͬͯΔɻ w σΟεΫͷαΠζ w Ծ૝σΟεΫͷαΠζ w #MPDLͷαΠζ

    w 5BCMFͷҐஔ )FBEFS w &OUSZͷҐஔͱσΟεΫΦϑηο τͷඥ෇͚ w ςʔϒϧ಺ͷ/൪໨͕࣮σʔλͷ 0 ff TFU/ #MPDL4J[FͷσʔλΛ ࢦ͢Έ͍ͨͳ࣮૷͕ଟ͍ 5BCMF w &OUSZͷαΠζ w σΟεΫͷ࣮σʔλʢѹॖࡁΈ &OUSZ &OUSZ )FBEFS &OUSZ 5BCMF %BUB %BUB Ծ૝σΟεΫ σΟεΫ
  4. σΟεΫύʔςΟγϣϯͷσʔλߏ଄ w ىಈՄೳͳύʔςΟγϣϯΛ୳͠ ࣮ͯߦ͢ΔϚγϯޠ w (15͸&'*ͷ֦ுػೳΛར༻ͯ͠ ͍Δ #PPU-PBEFS w ύʔςΟγϣϯͷઌ಄ΞυϨε

    w ύʔςΟγϣϯͷαΠζ w ύʔςΟγϣϯͷλΠϓ 
 ʢ4XBQ #PPU σʔλͳͲʣ 1BSUJUJPO5BCMF #PPU1BSUJUJPO #PPU-PEFS %BUB1BSUJUJPO 1BSUJUJPO5BCMF σΟεΫύʔςΟγϣϯ σΟεΫύʔςΟγϣϯͷσʔλ͸ओʹɺ#PPU-PBEFS 1BUJUJPO&OUSZͷσʔλΛ࣋ͬͯ ͍Δ
  5. ϑΝΠϧγεςϜͷσʔλߏ଄ ϑΝΠϧγεςϜ͕ڞ௨͍ͯ࣋ͬͯ͠Δσʔλߏ଄͸ɺ4VQFS#MPDL *OPEF5BCMF  *OPEF &YUFOU5SFF %BUB#MPDL +PVSOBMͷͭΛ͍࣋ͬͯΔ͜ͱ͕ଟ͍ w ϒϩοΫαΠζ

    w ϑΝΠϧγεςϜͷαΠζ w *OPEF5BCMFͷҐஔ w *OPEFͷݸ਺΍αΠζ 4VQFS#MPDL w JOPEFͷ഑ྻ *OPEF5BCMF w ϑΝΠϧͷछྨݖݶ৘ใ 
 ʢσΟϨΫτϦ ϑΝΠϧ 4ZNMJOLͳͲʣ w &YUFOU5SFF΋͘͠͸ϒϩοΫ΁ͷΞυϨε w ͦͷଞɺTUBUͰऔಘͰ͖Δσʔλ *OPEF w *OPEFͱ%BUB#MPDLͷϚοϐϯά &YUFOU5SFF w ϑΝΠϧͷσʔλ 
 %BUB#MPDL w σΟεΫʹର͢Δॻ͖ࠐΈ࣌ͷτ ϥϯβΫγϣϯϩά w σʔλͷϝλσʔλͳͲΛอޢ͢ Δ +PVSOBM
  6. ͜͜·Ͱͷ࿩ Filesystem Virtual Machine Image Disk Partition Logical Volume File

    XFS /etc/os-release … other files Boot Code … Other filesystem LVM Master Boot Record GUID Partition Table Other Volumes… Compressed Virtual Machine Image … Ծ૝ϚγϯΠϝʔδͷதʹ͸ҎԼͷΑ͏ͳܗͰσʔλ͕֨ೲ͞Ε͍ͯΔɻ
  7. ωετ͞ΕͨϨΠϠʔΛϑΝΠϧͱͯ͠ಁաతʹಡΈࠐΉ ϑΝΠϧΛಡΈࠐΉͨΊʹඞཁͳػೳ͸ҎԼ w 'JMF4FFL P ff TFUJOU XIFODFJOU 
 ϑΝΠϧϙΠϯλͷҐஔΛࢦఆͨ͠ҐஔʹҠಈͤ͞Δ͜ͱ͕Ͱ͖Δؔ਺

    w 'JMF3FBE CVG<>CZUF 
 ϑΝΠϧϙΠϯλ͔Β೚ҙͷόΠτ਺ΛಡΈࠐΉؔ਺ ͜ΕΒͷؔ਺͸ҎԼͷؔ਺Λ࣮૷͢Δ͜ͱͰຬͨ͢͜ͱ͕Մೳ w 'JMF3FBE"U P ff TFUJOU CVG<>CZUF 
 ೚ҙͷϑΝΠϧΦϑηοτ͔Β೚ҙͷόΠτΛಡΈࠐΉؔ਺ w 'JMF4J[F 
 ϑΝΠϧͷαΠζΛऔಘ
  8. Ծ૝ϚγϯΠϝʔδΛந৅Խ͢Δ Compressed Virtual Machine Image ѹॖ͞Εͨσʔλ Virtual Machine Image ղౚ͞Εͨσʔλ

    Yͷσʔλ 3FBE"U CVG 1IZTJDBM0 ff TFU 3FBE"U CVG -PHJDBM0 ff TFU PT'JMF 'JMF*OUFSGBDF 5SBOTMBUF0 ff TFU
  9. %JTL1BSUJUJPOΛந৅Խ͢Δ Compressed Virtual Machine Image ѹॖ͞Εͨσʔλ Virtual Machine Image ղౚ͞Εͨσʔλ

    Yͷσʔλ 3FBE"U CVG 1IZTJDBM0 ff TFU 3FBE"U CVG -PHJDBM0 ff TFU PT'JMF 'JMF*OUFSGBDF 5SBOTMBUF0 ff TFU Disk Partition #PPU1BSUJUJPO'JMF 1BSUJUJPO'JMF" %JTL*OUFSGBDF 5SBOTMBUF0 ff TFU 'JMF*OUFSGBDF 3FBE"U CVG -PHJDBM0 ff TFU -JTU  'JMFͷ։࢝஍఺͕มΘΔͨΊ 0 ff TFUΛ૬ରతʹͣΒ͢ඞཁ͕͋Δ
  10. ϑΝΠϧγεςϜΛந৅Խ͢Δ Compressed Virtual Machine Image ѹॖ͞Εͨσʔλ Virtual Machine Image ղౚ͞Εͨσʔλ

    Yͷσʔλ 3FBE"U CVG 1IZTJDBM0 ff TFU 3FBE"U CVG -PHJDBM0 ff TFU PT'JMF 'JMF*OUFSGBDF 5SBOTMBUF0 ff TFU Disk Partition #PPU1BSUJUJPO'JMF 1BSUJUJPO'JMF" %JTL*OUFSGBDF 5SBOTMBUF0 ff TFU 'JMF*OUFSGBDF 3FBE"U CVG -PHJDBM0 ff TFU -JTU  'JMFͷ։࢝஍఺͕มΘΔͨΊ 0 ff TFUΛ૬ରతʹͣΒ͢ඞཁ͕͋Δ Filesystem 'JMFTZTUFN #PPU'JMF 'JMF*OUFSGBDF 'JMFTZTUFN*OUFSGBDF 8BML%JS 'JMF0QFO