Bài giảng Quản trị Linux: Quản trị hệ thống tập tin - Đặng Thanh Bình

43 69 0
Bài giảng Quản trị Linux: Quản trị hệ thống tập tin - Đặng Thanh Bình

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Bài giảng Quản trị Linux: Quản trị hệ thống tập tin gồm có những nội dung chính sau: Kiến trúc hệ thống tập tin, FHS, hệ thống tập tin nhật ký, Không gian hoán chuyển, quản trị tập tin cơ bản. Mời các bạn cùng tham khảo để biết thêm các nội dung chi tiết.

Đặng Thanh Bình Quản trị hệ thống tập tin Contents • • • • • Kiến trúc hệ thống tập tin FHS Hệ thống tập tin nhật ký Không gian hoán chuyển Quản trị tập tin Introduction • File system đề cập đến tập tin thư mục lưu máy tính • Một file system có grong định dạng khác nhau, gọi file system type – Xác định cách thức thơng tin lưu trữ • Một số FS tạo liệu, FS khác giúp tăng tốc truy cập liệu CẤU TRÚC FILE SYSTEM Phân loại tập tin • Các hệ thống tập tin chia tập tin thành loại: – Các tập tin chia sẻ không chia sẻ – Tập tin biến tập tin tĩnh • Variable file, chẳng hạn file văn bản, thay đổi nội dung liên tục • Static file, chẳng hạn tập tin nhị phân, không thay đổi nội dung trừ người quản trị thao tác File System Hierarchy Standard (FHS) • Linux sử dụng Filesystem Hierarchy Standard (FHS) • Chuẩn quy định tên, vị trí phân quyenf cho nhiều loại tập tin thư mục • Tương thích với chuẩn đồng nghĩa với nhiều điều, điều quan trọng – Tương thích với hệ thống dùng chung chuẩn – Khả mount phân vùng /usr/ dạng đọc  mount CD-ROM Tổ chức FHS • /boot: chứa static file để boot hệ thống, chẳn hạn Linux kernel • /dev: chứa device node thể thiết bị gắn vào máy tính thiết bị ảo cung cấp kernel – udev demon quản lý việc khởi tạo remove thiết bị quản lý /dev/ FHS Organization • /etc: chứa file cấu hình • /lib: chứa file thư viện để chạy file nhị phân /bin/ /sbin/ FHS Organization • /media: chứa thư mục dung làm mount point cho thiết bị lưu trữ removeable flash USB, DVD, CD-ROM, đĩa Zip • /mnt: FS mount tạm thời, chẳng hạn điểm mount NFS • /opt: nơi lưu gói phần mềm • /proc: chứa tập tin đặc biệt giúp lấy thông tin từ gửi thông tin đến kernel FHS Organization • /sbin: file thực thi dùng root user • /usr: nơi lưu trữ tập tin dùng để chia sẻ máy khác • /var: – Variable data file – Còn dùng để chứa file log, file tạm 10 Filesystem Types • • • • • • • • ext2 - previous Linux standard file system vfat – Windows 9x FAT32 ntfs – Windows NT/2000/XP NTFS iso9660 – CD-ROM smbfs – shared filesystem using SMB nfs – Network File System proc – virtual filesystem /proc ext3, ext4, reiserfs, xfs, jfs – journal filesystems 29 Standard Hard Disk Partitioning 30 Standard Hard Disk Partitioning • A sample Linux partitioning strategy 31 Standard Hard Disk Partitioning • A sample dual-boot Linux partitioning strategy 32 Working with Hard Disk Partitions • fdisk command: installation Create partitions after – Specify hard disk partition as an argument – Variety of options for fdisk prompt to achieve different tasks • cfdisk command: Interactive graphical utility for creating, manipulating and deleting partitions • Reboot computer after using the fdisk and cfdisk commands to ensure proper reloading into memory 33 Working with Hard Disk Partitions • Example – Make partitions • # fdisk /dev/hda – Create new filesystem mkfs -t fstype filesys blocks – blocks: kích thước fs (1024-byte blocks) • # mkfs -t ext3 /dev/hda6 • # mkfs -t vfat /dev/hda7 34 Mounting • Mounting: making a device accessible to users via the logical directory tree • Mount point: directory to which a device is attached • The mounted device temporarily covers up the contents of the mount point • Any existing directory can be a mount point • In order to prevent making files inaccessible, create empty directories used specifically for mounting devices 35 Mounting • The directory structure prior to mounting 36 Mounting • The directory structure after mounting a floppy device 37 Mounting • mount command – When used with no options or arguments, lists currently mounted filesystems – -a: mount tất fs mô tả /etc/fstab – -o: tuỳ chọn mount • remount: mount lại fs mount • ro: read-only 38 Mounting • umount command umount directory | device – # umount /mnt/backup – # umount /dev/hda1 – # mount -t iso9660 /dev/hdd /mnt/cdrom – -a: unmount filesystems described in /etc/mtab 39 File /etc/fstab • Auto mount filesystems when booting • Example 40 File /etc/fstab device mounting_directory filesystem_type options 0 • options – auto/noauto • auto: the device will be mounted automatically • noauto: the device will not be mounted automatically • "automatically" : either at boot or when the command mount -a is issued – user/nouser • user allows all standard (and root) users to mount the device • nouser only allows the root user to mount the device 41 File /etc/fstab device mounting_directory filesystem_type options 0 • options – ro: Mount the device in read only mode – rw: Mount the device in read/write mode – sync/async • sync writes data to the device on the fly (as soon as a command is issued) • async writes data later – suid: This allos suid and sgid bits to be effective on the mounted file system – defaults: Use all default options (rw, suid, dev, exec, auto, nouser, and async) 42 File /etc/fstab device mounting_directory filesystem_type options 0 • The final section is actually the dump/fsck section – Basically if you set these bits to (off) the mounted devices will not be checked by either dump or fsck – You will rarely, if ever, need anything but zeros here 43 ...Contents • • • • • Kiến trúc hệ thống tập tin FHS Hệ thống tập tin nhật ký Không gian hoán chuyển Quản trị tập tin Introduction • File system đề cập đến tập tin thư mục lưu máy tính • Một file... cách thức thơng tin lưu trữ • Một số FS tạo liệu, FS khác giúp tăng tốc truy cập liệu CẤU TRÚC FILE SYSTEM Phân loại tập tin • Các hệ thống tập tin chia tập tin thành loại: – Các tập tin chia sẻ... chia sẻ – Tập tin biến tập tin tĩnh • Variable file, chẳng hạn file văn bản, thay đổi nội dung liên tục • Static file, chẳng hạn tập tin nhị phân, không thay đổi nội dung trừ người quản trị thao

Ngày đăng: 30/01/2020, 05:14

Tài liệu liên quan