- 論壇徽章:
- 0
|
fdisk /dev/hdc
Command (m for help): p
Disk /dev/hdc: 40.0 GB, 40007761920 bytes
16 heads, 63 sectors/track, 77520 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Device Boot Start End Blocks Id System
/dev/hdc1 1 19377 9765976+ 8e Linux LVM
/dev/hdc2 19378 77520 29304072 5 Extended
/dev/hdc5 19378 29066 4883224+ 83 Linux
Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
l
First cylinder (29067-77520, default 29067):
Using default value 29067
Last cylinder or +size or +sizeM or +sizeK (29067-77520, default 77520): +5g
Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
Command action
l logical (5 or over)
p primary partition (1-4)
l
First cylinder (38756-77520, default 38756):
Using default value 38756
Last cylinder or +size or +sizeM or +sizeK (38756-77520, default 77520): +5g
Command (m for help): p
Disk /dev/hdc: 40.0 GB, 40007761920 bytes
16 heads, 63 sectors/track, 77520 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Device Boot Start End Blocks Id System
/dev/hdc1 1 19377 9765976+ 8e Linux LVM
/dev/hdc2 19378 77520 29304072 5 Extended
/dev/hdc5 19378 29066 4883224+ 83 Linux
/dev/hdc6 29067 38755 4883224+ 83 Linux
/dev/hdc7 38756 48444 4883224+ 83 Linux
Command (m for help): t
Partition number (1-7): 7
Hex code (type L to list codes): fd
Changed system type of partition 7 to fd (Linux raid autodetect)
Command (m for help): t
Partition number (1-7): 6
Hex code (type L to list codes): fd
Changed system type of partition 6 to fd (Linux raid autodetect)
Command (m for help): t
Partition number (1-7): 5
Hex code (type L to list codes): fd
Changed system type of partition 5 to fd (Linux raid autodetect)
Command (m for help): p
Disk /dev/hdc: 40.0 GB, 40007761920 bytes
16 heads, 63 sectors/track, 77520 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Device Boot Start End Blocks Id System
/dev/hdc1 1 19377 9765976+ 8e Linux LVM
/dev/hdc2 19378 77520 29304072 5 Extended
/dev/hdc5 19378 29066 4883224+ fd Linux raid autodetect
/dev/hdc6 29067 38755 4883224+ fd Linux raid autodetect
/dev/hdc7 38756 48444 4883224+ fd Linux raid autodetect
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@test25 ~]# partprobe
[root@test25 ~]# cat /proc/partitions
major minor #blocks name
3 0 39070080 hda
3 1 30668053 hda1
3 2 8393962 hda2
22 0 39070080 hdc
22 1 9765976 hdc1
22 2 1 hdc2
22 5 4883224 hdc5
22 6 4883224 hdc6
22 7 4883224 hdc7
[root@test25 ~]# pvcreate /dev/hdc1
Physical volume "/dev/hdc1" successfully created
[root@test25 ~]# vgcreate vg00 /dev/hdc1
Volume group "vg00" successfully created
[root@test25 ~]# lvcreate -L +5G -n data vg00
Logical volume "data" created
[root@test25 ~]# lvscan
ACTIVE '/dev/vg00/data' [5.00 GB] inherit
[root@test25 ~]# vgscan
Reading all physical volumes. This may take a while...
Found volume group "vg00" using metadata type lvm2
[root@test25 ~]# pvscan
PV /dev/hdc1 VG vg00 lvm2 [9.31 GB / 4.31 GB free]
Total: 1 [9.31 GB] / in use: 1 [9.31 GB] / in no VG: 0 [0 ]
[root@test25 ~]# mkfs.ext3 /dev/vg00/data
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
655360 inodes, 1310720 blocks
65536 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1342177280
40 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736
Writing inode tables: done
Creating journal (8192 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@test25 ~]#
[root@test25 ~]# mkdir /media/lvm1
[root@test25 ~]# mount /dev/vg00/data /media/lvm1/
[root@test25 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda1 29G 6.5G 21G 24% /
none 1014M 0 1014M 0% /dev/shm
172.16.100.98:/linuxos
39G 28G 9.1G 76% /mnt
/dev/mapper/vg00-data
5.0G 43M 4.7G 1% /media/lvm1
[root@test25 ~]# lvextend -L +2G /dev/vg00/data
Extending logical volume data to 7.00 GB
Logical volume data successfully resized
[root@test25 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda1 29G 6.5G 21G 24% /
none 1014M 0 1014M 0% /dev/shm
172.16.100.98:/linuxos
39G 28G 9.1G 76% /mnt
/dev/mapper/vg00-data
5.0G 43M 4.7G 1% /media/lvm1
[root@test25 ~]# ext2online /dev/vg00/data
ext2online v1.1.18 - 2001/03/18 for EXT2FS 0.5b
[root@test25 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda1 29G 6.5G 21G 24% /
none 1014M 0 1014M 0% /dev/shm
172.16.100.98:/linuxos
39G 28G 9.1G 76% /mnt
/dev/mapper/vg00-data
6.9G 44M 6.5G 1% /media/lvm1
本文來(lái)自ChinaUnix博客,如果查看原文請(qǐng)點(diǎn):http://blog.chinaunix.net/u/23204/showart_704548.html |
|