Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have to manually edit a FAT 16 partition. After trying few hex editors, I decided to try Emacs Hexl.

sudo emacs -> M-x hexl-find-file -> /dev/sdb

The commands open device file but its empty, although others hex editors (including 'sudo cat /dev/sdb') show its content.

Why so?

Thank you.

share|improve this question

IMHO, There is no way to read/write device file in Emacs.

See also http://www.emacswiki.org/emacs/EmacsLispLimitations

share|improve this answer
Any hex editor can, so it looks like to be the Emacs's fault. – SkyDan Dec 9 '11 at 13:32

Trying to open the entire drive at once would be far too big. Use dd to transfer parts of the disk to/from a file and edit the file in hexl mode.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.