永发信息网

急!100分!:Linux达人来,解答这道实验题,会虚拟机的优先!

答案:4  悬赏:50  手机版
解决时间 2021-03-31 22:24
急!100分!:Linux达人来,解答这道实验题,会虚拟机的优先!
最佳答案
-------------------------------------------------------------
实验环境:
虚拟机:VMWare WorkStation 7.1
操作系统:RHEL 5.3

原有硬盘20G,使用自动分区安装系统
后添加3块SCSI硬盘,现已经全部热插上
-------------------------------------------------------------
[root@as5u3 ~]# echo "scsi add-single-device 0 0 1 0" > /proc/scsi/scsi
[root@as5u3 ~]# echo "scsi add-single-device 0 0 2 0" > /proc/scsi/scsi
[root@as5u3 ~]# echo "scsi add-single-device 0 0 3 0" > /proc/scsi/scsi
[root@as5u3 ~]# 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: 156.7 GB, 156766306304 bytes
255 heads, 63 sectors/track, 19059 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

Disk /dev/sdc: 156.7 GB, 156766306304 bytes
255 heads, 63 sectors/track, 19059 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdc doesn't contain a valid partition table

Disk /dev/sdd: 156.7 GB, 156766306304 bytes
255 heads, 63 sectors/track, 19059 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdd doesn't contain a valid partition table
[root@as5u3 ~]# 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 19059.
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-19059, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-19059, default 19059):
Using default value 19059

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): l

