This page looks plain and unstyled because you're using a non-standard compliant browser. To see it in its best form, please upgrade to a browser that supports web standards. It's free and painless.

修性不修命,萬劫陰靈難入聖; 修命不修性,猶有家財無主柄
Album | Blog | Comment | Profile | Control Panel
aquatower | 3 August,2009 23:21
Bookmark: HemiDemi MyShare Baidu Google Bookmarks Yahoo! My Web Del.icio.us Digg technorati furl Bookmark to:YouPush Bookmark to:你推我報

LAB

%create a new filesystem

#fdisk -l /dev/sdb

Disk /dev/sdb: 3253 MB, 3253469184 bytes
101 heads, 62 sectors/track, 1014 cylinders
Units = cylinders of 6262 * 512 = 3206144 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 32 100161 82 Linux swap / Solaris
/dev/sdb2 33 64 100192 fd Linux raid autodetect
/dev/sdb3 65 96 100192 fd Linux raid autodetect
/dev/sdb4 97 1014 2874258 5 Extended
/dev/sdb5 97 128 100161 fd Linux raid autodetect
/dev/sdb6 129 160 100161 fd Linux raid autodetect
/dev/sdb7 161 192 100161 fd Linux raid autodetect


#fdisk /dev/sdb

[root@server1 ~]# fdisk /dev/sdb

Command (m for help): n
First cylinder (193-1014, default 193):
Using default value 193
Last cylinder or +size or +sizeM or +sizeK (193-1014, default 1014): +100M

Command (m for help): p

Disk /dev/sdb: 3253 MB, 3253469184 bytes
101 heads, 62 sectors/track, 1014 cylinders
Units = cylinders of 6262 * 512 = 3206144 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 32 100161 82 Linux swap / Solaris
/dev/sdb2 33 64 100192 fd Linux raid autodetect
/dev/sdb3 65 96 100192 fd Linux raid autodetect
/dev/sdb4 97 1014 2874258 5 Extended
/dev/sdb5 97 128 100161 fd Linux raid autodetect
/dev/sdb6 129 160 100161 fd Linux raid autodetect
/dev/sdb7 161 192 100161 fd Linux raid autodetect
/dev/sdb8 193 224 100161 83 Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@server1 ~]# cat /proc/partitions
major minor #blocks name

8 0 78150744 sda
8 1 104391 sda1
8 2 78043770 sda2
253 0 75988992 dm-0
253 1 2031616 dm-1
8 16 3177216 sdb
8 17 100161 sdb1
8 18 100192 sdb2
8 19 100192 sdb3
8 20 1 sdb4
8 21 100161 sdb5
8 22 100161 sdb6
8 23 100161 sdb7
8 24 100161 sdb8

#partprobe

#mkfs.ext3 -L opt /dev/sdb8

#vi /etc/fstab
LABLE=opt /opt ext3 defaults 0 0

#mount -a

%create swap partitions
#fdisk /dev/sdb

Command (m for help): n
First cylinder (193-1014, default 193):
Using default value 193
Last cylinder or +size or +sizeM or +sizeK (193-1014, default 1014): +100M

Command (m for help): t
Partition number (1-8): 8
Hex code (type L to list codes): 82
Changed system type of partition 8 to 82 (Linux swap / Solaris)

Command (m for help): p

Disk /dev/sdb: 3253 MB, 3253469184 bytes
101 heads, 62 sectors/track, 1014 cylinders
Units = cylinders of 6262 * 512 = 3206144 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 32 100161 82 Linux swap / Solaris
/dev/sdb2 33 64 100192 fd Linux raid autodetect
/dev/sdb3 65 96 100192 fd Linux raid autodetect
/dev/sdb4 97 1014 2874258 5 Extended
/dev/sdb5 97 128 100161 fd Linux raid autodetect
/dev/sdb6 129 160 100161 fd Linux raid autodetect
/dev/sdb7 161 192 100161 fd Linux raid autodetect
/dev/sdb8 193 224 100161 82 Linux swap / Solaris

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@server1 ~]# cat /proc/partitions
major minor #blocks name

8 0 78150744 sda
8 1 104391 sda1
8 2 78043770 sda2
253 0 75988992 dm-0
253 1 2031616 dm-1
8 16 3177216 sdb
8 17 100161 sdb1
8 18 100192 sdb2
8 19 100192 sdb3
8 20 1 sdb4
8 21 100161 sdb5
8 22 100161 sdb6
8 23 100161 sdb7
8 24 100161 sdb8

#partprobe

#mkswap /dev/sdb8 -L newswap
[root@server1 ~]# mkswap /dev/sdb8 -L newswap
Setting up swapspace version 1, size = 102559 kB
LABEL=newswap, no uuid

#vi /etc/fstab
LABEL=newswap swap swap defults 0 0

#swapon -a
#swapon -s
[root@server1 ~]# swapon -s
Filename Type Size Used Priority
/dev/mapper/VolGroup00-LogVol01 partition 2031608 0 -1
/dev/sdb8 partition 100152 0 -2






Comment

Trackback

Comment Permissions: Only members may comment. If you are not a PIXNET member, click here to sign up.