![需要帮助安装硬盘](https://linux22.com/image/560612/%E9%9C%80%E8%A6%81%E5%B8%AE%E5%8A%A9%E5%AE%89%E8%A3%85%E7%A1%AC%E7%9B%98.png)
运行 fdisk -l 后出现此问题
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 522 4192933+ 83 Linux
/dev/sda2 523 60540 482094585 83 Linux
/dev/sda3 60541 60801 2096482+ 82 Linux swap / Solaris
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 13 104391 83 Linux
/dev/sdb2 14 60801 488279610 8e Linux LVM
和我的 df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 446G 397G 27G 94% /
/dev/sda1 3.9G 84M 3.6G 3% /boot
tmpfs 2.0G 0 2.0G 0% /dev/shm
我可以得到安装此硬盘的分步说明吗?我尝试在线搜索,但一切似乎都与我所拥有的不同。另外,如果我希望文件可供 apache 访问,我应该安装到哪个目录?
答案1
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 13 104391 83 Linux
/dev/sdb2 14 60801 488279610 8e Linux LVM
据我了解,您想要挂载/dev/sdb2
。请注意Id
和System
列,它显示8e
和LVM
卷。您不能像挂载标准分区(ext3、ext4……)那样挂载它。
使用以下命令列出所有物理卷:
# pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 VolGroup00 lvm2 a- 931.41G 0
/dev/sdb2 VolGroup00 lvm2 a- 931.50G 0
接下来,列出逻辑卷VolGroup00
:
# lvdisplay /dev/VolGroup00
--- Logical volume ---
LV Name /dev/VolGroup00/LogVol00
VG Name VolGroup00
LV UUID Eq8ceD-6A07-lfTw-QHoB-l8Hj-Rz0l-Ijsoro
LV Write Access read/write
LV Status available
# open 1
LV Size 1.81 TB
Current LE 59175
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
--- Logical volume ---
LV Name /dev/VolGroup00/LogVol01
VG Name VolGroup00
LV UUID pQG1xT-0PTT-xn35-QdVd-67Di-zYmr-xkb3WK
LV Write Access read/write
LV Status available
# open 0
LV Size 13.69 GB
Current LE 438
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
查看LV Size
并挂载您想要的逻辑卷:
mount /dev/VolGroup00/LogVol00 /mnt/data
为了使 Apache 可以写入此文件夹:
chown -R apache:apache /mnt/data
如果没有现有数据,并且您想要将其格式化为“普通”分区,请执行以下操作:
fdisk /dev/sdb
并按照提示进行操作。
创建 ext3 文件系统:
mkfs.ext3 /dev/sdb1
安装它:
mount /dev/sdb1 /mnt/data