AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 964108
Accepted
miken32
miken32
Asked: 2019-04-23 12:18:00 +0800 CST2019-04-23 12:18:00 +0800 CST 2019-04-23 12:18:00 +0800 CST

在 Kickstart 安装期间保留现有卷

  • 772

所以,我有一台运行 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
linux
  • 1 1 个回答
  • 1058 Views

1 个回答

  • Voted
  1. Best Answer
    miken32
    2019-04-25T10:35:24+08:002019-04-25T10:35:24+08:00

    这就是在我的 SL7 kickstart 文件中最终为我工作的内容。该part指令有一个--onpart选项来指定要在哪个驱动器上查找分区,其余的似乎从那里找出来。一些明智的使用--useexisting并--noformat确保我的数据在安装后正在等待我。

    zerombr
    bootloader --location="mbr" --driveorder="sda" --append="crashkernel=auto rhgb vga=788"
    part /boot --fstype="xfs" --recommended --onpart=sda1
    part pv.008002 --grow --size=1 --noformat --onpart=sda2
    volgroup vg_main --pesize=4096 --useexisting --noformat
    logvol / --fstype="xfs" --name="lv_root" --vgname="vg_main" --size=8192 --useexisting
    logvol swap --name="lv_swap" --vgname="vg_main" --size=1024 --useexisting
    logvol /home --fstype=ext4 --name=lv_home --vgname=vg_main  --fsoptions="usrquota" --size=8192 --grow --noformat
    
    • 1

相关问题

  • Linux 主机到主机迁移

  • 如何在 Linux 机器上找到有关硬件的详细信息?

  • 如何在 Linux 下监控每个进程的网络 I/O 使用情况?

  • 在 RHEL4 上修改 CUPS 中的现有打印机设置

  • 为本地网络中的名称解析添加自定义 dns 条目

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve