p3 filesystem management.pdf

8
index nodes, i-nodes data blocks super block Partition / a c b bin dev home var d Partition dir1 dir2 dir3 dir4 Filesystem Basics mounting hard link mount <device> <mountpoint> umount

Upload: george-florea

Post on 24-Sep-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

  • index nodes, i-nodes

    data blocks

    superblock

    Part

    itio

    n

    /

    a cb

    bin dev homevar

    d

    Partition

    dir1

    dir2 dir3 dir4

    Filesystem Basics

    mounting

    hardlink

    mount

    umount

  • LINKDifferent identity for the same file

    Hard links cannot be created between filesystems

    Hard link Soft link (symbolic)

    Advantages make data available in multiple places without duplication give multiple names to the same command

    ln [options] target [link]

    -s, --symbolic

    -f, --force

    -I, --interactive

    Managing Links

  • Linux file security is build upon: file ownership file permissions

    ownership(two tiered)

    permissions(three tiered)

    owner group

    owner group others

    Files can be owned by non-login accountsUser and Group are represented internally by numbers

    chown [options] [newowner][:newgroup] filename

    chgrp [options] newgroup filename

    can only be run by root

    File Ownership

  • - r w x r x r - x

    owner permissions

    group permissions

    others (world) permissionsfile type code

    r read 4w write 2x execute 1

    SUID

    SGID

    Sticky bit

    s in owner execute bit

    s in group execute bit

    t in world execute bit

    Symlinks always have 777 permissions.

    Changing the permissions on a symlink affects the targeted file.

    File Permissions

  • chmod [options] [mode[,mode]] filename

    mode

    octal number NNNN

    symbolic form =

    ugoa

    +-=

    rwxXstugo

    Permissions can only be adjusted by owner and root.Set Default Mode:

    umask

    Mask is subtracted from 0666 for files and

    0777 for directories.

    Changing Permissions

  • chattr attr file

    -

    +

    =

    Attributes:a - append only

    i - immutable

    s - secure deletion

    t - no tail merge

    A - no access time updates

    j - journal (not on ext2)

    File Attributes

  • quotas require support in the kernel

    in the filesystem

    mount options in /etc/fstab:

    usrquota grpquota

    edquota

    edquota -t set grace periodquotacheck on a filesystem basis

    Disk Quotas

  • Filesystem Hierarchy Standard (FHS)

    static

    variable

    shareable unshareable

    /usr/opt

    /etc/boot

    /home/var/mail

    /var/run/var/lock

    find [path] [expression]

    locate

    whereis

    whichSearches environment path for the first occurrence of the program

    Searches for binary, configuration and documentation of a program

    Locating Files