· learnings · 3 min read
Linux学习日志 Ⅲ
Mount
建立mount point, 其实就是用mkdir建一个目录
# mount -t
以下是mount不同设备的方法:
# mount -t msdos -o ro /dev/fd0 /mnt/floppy
# mount -t vfat /dev/sdb1 /mnt/usb
# mount -t udf /dev/hdb1 /mnt/dvd
# mount -t iso9660 /dev/hdc1 /mnt/cdrom
# mount -t ext3 -o rw /dev/hda2 /home/staff
********************************
–hd* for IDE devices eg hard disk drives, CDs
–sd* for SCSI, SATA or USB devices
–fd* for floppy disks
********************************
系统boot时,自动mount的设备(Unless “noauto” option is listed)
Specified mount points, file system types, options etc for each device are stored in /etc/fstab
用完mount之后一般都要解除mount:
# umount
网络文件系统
标准协议有NFS (Network File System), CIFS (Common Internet File System)
设置NFS(Important)
在server side:
1. 配置/etc/exports
/home/user1/share s622-81.fit.qut.edu.au(rw) //read, write
/home/user2/project *.qut.edu.au(ro) //read only
/home/user3/pub 131.181.116.81(ro)
2. # service portmap restart
# service nfs restart
在client side:
# showmount -e
– Lists directories (shares) exported by server
# mount -t nfs
● share is
–
– eg files.fit.qut.edu.au:/home/n1234567/task
Quotas
一般用在home目录和一些数据目录,不用在系统盘。
察看文件系统容量(Checking File System Capacity)
use “df” command
– Lists size and usage of mounted file systems
– Enables monitoring of available space, and space used
Quota磁盘限额的具体步骤:
1.修改/etc/fstab文件
Ex. 在”/“下面建quota
/dev/sda1 / ext2 defaults,usrquota 1 1
------------------------------------------------------------------- – “usrquota” for user level quotas
– “grpquota” for group level quotas
-------------------------------------------------------------------
2.重启机器。
3.建立quota管理文件
quotacheck -avug
---------------------------------------------------------------------- a — 检查所有启用了配额的在本地挂载的文件系统
v — 在检查配额过程中显示详细的状态信息
u — 检查用户磁盘配额信息
g — 检查组群磁盘配额信息
----------------------------------------------------------------------
4.配置Quota限额:
edquota
配置过期时间(可选)
edquota -t
---------------------------------------------------------------------------------- Soft and Hard Limits
●Hard limit cannot be exceeded
●Soft limit can be exceeded for grace period
●Grace period resets once soft limit no longer exceeded
●Example of block limits
–Soft limit: 600000 blocks
–Grace period: 7 days
–Hard limit: 900000 blocks
---------------------------------------------------------------------------------
5.启动
quotaon (关闭:quotaoff)
-------------------------------------------------------------------------------- Other useful commands:
● “repquota” - produce quota report
● “warnquota” - configure action on limit breach
● “quota” - check own quota
--------------------------------------------------------------------------------
***************************
数据储存方式:
– local data storage
– file servers
– live mirrors (eg RAID)
– storage area networks
***************************
备份 (backup)
建立(create):
tar -cvf
tar -czvf
提取(extracting):
tar -xvf
tar -xzvf
察看(testing/viewing):
tar -tvf
tar -tzvf
--------------------------------------------------------- ●“tar” command line
tar
●Some useful options
-t list contents of tar archive
-c create new tar archive
-x extract files from tar archive
-z compress/uncompress files
-f required before tar filename
---------------------------------------------------------
***************************************************************
Scheduling Backups
Testing Backups
What to Backup
● Data
● System and Configuration
Types of Backup
●Full
–Entire system
●Differential or delta
–Changed or new files since last full backup
●Incremental
–Only changed or new files since last full or differential or incremental backup
(Incremental and Differential Backups:
Quicker to backup,
Use less storage space,
Slower to restore)
****************************************************************