所以,我有一台运行 Scientific Linux 6.9 的服务器,我想在上面安装 7。显然不支持升级,所以我需要进行全新安装,这很好。
我使用 Kickstart 安装了 SL6 服务器,具有以下选项:
...
zerombr
bootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb vga=788"
clearpart --all --drives=sda
part /boot --fstype=ext4 --size=500
part pv.008002 --grow --size=1
volgroup vg_main --pesize=4096 pv.008002
logvol / --fstype=ext4 --name=lv_root --vgname=vg_main --size=8192
logvol /home --fstype=ext4 --name=lv_home --vgname=vg_main --fsoptions="usrquota" --size=8192 --grow
logvol swap --name=lv_swap --vgname=vg_main --size=1024
...
我只想/home
在新安装期间只保留 LV。我已阅读文档中有关该--noformat
选项的信息,但它可以应用于partition、volume group和逻辑卷配置。我不清楚我应该在哪个级别使用它,更重要的是,它如何识别有问题的结构。
谢天谢地,这是一个虚拟机,所以我有快照可以依赖,但我不想在这上面浪费太多时间。那么,我应该使用哪些选项来安装 SL7 以确保/home
不受影响?
输出fdisk -l
是否有帮助:
Disk /dev/sda: 268.4 GB, 268435456000 bytes
255 heads, 63 sectors/track, 32635 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000852f6
Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 32636 261630976 8e Linux LVM
Disk /dev/mapper/vg_main-lv_root: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/vg_main-lv_swap: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/vg_main-lv_home: 258.2 GB, 258243297280 bytes
255 heads, 63 sectors/track, 31396 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
和输出vgdisplay -v
:
Using volume group(s) on command line.
--- Volume group ---
VG Name vg_main
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 4
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 3
Open LV 3
Max PV 0
Cur PV 1
Act PV 1
VG Size 249.51 GiB
PE Size 4.00 MiB
Total PE 63874
Alloc PE / Size 63874 / 249.51 GiB
Free PE / Size 0 / 0
VG UUID T03S3I-cgaj-A2OY-1e9d-FBiQ-8xpJ-NN3hUo
--- Logical volume ---
LV Path /dev/vg_main/lv_root
LV Name lv_root
VG Name vg_main
LV UUID FPXNoA-pqjg-Krbx-O5Sn-jFzg-GGsb-Ual7ww
LV Write Access read/write
LV Creation host, time rainicorn.domain.internal, 2014-06-05 14:12:41 -0400
LV Status available
# open 1
LV Size 8.00 GiB
Current LE 2048
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
--- Logical volume ---
LV Path /dev/vg_main/lv_home
LV Name lv_home
VG Name vg_main
LV UUID E38kVe-nxYm-rKop-Gwka-80Lh-T2VF-vGUkHE
LV Write Access read/write
LV Creation host, time rainicorn.domain.internal, 2014-06-05 14:12:44 -0400
LV Status available
# open 1
LV Size 240.51 GiB
Current LE 61570
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:2
--- Logical volume ---
LV Path /dev/vg_main/lv_swap
LV Name lv_swap
VG Name vg_main
LV UUID HoZ84h-eXye-lgNw-ggTN-YIEc-X0fZ-ZLcRCo
LV Write Access read/write
LV Creation host, time rainicorn.domain.internal, 2014-06-05 14:13:07 -0400
LV Status available
# open 1
LV Size 1.00 GiB
Current LE 256
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
--- Physical volumes ---
PV Name /dev/sda2
PV UUID shdyY0-fhMC-c7kB-LoKG-Jlk8-qN81-14toG3
PV Status allocatable
Total PE / Free PE 63874 / 0
这就是在我的 SL7 kickstart 文件中最终为我工作的内容。该
part
指令有一个--onpart
选项来指定要在哪个驱动器上查找分区,其余的似乎从那里找出来。一些明智的使用--useexisting
并--noformat
确保我的数据在安装后正在等待我。