Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
add comment

2 Answers

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
add comment

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
add comment

Your Answer

 
discard

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.