Lab07.Filesystem Management
Lab07.Filesystem Management
Filesystem Management
Filesystem Basics
mount <device> <mountpoint>
umount
mounting
bin
dev
var
home
dir1
hard
link
dir3
dir2
Partition
Partition
super
block
data blocks
dir4
Managing Links
LINK
Different identity for the same file
Hard link
File Ownership
Linux file security is build upon:
file ownership
file permissions
ownership
(two tiered)
owner
group
owner
permissions group
(three tiered) others
File Permissions
group permissions
- r w x r x r - x
file type code
r
w
x
read
write
execute
SUID
SGID
Sticky bit
owner permissions
4
2
1
s in owner execute bit
s in group execute bit
t in world execute bit
Changing Permissions
chmod [options] [mode[,mode]] filename
octal number
NNNN
mode
symbolic form = <permission-set> <op> <perms>
r
+
u
w
g
x
=
o
X
a
s
Permissions can only be adjusted by owner and root.
t
Set Default Mode:
u
umask <mask>
g
Mask is subtracted from 0666 for files and
o
0777 for directories.
File Attributes
chattr
Attributes:
a i s t A j -
+ attr
=
file
append only
immutable
secure deletion
no tail merge
no access time updates
journal (not on ext2)
Locating Files
Filesystem Hierarchy Standard (FHS)
static
shareable
/usr
/opt
unshareable
/etc
/boot
variable
/home
/var/mail
/var/run
/var/lock