【正文】
?超級塊 Acegene IT Co. Ltd. 10 文件系統(tǒng)的構(gòu)成 : i結(jié)點(diǎn) ? UNIX文件系統(tǒng)最基礎(chǔ)的材料是 i結(jié)點(diǎn) (inode) ? i結(jié)點(diǎn)是一個(gè)包含著指針的控制結(jié)構(gòu),其中的指針要么指向其他 i結(jié)點(diǎn),要么指向數(shù)據(jù)塊。 Acegene IT Co. Ltd. 11 文件系統(tǒng)的構(gòu)成 : i結(jié)點(diǎn) ? ext2文件系統(tǒng)中 i 結(jié)點(diǎn)和數(shù)據(jù)塊的組織結(jié)構(gòu)。 –在 Linux的 ext2文件系統(tǒng)中,在每一組數(shù)據(jù)塊的后面就安排有一個(gè)超級塊。s system id ? 82 Linux Swap ? 83 Linux – w write table to disk and exit Acegene IT Co. Ltd. 16 Creating Extended Partitions /sbin/fdisk /dev/sde Command (m for help): n Command action e extended p primary partition (14) e Partition number (14): 1 First cylinder (11020, default 1): 1 Last cylinder or +size or +sizeM or +sizeK (11020, default 1020): 1020 Command (m for help): w The partition table has been altered! Acegene IT Co. Ltd. 17 Creating Logical Partitions /sbin/fdisk /dev/sde Command (m for help): n Command action l logical (5 or over) p primary partition (14) l First cylinder (11020, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (11020, default 1020): +5m Command (m for help): p Disk /dev/sde: 232 heads, 62 sectors, 1020 cylinders Units = cylinders of 14384 * 512 bytes Device Boot Start End Blocks Id System /dev/sde1 1 1020 7335809 5 Extended /dev/sde5 1 1 7130 83 Linux Acegene IT Co. Ltd. 18 Listing Partitions cat /proc/partitions major minor blocks name rio rmerge … 8 0 8281507 sda … 8 1 8281476 sda1 … 8 16 4192965 sdb … 8 17 2048256 sdb1 … 8 18 2048287 sdb2 … 8 32 9430155 sdc … 8 33 9430123 sdc1 … 8 48 9430155 sdd … 8 49 4715046 sdd1 … 8 50 4715077 sdd2 … 22 0 252290 hdc … Acegene IT Co. Ltd. 19 建立文件系統(tǒng) ?/sbin/mkfs 格式化分區(qū) ––t 指定文件系統(tǒng)類型 –如 : ?Ext2: mkfs –t ext2 /dev/sdb1 ?Ext3: mkfs –j /dev/sdb1 –或使用 /sbin/mkfs.fstype代替 ? mke2fs建立 ext2/3文件系統(tǒng); mke2fs /dev/hdb3 mke2fs j ext3 /dev/hdb3 ext2 vs. ext3 ? ext2 used to be the most mon Linux filesystem ? ext3 is based on ext2 –Same ondisk structure –ext2 can be converted to ext3 –ext3 can be mounted as an ext2 file system ? ext3 is a journaling filesystem –Preserves data integrity better than ext2 –Faster and safer fsck after system crash Acegene IT Co. Ltd. 21 Swap分區(qū)配置 ? mkswap建立 swap文件系統(tǒng)。 tar of open database files needed for hot backup Acegene IT Co. Ltd. 28 掛裝和卸載硬盤分區(qū) ? 文件系統(tǒng)的管理工作是從根目錄 /開始的。 ? mount命令通??梢宰约簷z測出這類信息,例外 : OCFS – o options 定義作用于掛裝過程的選項(xiàng)。如下所示: ?[ roottest /root ]umount /usr –把掛裝在 /usr子目錄位置上的分區(qū)卸載下來。 – umount f 參數(shù)強(qiáng)制執(zhí)行卸載操作。 Acegene IT Co. Ltd. 34 /etc/fstab文件 ? /etc/fstab是一個(gè) mount命令可以利用的配置文件。 /dev/device /dir/to/mount fstype parameters fs_freq fs_passno ? 掛載命令 : – mount /oracle – mount /dev/sdb1 Acegene IT Co. Ltd. 35 /etc/fstab文件 ? /etc/fstab文件的數(shù)據(jù)項(xiàng)說明 – /dev/device 將被掛裝的分區(qū) ? 比如 dev/hda3 – /dir/to/mount: 分區(qū)掛裝到其上的子目錄( ? 比如 /usr) – fstype: 文件系統(tǒng)的類型(比如 ext2/ext3) – parameters: mount命令 o參數(shù)的附加參數(shù) – mount option ? defaults 缺省值 ? noauto 防止啟動(dòng)時(shí)自動(dòng)加載 – fs_freq: 數(shù)值類型,告訴 dump命令備份這個(gè)文件系統(tǒng)的頻率 – fs_passno: 數(shù)值類型,告訴 fsck程序在引導(dǎo)時(shí)確定文件系統(tǒng)的檢查順序(請注意所有文件系統(tǒng)在掛裝之前都要被檢查) Acegene IT Co. Ltd. 36 /etc/fstab文件 ? swap分區(qū)是虛擬內(nèi)存駐留的地方。詳細(xì)資料請查閱 mkswap命令的使用手冊頁 . Acegene IT