2012年9月5日 星期三

分割硬碟的實作的LAB

一顆8G大小的硬碟,分割出至少兩個以上分割區!
其中一個格式為ext2,其中一個為ext3,比較兩者的不同處!

login as: bullock
bullock@192.168.1.28's password: ********
Last login: Thu Sep  6 11:51:57 2012 from 192.168.1.114
/usr/bin/xauth:  creating new authority file /home/bullock/.Xauthority
[bullock@example ~]$
[bullock@example ~]$
[bullock@example ~]$ su -
Password:
[root@example ~]# fdisk -l

Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        2610    20860402+  8e  Linux LVM

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

Disk /dev/sdb doesn't contain a valid partition table
[root@example ~]#
[root@example ~]#
[root@example ~]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.


The number of cylinders for this disk is set to 1044.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

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

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (124-1044, default 124):
Using default value 124
Last cylinder or +size or +sizeM or +sizeK (124-1044, default 1044): +2000M

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

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (368-1044, default 368):
Using default value 368
Last cylinder or +size or +sizeM or +sizeK (368-1044, default 1044):
Using default value 1044

Command (m for help): p

Disk /dev/sdb: 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/sdb1               1         123      987966   83  Linux
/dev/sdb2             124         367     1959930   83  Linux
/dev/sdb3             368        1044     5438002+   5  Extended
/dev/sdb5             368        1044     5437971   83  Linux

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.
[root@example ~]#
[root@example ~]# fdisk -l

Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        2610    20860402+  8e  Linux LVM

Disk /dev/sdb: 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/sdb1               1         123      987966   83  Linux
/dev/sdb2             124         367     1959930   83  Linux
/dev/sdb3             368        1044     5438002+   5  Extended
/dev/sdb5             368        1044     5437971   83  Linux
[root@example ~]#
[root@example ~]# partprobe
[root@example ~]#
[root@example ~]# mkfs.ext2 /dev/sdb1
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
123648 inodes, 246991 blocks
12349 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=255852544
8 block groups
32768 blocks per group, 32768 fragments per group
15456 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 26 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@example ~]# mkfs.ext3 /dev/sdb2
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
245280 inodes, 489982 blocks
24499 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=503316480
15 block groups
32768 blocks per group, 32768 fragments per group
16352 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912

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

This filesystem will be automatically checked every 26 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@example ~]#

紅色字為ext2和ext3兩種檔案系統的差異處! ext3多了日誌功能,能記錄block的變化...

2012年8月31日 星期五

LPIC 101,102複習

在民眾電腦的網工認證班所接受的職訓課,今天開始邁入了另一個領域。
是我很熟悉,但同學很陌生的電腦技術領域-LINUX。

藉著上課,我也順便複習LPIC 101和102,然後攻讀我的目標:201,202!

2012年6月27日 星期三

吳大教你輕鬆學LINUX!


  1. 認識LINUX!
  2. 怎麼安裝一套LINUX?
  3. 認識LINUX的應用軟體!
  4. LINUX設定技巧。
  5. GUI和CLI的差異?
  6. 還是不會用LINUX怎麼辦?
  7. 進階的LINUX應用有那些?
  8. 為什麼要使用LINUX?
  9. 認證之路~
持續修訂中……
大致撰寫方向條列如上。