Alok Aggarwal wrote:
> [...] Examples:
>
> - 1. Compress a file with gzip
> + 1. Compress a file with gzip and add the compressed file as a block
> + device
>
> - # lofiadm -C gzip /export/home/solaris.iso
> + # lofiadm -a -C gzip /export/home/solaris.iso
>
> - 2. Compress a file with gzip and compress it in 64k chunks
> + 2. Compress a file with gzip in 64k chunks and add the compressed
> + file as a block device
>
> # lofiadm -C gzip -s 64k /export/home/solaris.iso
>
Shouldn't this be:
lofiadm -a -C gzip -s 64k /export/home/solaris.iso
?
On the other hand, what will be the name of the compressed file ?
Would it remain as the original filename ? Can cause confusion.
What happens to the compressed file when it is unmapped ?
The process of compression is a very time consuming task, probably
on the order of 30 - 50mins for 2GB worth of data, because it is
chunked compression (though this can be improved by some
parallelization and buffering techniques). So IMHO it is less
confusing to do something like this:
lofiadm -C gzip -s 64k /export/home/solaris.iso
Produces solaris.iso.<ext> compressed file.
lofiadm -a /export/home/solaris.iso.<ext>
Maps the compressed file.
lofiadm Outputs:
Block Device File Options
/dev/lofi/1 /export/home/solaris.iso.<ext> Compressed (gzip)
/dev/lofi/2 /export/home/regular.iso.<ext> -
Semantically similar to using gzip or any other compression utility
for that matter.
Regards,
Moinak.