0

So say if I did mkfs.ext4 on a 1 GB file to make an ext4 file system then mounted it and add the file cat.ls unmounted it and sent it to B computer that did not have sudo (note I will not use fuse) how would the person read the file without mounting it. Edit you can install any ext4 parser, you just can't mount it.

Edit to get the ext 4 file you would run this dd if=/dev/zero of=ext4 bs=MiB count=1024 ;mkfs.ext4 ext4 ; mkdir ext4dir ; sudo mount ./ext4 ./ext4dir ;sudo chown -R $USER:$USER ext4dir ;echo hel > ext4dir/cat.ls ; sudo umount ext4dir now how would computer b parse the ext4 file or dump the file to a directory

lnee
  • 806
  • Hello. What you are trying to do is impossible. You would get the same result as if the disk was in another room and you tried to read it. – David Apr 02 '22 at 08:12
  • 1
    Why would you want/need this? – vanadium Apr 02 '22 at 09:23
  • how would reading from a ext4 file / img how would that be impossible the data is in a regular file with all the ext4 data in it all you would need to do is parse it – lnee Apr 02 '22 at 14:43
  • and "Why would you want/need this?" that does not rely mater i ask a question could have a need, so it is a valid question – lnee Apr 02 '22 at 14:46
  • Unless the person at B can read raw disk blocks, and understands how to find the right disk partition, and understands how ext4 works, they cannot access the file. What's the system at B? Will it automount the disk at /media/$USER/volumename? – waltinator Apr 01 '22 at 19:05
  • no mounting no auto mounting non of that – lnee Apr 01 '22 at 19:12

1 Answers1

4

The 7-Zip archiver 7z can also read (though not write) many types of filesystem image files and devices, including ext4, just as if they were zip files.

For example, you can list all the files in the image with the command:

7z l ext4image

And extract a specific file with:

7z x ext4image cat.ls

7z is probably already installed, but it can be installed with:

sudo apt install p7zip-full