all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Fix the destroyed disk image partition table in a raw image file using Emacs.
@ 2021-04-11 13:34 Hongyi Zhao
  2021-04-11 13:39 ` Jean Louis
  2021-04-11 19:18 ` Fix the destroyed disk image partition table in a raw image file using Emacs Gregor Zattler
  0 siblings, 2 replies; 10+ messages in thread
From: Hongyi Zhao @ 2021-04-11 13:34 UTC (permalink / raw)
  To: help-gnu-emacs

I've two disk image files whose partuuid info are shown as below based
on the method discussed here on
<https://unix.stackexchange.com/questions/419104/what-is-partuuid-from-blkid-when-using-msdos-partition-table>:

$ dd if=openwrt-19.07.7-x86-64-combined-ext4.img bs=1 count=4 skip=440
2>/dev/null | od -t x4 -An
eb3ae1bb
$ dd if=disk.img bs=1 count=4 skip=440 2>/dev/null | od -t x4 -An
761b36b0

In order to change the partuuid of the 2nd disk image to the value of
the 1st, I do the following operation:

$ dd if=openwrt-19.07.7-x86-64-combined-ext4.img of=disk.img bs=1
count=4 skip=440 seek=440
4+0 records in
4+0 records out
4 bytes copied, 0.000195385 s, 20.5 kB/s
$ dd if=disk.img bs=1 count=4 skip=440 2>/dev/null | od -t x4 -An
eb3ae1bb

But it turns out that the disk.img will be destroyed by the above
operation. So, the only usable info for now is the following data
snippet extracted from the corresponding place of the original image:

$ dd if=disk.img bs=1 count=4 skip=440 2>/dev/null | od -t x4 -An
761b36b0

It's well known that Emacs is an 8-bit clean editor which makes it
safe to edit binary files. So, I want to whether I can fix the above
destroyed disk image file with Emacs for my scenario.

Regards,
HY
-- 
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Polytechnic University of Science and Technology engineering
NO. 552 North Gangtie Road, Xingtai, China



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-04-15 14:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-11 13:34 Fix the destroyed disk image partition table in a raw image file using Emacs Hongyi Zhao
2021-04-11 13:39 ` Jean Louis
2021-04-11 17:26   ` Dan Hitt
2021-04-11 18:45     ` tomas
2021-04-11 19:56       ` Dan Hitt
2021-04-11 20:58   ` Stefan Monnier
2021-04-11 21:15     ` GNU ELPA problem (was: Re: Fix the destroyed disk image partition table in a raw image file using Emacs.) Emanuel Berg via Users list for the GNU Emacs text editor
2021-04-11 19:18 ` Fix the destroyed disk image partition table in a raw image file using Emacs Gregor Zattler
2021-04-12  6:29   ` Hongyi Zhao
2021-04-15 14:16   ` Hongyi Zhao

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.