# dumpe2fs /dev/sda1|less
# ls -ldi / /etc /etc/passwd
2 drwxr-xr-x 27 root root 4096 Aug 5 15:57 /
2345473 drwxr-xr-x 102 root root 12288 Aug 5 16:04 /etc
2347388 -rw-r--r-- 1 root root 2057 Aug 2 14:40 /etc/passwd
---------------
# df -h
# df -i
# du -sh /test
-------------------
软连接 符号连接
# mount /dev/cdrom /mnt/cdrom
# ln -s /mnt/cdrom /test/iso
# cd /test/iso
# ls
硬连接
# ln /etc/inittab /test/init
# ln /etc/inittab /root/hello
# ls -li /etc/inittab /test/init /root/hello
---------------------------
swap
# dd if=/dev/zero of=/swapfile bs=1M count=500
# mkswap /swapfile
# swapon -s
# swapon /swapfile
# swapon -s
# vim /etc/fstab //让系统启动时自动生效
/swapfile swap swap defaults 0 0
并行swap
# fdisk /dev/sda //添加一个分区sda9
# fdisk /dev/hda //添加一个分区hda14
# partprobe //如果不起作用,重启系统
# mkswap /dev/sda9
Setting up swapspace version 1, size = 1011671 kB
# mkswap /dev/hda14
Setting up swapspace version 1, size = 1000542 kB
# swapon -p 1 /dev/sda9 /dev/hda14
# swapon -s
# swapoff /dev/sda9 /dev/hda14
# swapon -p 1 /dev/sda9 /dev/hda14
# vim /etc/fstab
/dev/sda9 swap swap defaults,pri=1 0 0
/dev/hda14 swap swap defaults,pri=1 0 0
------------------
quota
# fdisk /dev/hda //添加一个分区
# partprobe /dev/hda
# mkfs.ext3 /dev/hda14
# mkdir /quota
# mount -o usrquota,grpquota /dev/hda14 /quota
# vim /etc/fstab
/dev/hda14 /quota ext3 defaults,usrquota,grpquota 0 0
# quotacheck -ugv /quota
# quotaon -ugv /quota
# edquota -u tom
Disk quotas for user tom (uid 500):
Filesystem blocks soft hard inodes soft hard
/dev/hda14 0 3072 5120 0 7 10
# chmod 777 /quota
# su - tom
$ cd /quota
$ dd if=/dev/zero of=/quota/a bs=1M count=1
$ dd if=/dev/zero of=c bs=1M count=1
$ ls -lh
$ dd if=/dev/zero of=d bs=1M count=1
$ dd if=/dev/zero of=e bs=1M count=1
$ ls
$ ls -lh
$ rm -rf {e,d,c}
# edquota -u tom
$ touch {c,d,e,f,g,h}
$ ls
$ touch {i,j,k,l}
-------------------
# useradd mike
# useradd -g mike john
# edquota -g mike
Disk quotas for group mike (gid 501):
Filesystem blocks soft hard inodes soft hard
/dev/hda14 0 3072 5120 0 7 10
# su - mike
$ ls
aquota.group aquota.user lost+found mike
$ cd mike
$ dd if=/dev/zero of=/quota/mike/a bs=1M count=1
$ dd if=/dev/zero of=/quota/mike/b bs=1M count=1
# su - john
$ cd /quota/mike
$ dd if=/dev/zero of=/quota/mike/c bs=1M count=1
$ dd if=/dev/zero of=/quota/mike/d bs=1M count=1
$ dd if=/dev/zero of=/quota/mike/e bs=1M count=1
hda14: write failed, group block limit reached.
$ touch f
$ touch g
hda14: warning, group file quota exceeded.
$ echo "hello ,good idea" > f
-bash: echo: write error: Disk quota exceeded
$ touch h
$ touch i
$ touch j
hda14: write failed, group file limit reached.