2010年12月9日 星期四

同時新增多組帳號及Disk Quota limit的實驗 (三)

  • LAB B :
    4. 建立 檔案系統/dev/hda5(容量100MB)
    5. /dev/hda5的檔案系統格式為 ext3
    6. /dev/hda5 掛載到 /media/hda5
  • 操作步驟 :
         STEP 1. 確認硬碟裝置檔檔名
[root@lab-2 ~]# fdisk -l

Disk /dev/hdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 13 104391 83 Linux
/dev/hdb2 14 778 6144862+ 83 Linux
/dev/hdb3 779 909 1052257+ 82 Linux swap / Solaris

STEP 2. 執行 fdisk 劃分檔案系統
[root@lab-2 ~]# fdisk /dev/hdb

STEP 3. 執行 fdisk 劃分檔案系統
[root@lab-2 ~]# fdisk /dev/hdb

STEP 4. 新增延伸分割區 /dev/hdb4
Command (m for help): p

Disk /dev/hdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 13 104391 83 Linux
/dev/hdb2 14 778 6144862+ 83 Linux
/dev/hdb3 779 909 1052257+ 82 Linux swap / Solaris

Command (m for help): n
Command action
e extended
p primary partition (1-4)
e
Selected partition 4
First cylinder (910-1044, default 910):
Using default value 910
Last cylinder or +size or +sizeM or +sizeK (910-1044, default 1044):
Using default value 1044

Command (m for help): p

Disk /dev/hdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 13 104391 83 Linux
/dev/hdb2 14 778 6144862+ 83 Linux
/dev/hdb3 779 909 1052257+ 82 Linux swap / Solaris
/dev/hdb4 910 1044 1084387+ 5 Extended

STEP 5. 新增邏輯分割區 /dev/hdb5(容量 100MB)
Command (m for help): n
First cylinder (910-1044, default 910):
Using default value 910
Last cylinder or +size or +sizeM or +sizeK (910-1044, default 1044): +100M

Command (m for help): p

Disk /dev/hdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 13 104391 83 Linux
/dev/hdb2 14 778 6144862+ 83 Linux
/dev/hdb3 779 909 1052257+ 82 Linux swap / Solaris
/dev/hdb4 910 1044 1084387+ 5 Extended
/dev/hdb5 910 922 104391 83 Linux
STEP 6. 儲存變更後的Partition Table並使用 partprobe 進行同步作業使New Partition Table 生效
(或重啟系統使New Partition Table 生效)
Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
You have new mail in /var/spool/mail/root
[root@lab-2 ~]# partprobe

STEP 7. /dev/hdb5 格式化為 ext3 檔案系統
[root@lab-2 ~]# mkfs -t ext3 /dev/hdb5
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
26104 inodes, 104388 blocks
5219 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
13 block groups
8192 blocks per group, 8192 fragments per group
2008 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729

Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 31 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@lab-2 ~]# dumpe2fs /dev/hdb5 | grep 'Filesystem features:'
dumpe2fs 1.39 (29-May-2006)
Filesystem features: has_journal resize_inode dir_index filetype sparse_super
[root@lab-2 ~]#

STEP 8. 建立掛載點 /media/hdb5
[root@lab-2 ~]# ls -ld /media/hdb5
ls: /media/jdb5: No such file or directory
[root@lab-2 ~]# mkdir /media/hdb5
[root@lab-2 ~]# ls -ld /media/hdb5
drwxr-xr-x 2 root root 4096 Dec 6 15:21 /media/hdb5

STEP 9. /dev/hdb5 掛載到 /media/hdb5 並確認掛載選項正確
[root@lab-2 ~]# mount -t ext3 -o usrquota,grpquota /dev/hdb5 /media/hdb5/
[root@lab-2 ~]# mount | grep hdb5
/dev/hdb5 on /media/hdb5 type ext3 (rw,usrquota,grpquota)

沒有留言:

張貼留言