0 Empty 1e Hidden W95 FAT1 80 Old Minix bf Solaris
1 FAT12 24 NEC DOS 81 Minix / old Lin c1 DRDOS/sec (FAT-
2 XENIX root 39 Plan 9 82 Linux swap / So c4 DRDOS/sec (FAT-
3 XENIX usr 3c PartitionMagic 83 Linux c6 DRDOS/sec (FAT-
4 FAT16 <32M 40 Venix 80286 84 OS/2 hidden C: c7 Syrinx
5 Extended 41 PPC PReP Boot 85 Linux extended da Non-FS data
6 FAT16 42 SFS 86 NTFS volume set db CP/M / CTOS / .
7 HPFS/NTFS 4d QNX4.x 87 NTFS volume set de Dell Utility
8 AIX 4e QNX4.x 2nd part 88 Linux plaintext df BootIt
9 AIX bootable 4f QNX4.x 3rd part 8e Linux LVM e1 DOS access
a OS/2 Boot Manag 50 OnTrack DM 93 Amoeba e3 DOS R/O
b W95 FAT32 51 OnTrack DM6 Aux 94 Amoeba BBT e4 SpeedStor
c W95 FAT32 (LBA) 52 CP/M 9f BSD/OS eb BeOS fs
e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a0 IBM Thinkpad hi ee EFI GPT
f W95 Ext'd (LBA) 54 OnTrackDM6 a5 FreeBSD ef EFI (FAT-12/16/
10 OPUS 55 EZ-Drive a6 OpenBSD f0 Linux/PA-RISC b
11 Hidden FAT12 56 Golden Bow a7 NeXTSTEP f1 SpeedStor
12 Compaq diagnost 5c Priam Edisk a8 Darwin UFS f4 SpeedStor
14 Hidden FAT16 <3 61 SpeedStor a9 NetBSD f2 DOS secondary
16 Hidden FAT16 63 GNU HURD or Sys ab Darwin boot fb VMware VMFS
17 Hidden HPFS/NTF 64 Novell Netware b7 BSDI fs fc VMware VMKCORE
18 AST SmartSleep 65 Novell Netware b8 BSDI swap fd Linux raid auto
1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard hid fe LANstep
1c Hidden W95 FAT3 75 PC/IX be Solaris boot ff BBT
Hex code (type L to list codes): 83

Command (m for help): p

Disk /dev/sdb: 156.7 GB, 156766306304 bytes
255 heads, 63 sectors/track, 19059 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 19059 153091386 83 Linux

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

Calling ioctl() to re-read partition table.
Syncing disks.
-------------------------------------------------------------------
/dev/sdc /dev/sdd分区方法一样,略
-------------------------------------------------------------------
[root@as5u3 ~]# 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: 156.7 GB, 156766306304 bytes
255 heads, 63 sectors/track, 19059 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 19059 153091386 83 Linux

Disk /dev/sdc: 156.7 GB, 156766306304 bytes
255 heads, 63 sectors/track, 19059 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdc1 1 19059 153091386 83 Linux

Disk /dev/sdd: 156.7 GB, 156766306304 bytes
255 heads, 63 sectors/track, 19059 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdd1 1 19059 153091386 83 Linux
[root@as5u3 ~]# vgdisplay
--- Volume group ---
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 8
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 19.88 GB
PE Size 32.00 MB
Total PE 636
Alloc PE / Size 636 / 19.88 GB
Free PE / Size 0 / 0
VG UUID tl8AYK-pp5C-M3Px-mMIg-XsFn-AO5o-JQC43E

[root@as5u3 ~]# pvdisplay
--- Physical volume ---
PV Name /dev/sda2
VG Name VolGroup00
PV Size 19.89 GB / not usable 19.49 MB
Allocatable yes (but full)
PE Size (KByte) 32768
Total PE 636
Free PE 0
Allocated PE 636
PV UUID HIsTkc-6E16-9QYp-AFA9-MFNU-oxFs-HZxEs3

[root@as5u3 ~]# pvcreate /dev/sdb1
Physical volume "/dev/sdb1" successfully created
[root@as5u3 ~]# pvcreate /dev/sdc1
Physical volume "/dev/sdc1" successfully created
[root@as5u3 ~]# pvcreate /dev/sdd1
Physical volume "/dev/sdd1" successfully created
[root@as5u3 ~]# vgextend VolGroup00 /dev/sdb1 /dev/sdc1 /dev/sdd1
Volume group "VolGroup00" successfully extended
[root@as5u3 ~]# vgdisplay
--- Volume group ---
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 4
Metadata Sequence No 9
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 4
Act PV 4
VG Size 457.78 GB
PE Size 32.00 MB
Total PE 14649
Alloc PE / Size 636 / 19.88 GB
Free PE / Size 14013 / 437.91 GB
VG UUID tl8AYK-pp5C-M3Px-mMIg-XsFn-AO5o-JQC43E

[root@as5u3 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
19G 2.3G 16G 14% /
/dev/sda1 99M 12M 82M 13% /boot
tmpfs 252M 0 252M 0% /dev/shm
----------------------------------------------------------------------
扩展为200G
-----------------------------------------------------------------------
[root@as5u3 ~]# lvextend -L 200GB /dev/VolGroup00/LogVol00
Extending logical volume LogVol00 to 200.00 GB
Logical volume LogVol00 successfully resized
[root@as5u3 ~]# resize2fs /dev/VolGroup00/LogVol00
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/VolGroup00/LogVol00 is mounted on /; on-line resizing required
Performing an on-line resize of /dev/VolGroup00/LogVol00 to 52428800 (4k) blocks.
The filesystem on /dev/VolGroup00/LogVol00 is now 52428800 blocks long.

[root@as5u3 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
194G 2.3G 182G 2% /
/dev/sda1 99M 12M 82M 13% /boot
tmpfs 252M 0 252M 0% /dev/shm

----------------------------------------------------------------------
再加100G
-----------------------------------------------------------------------
[root@as5u3 ~]# lvextend -L +100GB /dev/VolGroup00/LogVol00
Extending logical volume LogVol00 to 300.00 GB
Logical volume LogVol00 successfully resized
[root@as5u3 ~]# resize2fs /dev/VolGroup00/LogVol00
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/VolGroup00/LogVol00 is mounted on /; on-line resizing required
Performing an on-line resize of /dev/VolGroup00/LogVol00 to 78643200 (4k) blocks.
The filesystem on /dev/VolGroup00/LogVol00 is now 78643200 blocks long.
[root@as5u3 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
274G 2.3G 258G 1% /
/dev/sda1 99M 12M 82M 13% /boot
tmpfs 252M 0 252M 0% /dev/shm
全部回答
为了分解圣诞节快乐
下载软件
安装即可用硬盘
fdisk -l
查看有什么新的硬盘分区,
然后mkfs.ext3 /dev/sdX(X代表系统识别的硬盘)
然后mount /dev/sdX /mnt 就是可以在/mnt 下操作了,
当然,你要是让系统一启动就识别的话,得在/etc/fstab里面添加相应的硬盘
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
如何种植洋丝瓜尖的方法
速冻冰箱放东西进去可以保鲜吗
巡察和巡视有什么区别
画人怎么画
新华773路公交车什么时候开通
福建岩溶地貌分布。。知道的说··急用
什么叫做概念股?H股?
功夫货app下载功夫贷怎么贷
如何与农村婆婆愉快相处的5个秘诀
单选题下列各组离子能大量共存的是A.pH=1的溶
科沃斯的cen720扫地机器人怎么用
纹眉人家只给我涂了一次修复液会怎么样
估一估算一算356X5多少
如果已经在湖北买了10年社保,在广州继续买社
为什么金属颗粒大小要基本相同 酸的量及酸的
推荐资讯
住房入通知单怎么做成wps表格
王者主宰是什么意思
adc单独遇到剑圣怎么办,剑圣小顺风
38x0.52+0.38X35+3.8X1.3的简便法
中国古楼有什么好看
纺织品的水洗牢度4级,一般是指多少小时4级?
红参适合哪些年龄段的人吃
女生说就想一个人的意思是她在拒绝那个人了?
你介意妹妹妹夫住你的主卧室吗?
MBA择校:怎样才能不后悔
职工一直在家待岗解除劳动合同经济补偿金怎么
感觉女朋友长得很可爱,1.60 萌妹子那种,自
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?