Security Consulting
  Unix Administration     Firewall     Intrusion Detection     Network Security     Hacking     MORE     HOME    

File System

EXT 2

    lsattr shows the ext2-attributes.
    chattr change the ext2-attributes.

The special attributes indicate wheather a file is append-only or even immutable.

See also: Network Security: File Permissoins

Partitions

There a couple of tools to partition:
    sfdisk
    cfdisk A graphical (textmode) tool.

Checking a filesystem

    fsck -f -y /dev/hda1 -f forces the check. -y answers yes to all the questions

Mounting

    /dev/sda2swapswapdefaults00
    /dev/sda3/ext2noauto,user11
The flags you can user: noexec, nosuid, nodev (are implied by user)

Use the noatime flag to suppress the generation of the ATIME flag on files. This can speed up your harddisk access quite a bit.

Loopback Drive

To create a virtual file system, first create an empty file to hold the virtual file system. The size of the file will be the apparent size of the loopback device after it is mounted.
    dd if=/dev/zero of=/tmp/lbdisk count=20480
Before you mount the above file, you must construct a file system.
    mke2fs -q /tmp/lbdisk
Mount the file system using the loopback device:
    mkdir /mnt/loopback
    mount -o loop=/dev/loop0 /tmp/lbdisk /mnt/loopback

Tune2fs

The tune2fs utility helps control harddisk parameters. You can set after how many mountes a drive is going to be checked, \ldots

Debugging a filesystem

    debugfs /dev/hda3 runs a debugger for the filesystem. Use lsdel to display the deleted files. If you wanna recover a deleted file, use dump <xxx> /home/ram/file (where xxx is the inode) to recover a file.
There is also a product which does file recovery: RECOVER
  • Wanna have encrypted tar-archives, use: STAR. And then -e



  • CopyLeft (l) 2003 by Raffael Marty