Tuesday, April 5, 2016

access archived or compressed files, or access remote file as if it is a directory

AVFS (A Virtual Filesystem) is a system which enables all programs to look inside archived
or compressed files, or access remote files as if it is a directory. without avfs you have to uncompressed an archive or compressed file before we can look inside it. for remote files that  can be access by ssh ftp or http, you have to login to remote pc or download the files first before we can access the files.
but it avfs we can treat it as a directory or local file reside in our computer.

At the moment it supports the following medium
- floppies
- tar archive files
- gzip files,
- zip compressed file
- bzip2 compressed file
- ar archive file
- rar files
for remote files it support the following protocol:
- ftp sessions,
- http,
- webdav,
- rsh/rcp,
- ssh/scp.

The following will show about the installation and how to use to access some archive file and access to remote files with ssh

1- install avfs on ubuntu system or debian system
$ sudo apt-get install avfs

2- start mount the avfs, use command mountavfs, and it will mount to ~/.avfs
~$ mountavfs
Mounting AVFS on /home/user1/.avfs...

3- so to start using the avfs, we have to access the file inside our mountpoint /home/user1/.avfs
$ cd /home/user1/.avfs

4- ls content of and a archive etc-2015-01-03.tar.gz#/  (add #/ to the filename)
~/.avfs$ ls etc-2015-01-03.tar.gz#/
etc-2015-01-0


5- read file inside the archive
$ cat etc-2015-01-03.tar.gz#/etc-2015-01-03/adjtime
43.230439 1415246566 0.000000
1415246566
UTC


7-  list directory from remote host using ssh (make sure your current working directory is /home/user1/.avfs the avfs mountpoint)
$ ls ./#ssh:user1@192.168.202.23/var
backups  cache  crash  games  lib  local  lock  log  mail  opt  run  spool  tmp  www  yp





---------------------------------------------------
****note*****
- syntax for access remote files:
 /#floppy:a
/#a
/#rsh:otherhost/foo/bar
/#ssh:user@host/dir
/#ftp:ftp.funet.fi/pub/Linux
/#ftp:user@host.domain.org/home/xyz/file
/#ftp_ctl:user@host.domain.org/password
/#http:www.inf.bme.hu|~mszeredi|avfs|
/#http:ftp:||ftp.funet.fi|pub|Linux



- all available handlers

1- #a        :first floppy drive alias for #floppy:a
2- #avfsstat    :meta information builtin
3- #bz2        :bzip2 uses bzip2
4- #dav        :webdav builtin
5- #dav_ctl    :control dav sessions
6- #floppy        :floppy uses mtools (mdir, mcopy, ...)
7- #ftp        :ftp builtin
8- #ftp_ctl    :control ftp sessions
9- #gz        :gzip uses gzip
10- #iso9660    :CD/DVD filesystem no need to use mount -t iso9660!
11- #local        :local filesysem only for internal use
12- #rsh        :rsh/rcp only works if rsh needs no password
13- #ssh        :ssh/scp only works if ssh needs no password
14- #uar        :un-ar builtin
15- #ubz2        :bunzip2 builtin
16- #ubzip2        :bunzip2 uses bzip2
17- #ucftp        :ftp builtin (write support, no file cache)
18- #ucftp_ctl    :control ftp sessions
19- #ugz        :gunzip builtin (1)
20- #ugzip        :gunzip uses gzip
21- #urar        :unrar builtin list + uses rar to extract
22- #utar        :untar builtin
23- #uxz        :unxz/unlzma builtin
24- #uxze        :unxz/unlzma uses xz
25- #uz        :uncompress uses gzip
26- #uzip        :unzip builtin
27- #volatile    :'memory fs' mainly for testing

No comments:

Post a Comment