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 a .gz file and I'd like to see the content of it. I used lofiadm to mount it.

lofiadm /backup/file.gz ->>  returned /dev/lofi/1
mount -F ufs /dev/lofi/1 /mnt

Then I checked the content

/mnt> du -sh *
4K   etc
79M   kernel
8K   lost+found
13M   platform

The problem is size of file.gz was around 342 MB but the content is around 93 MB. I checked it with ls -al but there were no other file.

/dev/lofi/1            321M    93M   196M    33%    /mnt

Now I don't understand how that happens. File size was 342 MB but after mount it returns 92 MB

share|improve this question

I'm not familiar with lofiadm, so I may be missing something, but I don't see anything strange. You have a filesystem with 321MB of space, of which 93MB is used and the rest is empty. The empty space may or may not be filled with easily-compressible data, so the fact that it's unused implies nothing about how well it can be compressed. The image is a little over 321MB, with extra space used for bookkeeping (inode tables).

share|improve this answer

Your file.gz file doesn't seem to be compressed at all given the fact you are mounting it as is, i.e. without decompressing it:

lofiadm /backup/file.gz ->>  returned /dev/lofi/1

The file system reported size is 321MB which is consistent with a 342 MB "device", as Gilles already answered.

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.