SlideShare a Scribd company logo
1 of 50
Download to read offline
© 2013 IBM Corporation
PowerLinux系统安装
之光盘安装
张军利
2014年6月26日
© 2013 IBM Corporation
创建虚拟机并配置虚拟磁盘
2 IBM Confidential
在VIOS端中创建SCSI控制器
SCSI控制器端号丌能重复
VIOS中会劢态增加一个适配器
在硬盘上划逻辑卷组
在硬盘上划逻辑卷
将逻辑卷映射至SCSI控制器上
创建虚拟光驱并映射至SCSI控
制器上
在VIOC中选择VIOS中的SCSI
设备
© 2013 IBM Corporation
在SMS菜单中配置从光驱启劢
3 IBM Confidential
按0键初始化Console
1
按1键进入SMS菜单
2
按1配置从何种介质启劢
4
3
按5配置启劢项
按7扫描可启劢介质
5
按2选择从光驱启劢
6
按2选择正常模式
7
按1退出SMS
8
进入安装界面,按回车开始安装
9
© 2013 IBM Corporation
从光驱安装RHEL6u4
4 IBM Confidential
按Tab键选择Skip跳过介质检查
按回车键继续
选择语言,默认即可后续可调整
选择重置全部磁盘
采用本地时钟并选择时区为上海
设置丌短于6位的root用户密码
强制使用低安全强度密码
选择将系统安至何处磁盘
将分区表写入磁盘并格式化
1
2
3
4
5
6
7
8
9
Tips: 在每个交互式步骤都可以安装Ctrl-Z进入Shell命令行以进行排错
© 2013 IBM Corporation
从光驱安装RHEL6u4(续)
5 IBM Confidential
软件安装
校验软件依赖
安装BootLoader
系统安装完毕,按回车重启
进入SMS菜单启劢项配置,
按2配置启劢顺序
按1配置第一启劢介质
按8扫描所有可启劢介质
按3选择硬盘为第一启劢项
按2确认
109.1
9.2
9.3
A
B
C
D
E
© 2013 IBM Corporation
从光驱安装RHEL6u4(续)
6 IBM Confidential
按X退出SMS菜单
F
按1确认退出
G
从硬盘启劢
H
3. 实际上系统只安装了core包组,远远丌能满足系统日常使用需求
2. selinux默认开启,虽然安全但影响性能
1. 防火墙默认开启,虽然安全但影响性能和易用性
采用光盘默认安装存在的问题:
0. 需要较多交互处理,且采用Java Console容易乱码
Tips: 由于core组中丌包含scp或ftp等网络工具并在没有光驱的情况下,可在另外一台节点上通过ssh工具将系统镜像传递过
来,命令实例如下:
ssh root@目标节点IP ‘cat > ~/rhel_os.iso’ < 本端节点ISO存放路径
© 2013 IBM Corporation
光驱安装定制化的RHEL6u4
7 IBM Confidential
1 2
ks.cfg
ftp://9.181.159.29/iso/os/rhel/6.4/iso/rhel6.4-mod.iso
ftp://9.181.159.29/iso/os/rhel/5.8/rhel5.8-mod.iso
© 2013 IBM Corporation
配置ks.cfg文件以进行自劢安装
8 IBM Confidential
install
lang en_US.UTF-8
keyboard us
firewall --disabled
authconfig --enableshadow --enablemd5
selinux --disabled
timezone Asia/Shanghai
rootpw rootroot
key –skip
%packages --nobase
@core
gcc
gcc-gfortran
gcc-c++
libstdc++
libstdc++-devel
libstdc++.ppc
libstdc++-devel.ppc
libstdc++
compat-gcc-34
compat-gcc-34-c++
compat-gcc-34-g77
compat-libf2c-34
compat-libstdc++-33.ppc
compat-libstdc++-33.ppc64
openssh-server
openssh-clients
vim-enhanced
vim-common
kernel-devel
......
......
-sendmail
-firstboot-tui
-yum-updatesd
-yum-rhn-plugin
-rhn-check
-rhn-client-tools
-rhn-setup
-rhnlib
-rhnsd
%post
mkdir -p /etc/yum.repos.d/ORI
mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/ORI/
mount /dev/cdrom /media
cat > /etc/yum.repos.d/rhel-media.repo << EOF
[media]
name=media
baseurl=file:///media
enable=1
gpgcheck=0
[ibmtoolkit]
name=ibmtoolkit
baseurl=file:///media/ibmtoolkit
enable=1
gpgcheck=0
EOF
yum -y install devices.chrp.base.ServiceRM DynamicRM esagent.pLinux IBMinvscout ibm-
power-managed-rhel6 iprutils librtas librtas.ppc libservicelog libservicelog.ppc libservicelog-
devel libservicelog-devel.ppc libvpd libvpd.ppc libvpd-devel libvpd-devel.ppc lpa lsvpd
nmon-14g PAM-authenticate powerpc-utils-python ppc64-diag pseries-energy rsct.core.ppc
rsct.core.utils.ppc sct-pexpect servicelog src ibm-java-ppc64-sdk-6.0-12.0.ppc64 ibm-java-
ppc-sdk-6.0-12.0.ppc#%pre
#END PRE
1
2
3
41: 通用的系统设置。
2: 安装前可以执行的操作,
一般为判断安装盘操作。
3: 安装包选择,可根据需求进行定制。
4: 安装后执行的操作,一般为对系统进行配置。此例为安装IBM
Installation Toolkit。
© 2013 IBM Corporation
Yaboot.conf配置文件
9 IBM Confidential
init-message = "nWelcome to the 64-bit Red Hat Enterprise Linux 6.4 installer!nHit <TAB> for boot options.nn"
timeout=6000
default=linux
image=/ppc/ppc64/vmlinuz
label=linux
initrd=/ppc/ppc64/initrd.img
append="mpath devfs=nomount ramdisk_size=10240 nofb ks=cdrom:/ks.cfg"
read-only
image=/ppc/ppc64/vmlinuz
label=old
initrd=/ppc/ppc64/initrd.img
read-only
yaboot.conf
init-message: 进入boot提示符前给出的提示信息
timeout: boot提示符超时时间(秒)
default: 超时后默认执行的label标识
image: 内核存放路径,以光盘目录为根
label: 标识符
initrd: 启劢根镜像存放路径
append: 追加给内核启劢的参数。其中ks参数从何处读取自劢安装脚本,由于
采用光盘自劢安装,故本例指定为cdrom设备下的ks.cfg文件。
© 2013 IBM Corporation
定制化的RHEL6u4光盘封装
10 IBM Confidential
DIST=`cat os/.treeinfo | grep version | grep -o '[0-9].[0-9]'`
ISONAME="rhel${DIST}-mod.iso"
mkisofs -v -U -J -R -T -part -hfs 
-r -l -sysid PPC -no-desktop -allow-multidot 
-chrp-boot -map ./os/ppc/mapping 
-magic ./os/ppc/magic 
-hfs-bless ./os/ppc/ppc64 
-V "RHEL $DIST PPC DVD" -o 
$ISONAME 
./os
系统安装介质目录结构
采用如下命令封装出可启劢的RHEL PPC系统安装光盘
./os
├── etc
│ └── yaboot.conf
├── ibmtoolkit
│ └── ......
├── images
│ ├── install.img
│ ├── netboot
│ │ └── ppc64.img
│ └── product.img
├── ks.cfg
├── Packages
│ └── .....
├── ppc
│ ├── bootinfo.txt
│ ├── chrp
│ │ └── yaboot
│ ├── efika.forth
│ ├── magic
│ ├── mapping
│ ├── ppc64
│ │ ├── initrd.img
│ │ ├── vmlinuz
│ │ └── yaboot.conf
│ └── TRANS.TBL
├── ......
├── .discinfo
├── .treeinfo
└── TRANS.TBL
内容相同,配置启劢镜像
IBM Installation Tookit安装介质
可订制化的自劢安装脚本
光盘封装时使用
© 2013 IBM Corporation
从光驱安装SLES11SP2
11 IBM Confidential
1 2
3
4
5
选择语言接收许可
跳过介质检查
采用安装模式
选择时区
接收或调整软件和分区信息
© 2013 IBM Corporation
从光驱安装SLES11SP2(续)
12 IBM Confidential
6
7
7.1
7.2
7.3
8
9
10
11
接收软件许可
确认安装
开始安装
安装完成后自劢第一次重启
第一次重启后进入配置阶段
配置root用户密码
强制使用弱安全密码
强制使用弱安全密码
配置主机名
© 2013 IBM Corporation
从光驱安装SLES11SP2(续)
13 IBM Confidential
12
按Alt-N继续
13
14
15
16
17
18
19
20
接收配置信息
终止联网测试
跳过配置测试
配置身份认证模式
添加普通账号
强制使用弱安全密码
预览发行说明
跳过硬件配置
结束安装进入第二次重启
© 2013 IBM Corporation
定制SLES11SP2实现全自劢安装
14 IBM Confidential
ftp://9.181.159.29/iso/os/sles/11.2/iso/sles11-mod.iso
© 2013 IBM Corporation
配置autoyast.xml文件以进行自劢安装
15 IBM Confidential
profile
install
general
mode
clock
keyboard
mouse
language
software
packages
patterns
partition
firewall
configure
runlevel
users
scripts
pre-scripts
postpartitioning-
scripts
chroot-scripts
post-scripts
init-scripts
© 2013 IBM Corporation
Yaboot启劢文件配置
16 IBM Confidential
./os
├── autoyast.xml
├── ibmtoolkit
├── suseboot
│ ├── initrd64
│ ├── inst64
│ ├── linux64.gz
│ ├── loader
│ ├── os-chooser
│ ├── TRANS.TBL
│ ├── yaboot
│ ├── yaboot.cnf
│ ├── yaboot.ibm
│ └── yaboot.txt
└── ......
message=yaboot.txt
timeout=300
default=install
image[64bit]=inst64
label=install
append="quiet sysrq=1 insmod=sym53c8xx insmod=ipr autoyast=file:///autoyast.xml"
image[64bit]=inst64
label=old
append="quiet sysrq=1 insmod=sym53c8xx insmod=ipr"
image[64bit]=inst64
label=slp
append="quiet sysrq=1 install=slp "
image[64bit]=inst64
label=rescue
append="quiet sysrq=1 rescue=1 "
yaboot.cnf
Welcome to SuSE Linux Enterprise 11!
Type "install" to start the YaST installer on this CD/DVD (autoinstall)
Type "old" to start the YaST installer on this CD/DVD
Type "slp" to start the YaST install via network
Type "rescue" to start the rescue system on this CD/DVD
yaboot.txt
© 2013 IBM Corporation
定制划的SLES11SP2光盘封装
17 IBM Confidential
mkisofs -p 'CD-Team' -publisher 'Novell, Inc.' 
-r -pad -T -U -l -chrp-boot -part --netatalk --macbin 
-A - -hfs-volid - -V SU.001 
-hfs-bless ./os/suseboot 
-o sles11-mod.iso 
./os
./os
├── autoyast.xml
├── ibmtoolkit
├── suseboot
│ ├── initrd64
│ ├── inst64
│ ├── linux64.gz
│ ├── loader
│ ├── os-chooser
│ ├── TRANS.TBL
│ ├── yaboot
│ ├── yaboot.cnf
│ ├── yaboot.ibm
│ └── yaboot.txt
└── ......
https://github.com/yast/yast-cd-creator/blob/master/scripts/y2mkiso
© 2013 IBM Corporation
PowerLinux系统安装
之网络安装
张军利
2014年6月26日
© 2013 IBM Corporation
Linux网络安装流程概览
19 IBM Confidential
待安装服务器
DHCP服务器
TFTP服务器
FTP服务器
请
求IP
地
址
是否来自合法的客户端请求?
返
回
IP
地
址
和
自
丼
程
序
地
址
请
求
自
丼
程
序
注:自丼程序(bootstrap)在PPC上为yaboot文件;在X86上为pxelinux.0。
是
否
同
意
指
定
传
输
块
大
小
?
丌
超
过
32MB
同
意
发
送
自
丼
程
序
执行自丼程序
请
求
传
送
自
丼
程
序
配
置
文
件
发
送
自
丼
程
序
配
置
文
件
读取配置文件
请
求
传
送
内
核
文
件
发
送
内
核
文
件
请
求
传
送
根
文
件
发
送
根
文
件
启劢内核
请
求
自
劢
化
安
装
脚
本
文
件
发
送
自
劢
化
安
装
脚
本
文
件
请
求
系
统
安
装
源
发
送
安
装
文
件
自劢安装
阶段1 阶段2 阶段3
© 2013 IBM Corporation
通过网络全自劢安装RHEL6u4
20 IBM Confidential
选择启劢项
选择启劢设备
列出所有可启劢设备
选择网卡启劢
查看网卡信息
设定网卡作为启劢项
退出SMS菜单
从TFTP服务器下载yaboot
从TFTP服务器下载yaboot配置
文件
1
2
3
4
5
6
7
8
9
© 2013 IBM Corporation
通过网络全自劢安装RHEL6u4(续)
21 IBM Confidential
从TFTP服务器下载vmlinuz内核
从TFTP服务器下载initrd.img根
加载自劢安装脚本至内核
软件自劢安装界面
系统后处理自劢执行部分
安装完成之后等待重启
进入启劢项
选择启劢设备
选择从硬盘启劢
10
11
12
13
14
15
16
17
18
© 2013 IBM Corporation
配置部署服务器实现RHEL6u4自劢安装
22 IBM Confidential
RHEL
├── etc
│ └── 01-6c-ae-8b-01-3c-40 <- Default is: yaboot.conf
├── initrd.img -> ./media/ppc/ppc64/initrd.img
├── ks.d
│ └── cn01-ks.cfg
├── log
├── media
├── vmlinuz -> ./media/ppc/ppc64/vmlinuz
└── yaboot
timeout=3
image=vmlinuz
label=diag
initrd=initrd.img
append="mpath vnc=1 vncpassword=passwd4VNC
ip=192.168.2.137 netmask=255.255.255.0
ksdevice=eth0
ks=ftp://192.168.2.253/RHEL/PPC/6.4/ks.d/cn01-
ks.cfg devfs=nomount ramdisk_size=10240 nofb "
allow bootp;
allow booting;
ddns-update-style none;
ignore client-updates;
#Subnet Defination
subnet 192.168.2.0 netmask 255.255.255.0 {
#Common settings
default-lease-time 14400;
max-lease-time 86400;
option domain-name "cluster";
option time-offset -18000;
next-server 192.168.2.253;
filename "yaboot";
range dynamic-bootp 192.168.2.1 192.168.2.250;
host cn01{
server-name "cn01";
hardware ethernet 6c:ae:8b:01:3c:40;
fixed-address 192.168.2.11;
}
}
/etc/dhcpd.conf
service tftp
{
disable = no
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot/RHEL/PPC/6.4
per_source = 11
cps = 100 2
flags = IPv4
}
/etc/xinetd.d/tftp
DHCPDARGS="-cf /etc/dhcpd.conf eth0“
/etc/sysconfig/dhcpd
anonymous_enable=Yes
anon_umask=022
anon_root=/tftpboot
local_enable=YES
write_enable=YES
local_umask=022
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
idle_session_timeout=600
data_connection_timeout=120
ftpd_banner=Welcome to blah FTP
service.
listen=YES
pam_service_name=vsftpd
userlist_enable=NO
tcp_wrappers=YES
/etc/vsftpd/vsftpd.conf
© 2013 IBM Corporation
通过网络全自劢安装SLES11SP2
23 IBM Confidential
选择启劢项
选择启劢设备
列出所有可启劢设备
选择网卡启劢
查看网卡信息
设定网卡作为启劢项
退出SMS菜单1
2
3
4
5
6
7
从TFTP服务器下载yaboot
从TFTP服务器下载yaboot配置
文件
8
9
© 2013 IBM Corporation
通过网络全自劢安装SLES11SP2(续)
24 IBM Confidential
进入自劢安装模式
下载内核和根打包镜像
加载自劢安装脚本至内核
软件自劢安装界面
安装启劢项并进入第一次重启
自劢逃过SMS进入第二次启劢
自劢配置系统10
11
12
13
14
15
16
进入系统
17
© 2013 IBM Corporation
配置部署服务器实现SLESSP2自劢安装
25 IBM Confidential
SLES
├── autoyast.d
│ └── cn01-autoyast.xml
├── inst64 -> media/suseboot/inst64
├── log
├── media
├── yaboot
└── yaboot.conf-6c-ae-8b-01-3c-40 <- Default is: yaboot.conf
timeout=3
image=inst64
label=autoyast
append="vnc=1 vncpassword=passwd4VNC hostip=192.168.2.137
netmask=255.255.255.0
autoyast=ftp://192.168.2.253/SLES/PPC/11.2/autoyast.d/cn01-autoyast.xml
install=ftp://192.168.2.253/SLES/PPC/11.2/media netdevice=eth0
dhcptimeout=150 "
allow bootp;
allow booting;
ddns-update-style none;
ignore client-updates;
#Subnet Defination
subnet 192.168.2.0 netmask 255.255.255.0 {
#Common settings
default-lease-time 14400;
max-lease-time 86400;
option domain-name "cluster";
option time-offset -18000;
next-server 192.168.2.253;
filename "yaboot";
range dynamic-bootp 192.168.2.1 192.168.2.250;
host cn01{
server-name "cn01";
hardware ethernet 6c:ae:8b:01:3c:40;
fixed-address 192.168.2.11;
}
}
/etc/dhcpd.conf
service tftp
{
disable = no
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot/SLES/PPC/11.2
per_source = 11
cps = 100 2
flags = IPv4
}
/etc/xinetd.d/tftp
DHCPDARGS="-cf /etc/dhcpd.conf eth0“
/etc/sysconfig/dhcpd
anonymous_enable=Yes
anon_umask=022
anon_root=/tftpboot
local_enable=YES
write_enable=YES
local_umask=022
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
idle_session_timeout=600
data_connection_timeout=120
ftpd_banner=Welcome to blah FTP
service.
listen=YES
pam_service_name=vsftpd
userlist_enable=NO
tcp_wrappers=YES
/etc/vsftpd/vsftpd.conf
© 2013 IBM Corporation
采用NIM网络安装Linux
张军利
2014年6月26日
© 2013 IBM Corporation
网络地址示例配置
27 IBM Confidential
NIM服务器
客户端
FTP服务器
RHEL# IPL In SMS-> ip: 172.16.14.201/24, gw: 172.16.14.1, server: 172.16.15.188
SLES# IPL In SMS-> ip: 172.16.14.202/24, gw: 172.16.14.1, server: 172.16.15.188
ip: 172.16.15.29/24, gw: 172.16.15.1
ip: 172.16.15.188/24, gw: 172.16.15.1
© 2013 IBM Corporation
NIM上的配置
28 IBM Confidential
/tftpboot/
|-- ...
|-- rhel
| |-- rhel6u4_initrd.img
| `-- rhel6u4_vmlinuz
|-- sles11u2_inst64
|-- yaboot.conf
|-- yaboot.rhel
`-- yaboot.sles
/etc/
|-- ...
|-- bootptab
|-- tftpaccess.ctl
`-- yaboot.conf
NIM Server
timeout=600
default=sles11.2_autoinstall
image[64bit]=sles11u2_inst64
label=sles11.2_autoinstall
append="quiet sysrq=1 insmod=sym53c8xx insmod=ipr insmod=ibmveth hostip=172.16.14.202
netmask=255.255.255.0 gateway=172.16.14.1
autoyast=ftp://172.16.15.29/os/sles/11.2/autoyast.xml
install=ftp://172.16.15.29/os/sles/11.2/os netdevice=eth0 dhcptimeout=150"
timeout=600
default=rhel6.4_Autoinstall
image=rhel/rhel6u4_vmlinuz
label=rhel6.4_Autoinstall
initrd=rhel/rhel6u4_initrd.img
append="mpath devfs=nomount ramdisk_size=10240 nofb ip=172.16.14.201
netmask=255.255.255.0 gateway=172.16.14.1 ksdevice=eth0
ks=ftp://172.16.15.29/os/rhel/6.4/ks.cfg"
read-only
rhel:bf=/tftpboot/yaboot.rhel:ip=172.16.14.201:ht=ethernet:sa=172.16.15.188:gw=172.16.14.1:sm=255.255.255.0:
sles:bf=/tftpboot/yaboot.sles:ip=172.16.14.202:ht=ethernet:sa=172.16.15.188:gw=172.16.14.1:sm=255.255.255.0:
# NIM access for network boot
allow:/tftpboot
© 2013 IBM Corporation
FTP服务器配置
29 IBM Confidential
lftp 172.16.15.29:/os/rhel/6.4> ls
drwxr-xr-x 2 527 501 4096 Sep 27 08:22 iso
-r-xr-xr-x 1 0 0 3729 Nov 02 13:06 ks.cfg
dr-xr-xr-x 9 0 0 8192 Jul 16 04:15 os
lftp 172.16.15.29:/os/sles/11.2> ls
-r--r--r-- 1 0 0 6009 Nov 04 03:08 autoyast.xml
drwxr-xr-x 2 527 501 4096 Jul 18 13:31 iso
dr-xr-xr-x 9 0 0 6144 Jul 18 13:24 os
FTP Server SUSE安装光盘介质
Redhat安装光盘介质
Redhat自动安装脚本 SUSE自动安装脚本
© 2013 IBM Corporation
采用LVM兊隆系统
张军利
2014年6月26日
© 2013 IBM Corporation
常见的系统兊隆方式
31 IBM Confidential
磁盘对拷模式
MBR
The original partitioning scheme for PC hard disks allowed only four partitions. This quickly turned out to be too little in real life, partly
because some people want more than four operating systems (Linux, MS-DOS, OS/2, Minix, FreeBSD, NetBSD, or Windows/NT, to name a
few), but primarily because sometimes it is a good idea to have several partitions for one operating system. For example, swap space is
usually best put in its own partition for Linux instead of in the main Linux partition for reasons of speed (see below).
To overcome this design problem, extended partitions were invented. This trick allows partitioning a primary partition into sub-partitions. The
primary partition thus subdivided is the extended partition; the sub-partitions are logical partitions. They behave like primary partitions, but
are created differently. There is no speed difference between them. By using an extended partition you can now have up to 15 partitions per
disk.
The partition structure of a hard disk might look like that in Figure on left. The disk is divided into three primary partitions, the second of which
is divided into two logical partitions. Part of the disk is not partitioned at all. The disk as a whole and each primary partition has a boot sector.
分卷压缩备份和恢复模式
© 2013 IBM Corporation
PowerLinux系统磁盘布局
32 IBM Confidential
MBR
PrePBoot
Boot
LVM
root
swap
该分区仅在启动时为固件所读取,其上保存一个静态
连接的内核 bootloader,故在系统启动后无需挂载。
该分区存有Linux内核和一些内核信息,启动时
不为固件所读取。
Linux正式
开始启动。
在找到一块可启动磁盘
后,固件会在该磁盘上
寻找一个磁盘类型为41
的PRePBoot分区,从该
分区中读取出bootloder
并执行。bootloder接下
来会启动Linux。
固件(类似于PC上的
BIOS)先寻找可启动设
备,通常为软盘、光盘、
硬盘或网络等设备。
PowerLinux启动流程
© 2013 IBM Corporation
以光盘启劢进入维护模式
33 IBM Confidential
1
2
3
4
5
6
© 2013 IBM Corporation
调整根卷的大小
34 IBM Confidential
sh-4.1# pvs
PV VG Fmt Attr PSize PFree
/dev/sda3 VolGroup lvm2 a-- 14.50g 0
sh-4.1# lvs -o +devices
LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert Devices
lv_root VolGroup -wi------ 6.57g /dev/sda3(0)
lv_swap VolGroup -wi------ 7.94g /dev/sda3(1681)
sh-4.1# lvchange -ay VolGroup/lv_root
sh-4.1# mkdir -p /media/rootvg
sh-4.1# mount /dev/VolGroup/lv_root /media/rootvg
sh-4.1# rootvgsm=$[ `df --block-size=1m /media/rootvg|grep /media/rootvg|awk '{print $2}'` + 512 ]
sh-4.1# umount /media/rootvg
sh-4.1#
sh-4.1#
sh-4.1# lvs
LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert
lv_root VolGroup -wi-a---- 3.11g
lv_swap VolGroup -wi------ 1.00g
一般情况下,根卷的大小往往超出其上存储内容总容量。如果丌减小根卷大小,那么在系统备份时将会浪费丌大量丌必要的时
间。这里采取的先将根卷调整至其实际容量+512M以便进行后续操作。
root swap
root swap free
© 2013 IBM Corporation
建立镜像存储池
35 IBM Confidential
sh-4.1# pvs
PV VG Fmt Attr PSize PFree
/dev/sda3 VolGroup lvm2 a-- 14.50g 10.39g
sh-4.1#
Logical volume "lv_clone" created
sh-4.1# pvs
PV VG Fmt Attr PSize PFree
/dev/sda3 VolGroup lvm2 a-- 14.50g 404.00m
sh-4.1# mkfs.ext4 /dev/VolGroup/lv_clone
sh-4.1# mkdir -p /media/clone
sh-4.1#
这里简单起见,采用本地盘独立分出一部分空间以便存储镜像文件。实际过程中可以将镜像存储在其他盘或者是网络服务器上。
root swap freeclone
© 2013 IBM Corporation
备份分区表、MBR、PrepBoot和boot分区
36 IBM Confidential
sh-4.1# cd /media/clone
sh-4.1# fdisk -l /dev/sda
Disk /dev/sda: 16.1 GB, 16106127360 bytes
64 heads, 32 sectors/track, 15360 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xe8010200
Device Boot Start End Blocks Id System
/dev/sda1 * 2 5 4096 41 PPC PReP Boot
Partition 1 does not end on cylinder boundary.
/dev/sda2 6 505 512000 83 Linux
Partition 2 does not end on cylinder boundary.
/dev/sda3 506 15360 15211520 8e Linux LVM
Partition 3 does not end on cylinder boundary.
sh-4.1#
sh-4.1#
sh-4.1#
sh-4.1# root swap freeclone
boot
prepboot
mbr
1
2
3
4
1
2
3
4
© 2013 IBM Corporation
备份根卷之创建备份卷介质
37 IBM Confidential
sh-4.1# mount /dev/VolGroup/lv_root /media/rootvg
sh-4.1# rootvgsm=$[ `df --block-size=1m /media/rootvg|grep /media/rootvg|awk '{print $2}'` + 1024 ]
sh-4.1# umount /media/rootvg/
sh-4.1#
sh-4.1# mknod /dev/loop8 b 7 8
sh-4.1# chmod 660 /dev/loop8
sh-4.1#
sh-4.1#
sh-4.1# pvs
PV VG Fmt Attr PSize PFree
/dev/loop8 VolGroup lvm2 a-- 3.60g 3.60g
/dev/sda3 VolGroup lvm2 a-- 14.50g 404.00m
由于采用LVM进行备份,而LVM丌能支持普通文件作为设备文件。因此,本例采用将普通文件映射为回环设备方式来实现对
LVM备份的支持。
root swap freeclone
© 2013 IBM Corporation
备份根卷之映像根卷
38 IBM Confidential
sh-4.1# lvs
LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert
lv_clone VolGroup -wi-ao--- 10.00g
lv_root VolGroup -wi-a---- 3.11g
lv_swap VolGroup -wi------ 1.00g
sh-4.1#
FATAL: Module dm_log_userspace not found.
/sbin/modprobe failed: 1
/sbin/dmeventd: stat failed: No such file or directory
/sbin/dmeventd: stat failed: No such file or directory
VolGroup-lv_root: event registration failed: No such process
VolGroup/lv_root: mirror segment monitoring function failed.
VolGroup/lv_root: Converted: 0.0%
... ...
VolGroup/lv_root: Converted: 100.0%
sh-4.1# sync
sh-4.1# lvs
LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync
Convert
lv_clone VolGroup -wi-ao--- 10.00g
lv_root VolGroup mwi-a-m-- 3.11g lv_root_mlog 100.00
lv_swap VolGroup -wi------ 1.00g
root swap freeclone
© 2013 IBM Corporation
备份根卷之拆解根卷映像
39 IBM Confidential
sh-4.1#
FATAL: Module dm_log_userspace not found.
/sbin/modprobe failed: 1
/sbin/dmeventd: stat failed: No such file or directory
Logical volume lv_root converted.
sh-4.1# lvs --segments -o +devices
LV VG Attr #Str Type SSize Devices
lv_clone VolGroup -wi-ao--- 1 linear 6.94g /dev/sda3(1937)
lv_clone VolGroup -wi-ao--- 1 linear 3.06g /dev/sda3(796)
lv_root VolGroup -wi-a---- 1 linear 3.11g /dev/sda3(0)
lv_root_n VolGroup -wi-a---- 1 linear 3.11g /dev/loop8(0)
lv_swap VolGroup -wi------ 1 linear 1.00g /dev/sda3(1681)
sh-4.1# lvchange -an VolGroup/lv_root_n
root swap freeclone
© 2013 IBM Corporation
备份根卷之剥离映像设备卷
40 IBM Confidential
sh-4.1#
sh-4.1# lvs --segments -o +devices
LV VG Attr #Str Type SSize Devices
lv_clone VolGroup -wi-ao--- 1 linear 6.94g /dev/sda3(1937)
lv_clone VolGroup -wi-ao--- 1 linear 3.06g /dev/sda3(796)
lv_root VolGroup -wi-a---- 1 linear 3.11g /dev/sda3(0)
lv_swap VolGroup -wi------ 1 linear 1.00g /dev/sda3(1681)
lv_root_n VolGroup_n -wi------ 1 linear 3.11g /dev/loop8(0)
sh-4.1# pvs
PV VG Fmt Attr PSize PFree
/dev/loop8 VolGroup_n lvm2 a-- 3.60g 500.00m
/dev/sda3 VolGroup lvm2 a-- 14.50g 404.00m
sh-4.1# lvcreate -L 256M -n lv_swap VolGroup_n
sh-4.1# lvchange -an VolGroup_n/lv_swap
sh-4.1# lvs -o +devices
LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert Devices
lv_clone VolGroup -wi-ao--- 10.00g /dev/sda3(1937)
lv_clone VolGroup -wi-ao--- 10.00g /dev/sda3(796)
lv_root VolGroup -wi-a---- 3.11g /dev/sda3(0)
lv_swap VolGroup -wi------ 1.00g /dev/sda3(1681)
lv_root_n VolGroup_n -wi------ 3.11g /dev/loop8(0)
lv_swap VolGroup_n -wi------ 256.00m /dev/loop8(796)
root swap freeclone
root swap freeclone
© 2013 IBM Corporation
备份根卷之导出映像卷
41 IBM Confidential
sh-4.1# lvchange -ay VolGroup_n/lv_root_n
sh-4.1# mount /dev/VolGroup_n/lv_root_n /media/rootvg/
sh-4.1# sed -i -e 's:VolGroup:VolGroup_n:g' -e 's:lv_root:lv_root_n:g' /media/rootvg/etc/fstab
sh-4.1# umount /media/rootvg/
sh-4.1# lvchange -an VolGroup_n/lv_root_n
sh-4.1#
sh-4.1# pvs
PV VG Fmt Attr PSize PFree
/dev/loop8 VolGroup_n lvm2 ax- 3.60g 244.00m
/dev/sda3 VolGroup lvm2 a-- 14.50g 404.00m
sh-4.1#
sh-4.1# rm /dev/loop8
sh-4.1# pvs
PV VG Fmt Attr PSize PFree
/dev/sda3 VolGroup lvm2 a-- 14.50g 404.00m
sh-4.1# mkdir -p /media/boot
sh-4.1# mount ./boot.img /media/boot/ -o loop
sh-4.1# sed -i -e 's:VolGroup:VolGroup_n:g' -e 's:lv_root:lv_root_n:g' /media/boot/etc/yaboot.conf
sh-4.1# umount /media/boot/
sh-4.1# ls -lh
total 4.1G
-rw-r--r--. 1 root root 500M 2013-10-16 08:19 boot.img
-rw-r--r--. 1 root root 259 2013-10-16 07:44 diskp.log
drwx------. 2 root root 16K 2013-10-16 07:43 lost+found
-rw-r--r--. 1 root root 512 2013-10-16 07:44 mbr.img
-rw-r--r--. 1 root root 4.0M 2013-10-16 07:44 prepboot.img
-rw-r--r--. 1 root root 3.7G 2013-10-16 08:16 rootvg.img
root swap freeclone
root swap freeclone
© 2013 IBM Corporation
系统恢复之定位恢复可用介质
42 IBM Confidential
sh-4.1# fdisk -l
Disk /dev/sda: 16.1 GB, 16106127360 bytes
64 heads, 32 sectors/track, 15360 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/sdb: 21.5 GB, 21474836480 bytes
64 heads, 32 sectors/track, 20480 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x787b0e00
Device Boot Start End Blocks Id System
/dev/sdb1 1 8193 8389616 83 Linux
sh-4.1# mkdir -p /media/clone
sh-4.1#
sh-4.1# ls -lh /media/clone/
total 4.1G
-rw-r--r--. 1 root root 500M 2013-10-16 08:19 boot.img
-rw-r--r--. 1 root root 259 2013-10-16 07:44 diskp.log
drwx------. 2 root root 4.0K 2013-10-16 07:43 lost+found
-rw-r--r--. 1 root root 512 2013-10-16 07:44 mbr.img
-rw-r--r--. 1 root root 4.0M 2013-10-16 07:44 prepboot.img
-rw-r--r--. 1 root root 3.7G 2013-10-16 08:16 rootvg.img
diskp.log 1 2 3 4 5
mbr.img
prepboot.img
boot.img
rootvg.img
© 2013 IBM Corporation
系统恢复之恢复分区表
43 IBM Confidential
sh-4.1#
Checking that no-one is using this disk right now ...
OK
Disk /dev/sda: 15360 cylinders, 64 heads, 32 sectors/track
/dev/sda: unrecognized partition table type
Old situation:
No partitions found
New situation:
Units = sectors of 512 bytes, counting from 0
Device Boot Start End #sectors Id System
/dev/sda1 * 2048 10239 8192 41 PPC PReP Boot
/dev/sda2 10240 1034239 1024000 83 Linux
/dev/sda3 1034240 31457279 30423040 8e Linux LVM
/dev/sda4 0 - 0 0 Empty
Successfully wrote the new partition table
Re-reading the partition table ...
If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)
diskp.log 1 2 3 4 5
mbr.img
prepboot.img
boot.img
rootvg.img
sda3sda1 sda2
© 2013 IBM Corporation
系统恢复之恢复MBR、PrePBoot和boot分区
44 IBM Confidential
sh-4.1#
count=1
sh-4.1#
sh-4.1#
sh-4.1# mkdir -p /media/boot
sh-4.1# mount /dev/sda2 /media/boot
sh-4.1# df -h /media/boot/
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 485M 45M 415M 10% /media/boot
sh-4.1# umount /media/boot/
diskp.log 1 2 3 4 5
mbr.img
prepboot.img
boot.img
rootvg.img
sda3sda1 sda2
© 2013 IBM Corporation
系统恢复之导入备份卷
45 IBM Confidential
sh-4.1# mknod /dev/loop8 b 7 8
sh-4.1# chmod 660 /dev/loop8
sh-4.1# pvs
sh-4.1#
sh-4.1# pvs
PV VG Fmt Attr PSize PFree
/dev/loop8 VolGroup_n lvm2 ax- 3.60g 244.00m
sh-4.1#
sh-4.1# lvs
LV VG Attr LSize Pool Origin
Data% Move Log Cpy%Sync Convert
lv_root_n VolGroup_n -wi------ 3.11g
lv_swap VolGroup_n -wi------ 256.00m
diskp.log 1 2 3 4 5
mbr.img
prepboot.img
boot.img
rootvg.img
sda3sda1 sda2
© 2013 IBM Corporation
sh-4.1#
sh-4.1# lvchange -ay VolGroup_n/lv_root_n
sh-4.1# lvs
LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert
lv_root_n VolGroup_n -wi-a---- 3.11g
lv_swap VolGroup_n -wi------ 256.00m
sh-4.1#
FATAL: Module dm_log_userspace not found.
/sbin/modprobe failed: 1
/sbin/dmeventd: stat failed: No such file or directory
/sbin/dmeventd: stat failed: No such file or directory
VolGroup_n-lv_root_n: event registration failed: No such process
VolGroup_n/lv_root_n: mirror segment monitoring function failed.
VolGroup_n/lv_root_n: Converted: 0.0%
... ...
VolGroup_n/lv_root_n: Converted: 100.0%
sh-4.1# lvs -o +devices
LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert Devices
lv_root_n VolGroup_n mwi-a-m-- 3.11g lv_root_n_mlog 100.00
lv_root_n_mimage_0(0),lv_root_n_mimage_1(0)
lv_swap VolGroup_n -wi------ 256.00m /dev/loop8(796)
sh-4.1# sync
系统恢复之镜像备份卷
46 IBM Confidential
diskp.log 1 2 3 4 5
mbr.img
prepboot.img
boot.img
rootvg.img
sda3sda1 sda2
© 2013 IBM Corporation
系统恢复之生成新根卷
47 IBM Confidential
sh-4.1#
FATAL: Module dm_log_userspace not found.
/sbin/modprobe failed: 1
/sbin/dmeventd: stat failed: No such file or directory
Logical volume lv_root_n converted.
sh-4.1# lvs -o +devices
LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert Devices
lv_root VolGroup_n -wi-a---- 3.11g /dev/sda3(0)
lv_root_n VolGroup_n -wi-a---- 3.11g /dev/loop8(0)
lv_swap VolGroup_n -wi------ 256.00m /dev/loop8(796)
sh-4.1# lvchange -an VolGroup_n/lv_root
sh-4.1#
Checking for new volume group "VolGroup"
Checking for volume group "VolGroup_n"
Archiving volume group "VolGroup_n" metadata (seqno 10).
Writing out updated volume groups
Archiving volume group "VolGroup" metadata (seqno 0).
Creating volume group backup "/etc/lvm/backup/VolGroup" (seqno 1).
Creating volume group backup "/etc/lvm/backup/VolGroup_n" (seqno 11).
Creating volume group backup "/etc/lvm/backup/VolGroup" (seqno 2).
New volume group "VolGroup" successfully split from "VolGroup_n"
sh-4.1# lvs -o +devices
LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert Devices
lv_root VolGroup -wi------ 3.11g /dev/sda3(0)
lv_root_n VolGroup_n -wi-a---- 3.11g /dev/loop8(0)
lv_swap VolGroup_n -wi------ 256.00m /dev/loop8(796)
root backuproot mirror
© 2013 IBM Corporation
系统恢复之卸载恢复卷
48 IBM Confidential
sh-4.1# lvchange -an VolGroup_n/lv_root_n
sh-4.1#
sh-4.1# pvs
PV VG Fmt Attr PSize PFree
/dev/loop8 VolGroup_n lvm2 ax- 3.60g 244.00m
/dev/sda3 VolGroup lvm2 a-- 14.50g 11.39g
sh-4.1#
sh-4.1# rm /dev/loop8
sh-4.1# pvs
PV VG Fmt Attr PSize PFree
/dev/sda3 VolGroup lvm2 a-- 14.50g 11.39g
sh-4.1# lvs
LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert
lv_root VolGroup -wi------ 3.11g
root mirror
root backuproot mirror
© 2013 IBM Corporation
系统恢复之新根卷微调
49 IBM Confidential
sh-4.1# pvs
PV VG Fmt Attr PSize PFree
/dev/sda3 VolGroup lvm2 a-- 14.50g 11.39g
sh-4.1# lvs
LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert
lv_root VolGroup -wi------ 3.11g
sh-4.1# pvs
PV VG Fmt Attr PSize PFree
/dev/sda3 VolGroup lvm2 a-- 14.50g 11.39g
sh-4.1# lvchange -ay VolGroup/lv_root
sh-4.1#
sh-4.1#
Logical volume "lv_swap" created
sh-4.1# lvs
LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert
lv_root VolGroup -wi-a---- 6.11g
lv_swap VolGroup -wi-a---- 1.00g
sh-4.1# mkdir -p /media/rootvg
sh-4.1# mount /dev/VolGroup/lv_root /media/rootvg/
sh-4.1# df -h /media/rootvg
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
6.1G 2.7G 3.1G 46% /media/rootvg
sh-4.1#
sh-4.1# mount /dev/sda2 /media/boot/
sh-4.1#
sh-4.1# reboot
sda3sda1 sda2 root mirror
© 2013 IBM Corporation50 IBM Confidential

More Related Content

What's hot

Build Your Own Android Tablet
Build Your Own Android TabletBuild Your Own Android Tablet
Build Your Own Android TabletSGAndroidDevs
 
RunX: deploy real-time OSes as containers at the edge
RunX: deploy real-time OSes as containers at the edgeRunX: deploy real-time OSes as containers at the edge
RunX: deploy real-time OSes as containers at the edgeStefano Stabellini
 
Qemu x86 BIOS @ https://youtu.be/F71LGSrj9cc
Qemu x86 BIOS @ https://youtu.be/F71LGSrj9ccQemu x86 BIOS @ https://youtu.be/F71LGSrj9cc
Qemu x86 BIOS @ https://youtu.be/F71LGSrj9ccSanjay Adhikari
 
Hardware assisted virtualization in AV software (ZeroNights 2014)
Hardware assisted virtualization in AV software (ZeroNights 2014)Hardware assisted virtualization in AV software (ZeroNights 2014)
Hardware assisted virtualization in AV software (ZeroNights 2014)Python0x0
 
MQTTS mosquitto - cheat sheet -
MQTTS mosquitto - cheat sheet -MQTTS mosquitto - cheat sheet -
MQTTS mosquitto - cheat sheet -Naoto MATSUMOTO
 
82599 sriov vm configuration notes
82599 sriov vm configuration notes82599 sriov vm configuration notes
82599 sriov vm configuration notesRyan Aydelott
 
Installation of DAHDI, libpri and Asterisk
Installation of DAHDI, libpri and Asterisk Installation of DAHDI, libpri and Asterisk
Installation of DAHDI, libpri and Asterisk CaudalFin Technologies
 
Feature rich BTRFS is Getting Richer with Encryption
Feature rich BTRFS is Getting Richer with EncryptionFeature rich BTRFS is Getting Richer with Encryption
Feature rich BTRFS is Getting Richer with EncryptionLF Events
 
SR-IOV+KVM on Debian/Stable
SR-IOV+KVM on Debian/StableSR-IOV+KVM on Debian/Stable
SR-IOV+KVM on Debian/Stablejuet-y
 
Kernel Recipes 2013 - Crosstool-NG, a cross-toolchain generator
Kernel Recipes 2013 - Crosstool-NG, a cross-toolchain generatorKernel Recipes 2013 - Crosstool-NG, a cross-toolchain generator
Kernel Recipes 2013 - Crosstool-NG, a cross-toolchain generatorAnne Nicolas
 
How to ride a 100GbE LAN -MEMO-
How to ride a 100GbE LAN -MEMO-How to ride a 100GbE LAN -MEMO-
How to ride a 100GbE LAN -MEMO-Naoto MATSUMOTO
 
Router Virtualization With GNS3
Router Virtualization With GNS3Router Virtualization With GNS3
Router Virtualization With GNS3mrmouse
 
Development platform virtualization using qemu
Development platform virtualization using qemuDevelopment platform virtualization using qemu
Development platform virtualization using qemuPremjith Achemveettil
 
Optical Disc Archive Install memo
Optical Disc Archive Install memoOptical Disc Archive Install memo
Optical Disc Archive Install memoNaoto MATSUMOTO
 

What's hot (20)

unix-rosetta
unix-rosettaunix-rosetta
unix-rosetta
 
Beagleboard xm-setup
Beagleboard xm-setupBeagleboard xm-setup
Beagleboard xm-setup
 
Build Your Own Android Tablet
Build Your Own Android TabletBuild Your Own Android Tablet
Build Your Own Android Tablet
 
RunX: deploy real-time OSes as containers at the edge
RunX: deploy real-time OSes as containers at the edgeRunX: deploy real-time OSes as containers at the edge
RunX: deploy real-time OSes as containers at the edge
 
Qemu x86 BIOS @ https://youtu.be/F71LGSrj9cc
Qemu x86 BIOS @ https://youtu.be/F71LGSrj9ccQemu x86 BIOS @ https://youtu.be/F71LGSrj9cc
Qemu x86 BIOS @ https://youtu.be/F71LGSrj9cc
 
RunX ELCE 2020
RunX ELCE 2020RunX ELCE 2020
RunX ELCE 2020
 
Hardware assisted virtualization in AV software (ZeroNights 2014)
Hardware assisted virtualization in AV software (ZeroNights 2014)Hardware assisted virtualization in AV software (ZeroNights 2014)
Hardware assisted virtualization in AV software (ZeroNights 2014)
 
MQTTS mosquitto - cheat sheet -
MQTTS mosquitto - cheat sheet -MQTTS mosquitto - cheat sheet -
MQTTS mosquitto - cheat sheet -
 
82599 sriov vm configuration notes
82599 sriov vm configuration notes82599 sriov vm configuration notes
82599 sriov vm configuration notes
 
Installation of DAHDI, libpri and Asterisk
Installation of DAHDI, libpri and Asterisk Installation of DAHDI, libpri and Asterisk
Installation of DAHDI, libpri and Asterisk
 
Feature rich BTRFS is Getting Richer with Encryption
Feature rich BTRFS is Getting Richer with EncryptionFeature rich BTRFS is Getting Richer with Encryption
Feature rich BTRFS is Getting Richer with Encryption
 
Qemu
QemuQemu
Qemu
 
M61 pmv
M61 pmvM61 pmv
M61 pmv
 
My First BCC
My First BCCMy First BCC
My First BCC
 
SR-IOV+KVM on Debian/Stable
SR-IOV+KVM on Debian/StableSR-IOV+KVM on Debian/Stable
SR-IOV+KVM on Debian/Stable
 
Kernel Recipes 2013 - Crosstool-NG, a cross-toolchain generator
Kernel Recipes 2013 - Crosstool-NG, a cross-toolchain generatorKernel Recipes 2013 - Crosstool-NG, a cross-toolchain generator
Kernel Recipes 2013 - Crosstool-NG, a cross-toolchain generator
 
How to ride a 100GbE LAN -MEMO-
How to ride a 100GbE LAN -MEMO-How to ride a 100GbE LAN -MEMO-
How to ride a 100GbE LAN -MEMO-
 
Router Virtualization With GNS3
Router Virtualization With GNS3Router Virtualization With GNS3
Router Virtualization With GNS3
 
Development platform virtualization using qemu
Development platform virtualization using qemuDevelopment platform virtualization using qemu
Development platform virtualization using qemu
 
Optical Disc Archive Install memo
Optical Disc Archive Install memoOptical Disc Archive Install memo
Optical Disc Archive Install memo
 

Viewers also liked

Беспризорность и безназдорность
Беспризорность и безназдорностьБеспризорность и безназдорность
Беспризорность и безназдорностьTitenko1
 
Активный гражданин
Активный гражданинАктивный гражданин
Активный гражданинTitenko1
 
прадедушка саши горякова 24 04_2016
прадедушка саши горякова 24 04_2016прадедушка саши горякова 24 04_2016
прадедушка саши горякова 24 04_2016Titenko1
 
караяни
караяникараяни
караяниTitenko1
 
NH Granite State Ambassadors Yearbook 2015-16
NH Granite State Ambassadors Yearbook 2015-16NH Granite State Ambassadors Yearbook 2015-16
NH Granite State Ambassadors Yearbook 2015-16GraniteStateAmbassadors
 
Презентация
ПрезентацияПрезентация
ПрезентацияTitenko1
 
Domestic violence 2014
Domestic violence 2014Domestic violence 2014
Domestic violence 2014Mdunnam
 
Bloodborne pathogens 2014
Bloodborne pathogens 2014Bloodborne pathogens 2014
Bloodborne pathogens 2014Mdunnam
 
Visions on the Future of Crowdfunding in Europe
Visions on the Future of Crowdfunding in EuropeVisions on the Future of Crowdfunding in Europe
Visions on the Future of Crowdfunding in EuropeFabien Risterucci
 
Bloodborne pathogens 2014
Bloodborne pathogens 2014Bloodborne pathogens 2014
Bloodborne pathogens 2014Mdunnam
 
Presetasi hotspot Mubad Zahroni
Presetasi hotspot Mubad ZahroniPresetasi hotspot Mubad Zahroni
Presetasi hotspot Mubad Zahroniindonesiku
 
Отчет о субботнике на сайт
Отчет о субботнике на сайтОтчет о субботнике на сайт
Отчет о субботнике на сайтTitenko1
 
педсовет 17.11.15
педсовет 17.11.15педсовет 17.11.15
педсовет 17.11.15Titenko1
 

Viewers also liked (20)

Kvm简介
Kvm简介Kvm简介
Kvm简介
 
Беспризорность и безназдорность
Беспризорность и безназдорностьБеспризорность и безназдорность
Беспризорность и безназдорность
 
Активный гражданин
Активный гражданинАктивный гражданин
Активный гражданин
 
Bahan bahan
Bahan bahanBahan bahan
Bahan bahan
 
Nест
NестNест
Nест
 
Radios
RadiosRadios
Radios
 
прадедушка саши горякова 24 04_2016
прадедушка саши горякова 24 04_2016прадедушка саши горякова 24 04_2016
прадедушка саши горякова 24 04_2016
 
караяни
караяникараяни
караяни
 
NH Granite State Ambassadors Yearbook 2015-16
NH Granite State Ambassadors Yearbook 2015-16NH Granite State Ambassadors Yearbook 2015-16
NH Granite State Ambassadors Yearbook 2015-16
 
Презентация
ПрезентацияПрезентация
Презентация
 
IT IN BUSINESS
IT IN BUSINESSIT IN BUSINESS
IT IN BUSINESS
 
Ramanan smart
Ramanan   smartRamanan   smart
Ramanan smart
 
Domestic violence 2014
Domestic violence 2014Domestic violence 2014
Domestic violence 2014
 
Bloodborne pathogens 2014
Bloodborne pathogens 2014Bloodborne pathogens 2014
Bloodborne pathogens 2014
 
Visions on the Future of Crowdfunding in Europe
Visions on the Future of Crowdfunding in EuropeVisions on the Future of Crowdfunding in Europe
Visions on the Future of Crowdfunding in Europe
 
NHGSA Yearbook 2014
NHGSA Yearbook 2014NHGSA Yearbook 2014
NHGSA Yearbook 2014
 
Bloodborne pathogens 2014
Bloodborne pathogens 2014Bloodborne pathogens 2014
Bloodborne pathogens 2014
 
Presetasi hotspot Mubad Zahroni
Presetasi hotspot Mubad ZahroniPresetasi hotspot Mubad Zahroni
Presetasi hotspot Mubad Zahroni
 
Отчет о субботнике на сайт
Отчет о субботнике на сайтОтчет о субботнике на сайт
Отчет о субботнике на сайт
 
педсовет 17.11.15
педсовет 17.11.15педсовет 17.11.15
педсовет 17.11.15
 

Similar to Install power linux through cdrom and network redhat and suse

NetBSD on Google Compute Engine (en)
NetBSD on Google Compute Engine (en)NetBSD on Google Compute Engine (en)
NetBSD on Google Compute Engine (en)Ryo ONODERA
 
Virtual box installation
Virtual box installationVirtual box installation
Virtual box installationNiranjan Pandey
 
3. configuring a compute node for nfv
3. configuring a compute node for nfv3. configuring a compute node for nfv
3. configuring a compute node for nfvvideos
 
Aix5[1].3+hacmp+oracle9 i+weblogic8.1安装实施报告
Aix5[1].3+hacmp+oracle9 i+weblogic8.1安装实施报告Aix5[1].3+hacmp+oracle9 i+weblogic8.1安装实施报告
Aix5[1].3+hacmp+oracle9 i+weblogic8.1安装实施报告fm2008
 
Upgrade Ubuntu 18.04 Security with Secureboot
Upgrade Ubuntu 18.04 Security with SecurebootUpgrade Ubuntu 18.04 Security with Secureboot
Upgrade Ubuntu 18.04 Security with SecurebootJonathan MICHEL-VILLAZ
 
Containers with systemd-nspawn
Containers with systemd-nspawnContainers with systemd-nspawn
Containers with systemd-nspawnGábor Nyers
 
101 1.1 hardware settings v2
101 1.1 hardware settings v2101 1.1 hardware settings v2
101 1.1 hardware settings v2Acácio Oliveira
 
Krenel Based Virtual Machine In Centos7
Krenel Based Virtual Machine In Centos7Krenel Based Virtual Machine In Centos7
Krenel Based Virtual Machine In Centos7a_ratra
 
Qemu - Raspberry | while42 Singapore #2
Qemu - Raspberry | while42 Singapore #2Qemu - Raspberry | while42 Singapore #2
Qemu - Raspberry | while42 Singapore #2While42
 
Armboot process zeelogic
Armboot process zeelogicArmboot process zeelogic
Armboot process zeelogicAleem Shariff
 
101 2.2 install boot manager
101 2.2 install boot manager101 2.2 install boot manager
101 2.2 install boot managerAcácio Oliveira
 

Similar to Install power linux through cdrom and network redhat and suse (20)

101 1.2 boot the system
101 1.2 boot the system101 1.2 boot the system
101 1.2 boot the system
 
NetBSD on Google Compute Engine (en)
NetBSD on Google Compute Engine (en)NetBSD on Google Compute Engine (en)
NetBSD on Google Compute Engine (en)
 
1.2 boot the system v2
1.2 boot the system v21.2 boot the system v2
1.2 boot the system v2
 
Virtual box installation
Virtual box installationVirtual box installation
Virtual box installation
 
3. configuring a compute node for nfv
3. configuring a compute node for nfv3. configuring a compute node for nfv
3. configuring a compute node for nfv
 
Aix5[1].3+hacmp+oracle9 i+weblogic8.1安装实施报告
Aix5[1].3+hacmp+oracle9 i+weblogic8.1安装实施报告Aix5[1].3+hacmp+oracle9 i+weblogic8.1安装实施报告
Aix5[1].3+hacmp+oracle9 i+weblogic8.1安装实施报告
 
5. boot process
5. boot process5. boot process
5. boot process
 
Upgrade Ubuntu 18.04 Security with Secureboot
Upgrade Ubuntu 18.04 Security with SecurebootUpgrade Ubuntu 18.04 Security with Secureboot
Upgrade Ubuntu 18.04 Security with Secureboot
 
Containers with systemd-nspawn
Containers with systemd-nspawnContainers with systemd-nspawn
Containers with systemd-nspawn
 
Building
BuildingBuilding
Building
 
1.1 hardware settings v2
1.1 hardware settings v21.1 hardware settings v2
1.1 hardware settings v2
 
101 1.1 hardware settings v2
101 1.1 hardware settings v2101 1.1 hardware settings v2
101 1.1 hardware settings v2
 
Krenel Based Virtual Machine In Centos7
Krenel Based Virtual Machine In Centos7Krenel Based Virtual Machine In Centos7
Krenel Based Virtual Machine In Centos7
 
Nim
NimNim
Nim
 
2.2 install boot manager
2.2 install boot manager2.2 install boot manager
2.2 install boot manager
 
BeagleBone Black Booting Process
BeagleBone Black Booting ProcessBeagleBone Black Booting Process
BeagleBone Black Booting Process
 
Qemu - Raspberry | while42 Singapore #2
Qemu - Raspberry | while42 Singapore #2Qemu - Raspberry | while42 Singapore #2
Qemu - Raspberry | while42 Singapore #2
 
Elastix installation
Elastix installationElastix installation
Elastix installation
 
Armboot process zeelogic
Armboot process zeelogicArmboot process zeelogic
Armboot process zeelogic
 
101 2.2 install boot manager
101 2.2 install boot manager101 2.2 install boot manager
101 2.2 install boot manager
 

Recently uploaded

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 

Recently uploaded (20)

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 

Install power linux through cdrom and network redhat and suse

  • 1. © 2013 IBM Corporation PowerLinux系统安装 之光盘安装 张军利 2014年6月26日
  • 2. © 2013 IBM Corporation 创建虚拟机并配置虚拟磁盘 2 IBM Confidential 在VIOS端中创建SCSI控制器 SCSI控制器端号丌能重复 VIOS中会劢态增加一个适配器 在硬盘上划逻辑卷组 在硬盘上划逻辑卷 将逻辑卷映射至SCSI控制器上 创建虚拟光驱并映射至SCSI控 制器上 在VIOC中选择VIOS中的SCSI 设备
  • 3. © 2013 IBM Corporation 在SMS菜单中配置从光驱启劢 3 IBM Confidential 按0键初始化Console 1 按1键进入SMS菜单 2 按1配置从何种介质启劢 4 3 按5配置启劢项 按7扫描可启劢介质 5 按2选择从光驱启劢 6 按2选择正常模式 7 按1退出SMS 8 进入安装界面,按回车开始安装 9
  • 4. © 2013 IBM Corporation 从光驱安装RHEL6u4 4 IBM Confidential 按Tab键选择Skip跳过介质检查 按回车键继续 选择语言,默认即可后续可调整 选择重置全部磁盘 采用本地时钟并选择时区为上海 设置丌短于6位的root用户密码 强制使用低安全强度密码 选择将系统安至何处磁盘 将分区表写入磁盘并格式化 1 2 3 4 5 6 7 8 9 Tips: 在每个交互式步骤都可以安装Ctrl-Z进入Shell命令行以进行排错
  • 5. © 2013 IBM Corporation 从光驱安装RHEL6u4(续) 5 IBM Confidential 软件安装 校验软件依赖 安装BootLoader 系统安装完毕,按回车重启 进入SMS菜单启劢项配置, 按2配置启劢顺序 按1配置第一启劢介质 按8扫描所有可启劢介质 按3选择硬盘为第一启劢项 按2确认 109.1 9.2 9.3 A B C D E
  • 6. © 2013 IBM Corporation 从光驱安装RHEL6u4(续) 6 IBM Confidential 按X退出SMS菜单 F 按1确认退出 G 从硬盘启劢 H 3. 实际上系统只安装了core包组,远远丌能满足系统日常使用需求 2. selinux默认开启,虽然安全但影响性能 1. 防火墙默认开启,虽然安全但影响性能和易用性 采用光盘默认安装存在的问题: 0. 需要较多交互处理,且采用Java Console容易乱码 Tips: 由于core组中丌包含scp或ftp等网络工具并在没有光驱的情况下,可在另外一台节点上通过ssh工具将系统镜像传递过 来,命令实例如下: ssh root@目标节点IP ‘cat > ~/rhel_os.iso’ < 本端节点ISO存放路径
  • 7. © 2013 IBM Corporation 光驱安装定制化的RHEL6u4 7 IBM Confidential 1 2 ks.cfg ftp://9.181.159.29/iso/os/rhel/6.4/iso/rhel6.4-mod.iso ftp://9.181.159.29/iso/os/rhel/5.8/rhel5.8-mod.iso
  • 8. © 2013 IBM Corporation 配置ks.cfg文件以进行自劢安装 8 IBM Confidential install lang en_US.UTF-8 keyboard us firewall --disabled authconfig --enableshadow --enablemd5 selinux --disabled timezone Asia/Shanghai rootpw rootroot key –skip %packages --nobase @core gcc gcc-gfortran gcc-c++ libstdc++ libstdc++-devel libstdc++.ppc libstdc++-devel.ppc libstdc++ compat-gcc-34 compat-gcc-34-c++ compat-gcc-34-g77 compat-libf2c-34 compat-libstdc++-33.ppc compat-libstdc++-33.ppc64 openssh-server openssh-clients vim-enhanced vim-common kernel-devel ...... ...... -sendmail -firstboot-tui -yum-updatesd -yum-rhn-plugin -rhn-check -rhn-client-tools -rhn-setup -rhnlib -rhnsd %post mkdir -p /etc/yum.repos.d/ORI mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/ORI/ mount /dev/cdrom /media cat > /etc/yum.repos.d/rhel-media.repo << EOF [media] name=media baseurl=file:///media enable=1 gpgcheck=0 [ibmtoolkit] name=ibmtoolkit baseurl=file:///media/ibmtoolkit enable=1 gpgcheck=0 EOF yum -y install devices.chrp.base.ServiceRM DynamicRM esagent.pLinux IBMinvscout ibm- power-managed-rhel6 iprutils librtas librtas.ppc libservicelog libservicelog.ppc libservicelog- devel libservicelog-devel.ppc libvpd libvpd.ppc libvpd-devel libvpd-devel.ppc lpa lsvpd nmon-14g PAM-authenticate powerpc-utils-python ppc64-diag pseries-energy rsct.core.ppc rsct.core.utils.ppc sct-pexpect servicelog src ibm-java-ppc64-sdk-6.0-12.0.ppc64 ibm-java- ppc-sdk-6.0-12.0.ppc#%pre #END PRE 1 2 3 41: 通用的系统设置。 2: 安装前可以执行的操作, 一般为判断安装盘操作。 3: 安装包选择,可根据需求进行定制。 4: 安装后执行的操作,一般为对系统进行配置。此例为安装IBM Installation Toolkit。
  • 9. © 2013 IBM Corporation Yaboot.conf配置文件 9 IBM Confidential init-message = "nWelcome to the 64-bit Red Hat Enterprise Linux 6.4 installer!nHit <TAB> for boot options.nn" timeout=6000 default=linux image=/ppc/ppc64/vmlinuz label=linux initrd=/ppc/ppc64/initrd.img append="mpath devfs=nomount ramdisk_size=10240 nofb ks=cdrom:/ks.cfg" read-only image=/ppc/ppc64/vmlinuz label=old initrd=/ppc/ppc64/initrd.img read-only yaboot.conf init-message: 进入boot提示符前给出的提示信息 timeout: boot提示符超时时间(秒) default: 超时后默认执行的label标识 image: 内核存放路径,以光盘目录为根 label: 标识符 initrd: 启劢根镜像存放路径 append: 追加给内核启劢的参数。其中ks参数从何处读取自劢安装脚本,由于 采用光盘自劢安装,故本例指定为cdrom设备下的ks.cfg文件。
  • 10. © 2013 IBM Corporation 定制化的RHEL6u4光盘封装 10 IBM Confidential DIST=`cat os/.treeinfo | grep version | grep -o '[0-9].[0-9]'` ISONAME="rhel${DIST}-mod.iso" mkisofs -v -U -J -R -T -part -hfs -r -l -sysid PPC -no-desktop -allow-multidot -chrp-boot -map ./os/ppc/mapping -magic ./os/ppc/magic -hfs-bless ./os/ppc/ppc64 -V "RHEL $DIST PPC DVD" -o $ISONAME ./os 系统安装介质目录结构 采用如下命令封装出可启劢的RHEL PPC系统安装光盘 ./os ├── etc │ └── yaboot.conf ├── ibmtoolkit │ └── ...... ├── images │ ├── install.img │ ├── netboot │ │ └── ppc64.img │ └── product.img ├── ks.cfg ├── Packages │ └── ..... ├── ppc │ ├── bootinfo.txt │ ├── chrp │ │ └── yaboot │ ├── efika.forth │ ├── magic │ ├── mapping │ ├── ppc64 │ │ ├── initrd.img │ │ ├── vmlinuz │ │ └── yaboot.conf │ └── TRANS.TBL ├── ...... ├── .discinfo ├── .treeinfo └── TRANS.TBL 内容相同,配置启劢镜像 IBM Installation Tookit安装介质 可订制化的自劢安装脚本 光盘封装时使用
  • 11. © 2013 IBM Corporation 从光驱安装SLES11SP2 11 IBM Confidential 1 2 3 4 5 选择语言接收许可 跳过介质检查 采用安装模式 选择时区 接收或调整软件和分区信息
  • 12. © 2013 IBM Corporation 从光驱安装SLES11SP2(续) 12 IBM Confidential 6 7 7.1 7.2 7.3 8 9 10 11 接收软件许可 确认安装 开始安装 安装完成后自劢第一次重启 第一次重启后进入配置阶段 配置root用户密码 强制使用弱安全密码 强制使用弱安全密码 配置主机名
  • 13. © 2013 IBM Corporation 从光驱安装SLES11SP2(续) 13 IBM Confidential 12 按Alt-N继续 13 14 15 16 17 18 19 20 接收配置信息 终止联网测试 跳过配置测试 配置身份认证模式 添加普通账号 强制使用弱安全密码 预览发行说明 跳过硬件配置 结束安装进入第二次重启
  • 14. © 2013 IBM Corporation 定制SLES11SP2实现全自劢安装 14 IBM Confidential ftp://9.181.159.29/iso/os/sles/11.2/iso/sles11-mod.iso
  • 15. © 2013 IBM Corporation 配置autoyast.xml文件以进行自劢安装 15 IBM Confidential profile install general mode clock keyboard mouse language software packages patterns partition firewall configure runlevel users scripts pre-scripts postpartitioning- scripts chroot-scripts post-scripts init-scripts
  • 16. © 2013 IBM Corporation Yaboot启劢文件配置 16 IBM Confidential ./os ├── autoyast.xml ├── ibmtoolkit ├── suseboot │ ├── initrd64 │ ├── inst64 │ ├── linux64.gz │ ├── loader │ ├── os-chooser │ ├── TRANS.TBL │ ├── yaboot │ ├── yaboot.cnf │ ├── yaboot.ibm │ └── yaboot.txt └── ...... message=yaboot.txt timeout=300 default=install image[64bit]=inst64 label=install append="quiet sysrq=1 insmod=sym53c8xx insmod=ipr autoyast=file:///autoyast.xml" image[64bit]=inst64 label=old append="quiet sysrq=1 insmod=sym53c8xx insmod=ipr" image[64bit]=inst64 label=slp append="quiet sysrq=1 install=slp " image[64bit]=inst64 label=rescue append="quiet sysrq=1 rescue=1 " yaboot.cnf Welcome to SuSE Linux Enterprise 11! Type "install" to start the YaST installer on this CD/DVD (autoinstall) Type "old" to start the YaST installer on this CD/DVD Type "slp" to start the YaST install via network Type "rescue" to start the rescue system on this CD/DVD yaboot.txt
  • 17. © 2013 IBM Corporation 定制划的SLES11SP2光盘封装 17 IBM Confidential mkisofs -p 'CD-Team' -publisher 'Novell, Inc.' -r -pad -T -U -l -chrp-boot -part --netatalk --macbin -A - -hfs-volid - -V SU.001 -hfs-bless ./os/suseboot -o sles11-mod.iso ./os ./os ├── autoyast.xml ├── ibmtoolkit ├── suseboot │ ├── initrd64 │ ├── inst64 │ ├── linux64.gz │ ├── loader │ ├── os-chooser │ ├── TRANS.TBL │ ├── yaboot │ ├── yaboot.cnf │ ├── yaboot.ibm │ └── yaboot.txt └── ...... https://github.com/yast/yast-cd-creator/blob/master/scripts/y2mkiso
  • 18. © 2013 IBM Corporation PowerLinux系统安装 之网络安装 张军利 2014年6月26日
  • 19. © 2013 IBM Corporation Linux网络安装流程概览 19 IBM Confidential 待安装服务器 DHCP服务器 TFTP服务器 FTP服务器 请 求IP 地 址 是否来自合法的客户端请求? 返 回 IP 地 址 和 自 丼 程 序 地 址 请 求 自 丼 程 序 注:自丼程序(bootstrap)在PPC上为yaboot文件;在X86上为pxelinux.0。 是 否 同 意 指 定 传 输 块 大 小 ? 丌 超 过 32MB 同 意 发 送 自 丼 程 序 执行自丼程序 请 求 传 送 自 丼 程 序 配 置 文 件 发 送 自 丼 程 序 配 置 文 件 读取配置文件 请 求 传 送 内 核 文 件 发 送 内 核 文 件 请 求 传 送 根 文 件 发 送 根 文 件 启劢内核 请 求 自 劢 化 安 装 脚 本 文 件 发 送 自 劢 化 安 装 脚 本 文 件 请 求 系 统 安 装 源 发 送 安 装 文 件 自劢安装 阶段1 阶段2 阶段3
  • 20. © 2013 IBM Corporation 通过网络全自劢安装RHEL6u4 20 IBM Confidential 选择启劢项 选择启劢设备 列出所有可启劢设备 选择网卡启劢 查看网卡信息 设定网卡作为启劢项 退出SMS菜单 从TFTP服务器下载yaboot 从TFTP服务器下载yaboot配置 文件 1 2 3 4 5 6 7 8 9
  • 21. © 2013 IBM Corporation 通过网络全自劢安装RHEL6u4(续) 21 IBM Confidential 从TFTP服务器下载vmlinuz内核 从TFTP服务器下载initrd.img根 加载自劢安装脚本至内核 软件自劢安装界面 系统后处理自劢执行部分 安装完成之后等待重启 进入启劢项 选择启劢设备 选择从硬盘启劢 10 11 12 13 14 15 16 17 18
  • 22. © 2013 IBM Corporation 配置部署服务器实现RHEL6u4自劢安装 22 IBM Confidential RHEL ├── etc │ └── 01-6c-ae-8b-01-3c-40 <- Default is: yaboot.conf ├── initrd.img -> ./media/ppc/ppc64/initrd.img ├── ks.d │ └── cn01-ks.cfg ├── log ├── media ├── vmlinuz -> ./media/ppc/ppc64/vmlinuz └── yaboot timeout=3 image=vmlinuz label=diag initrd=initrd.img append="mpath vnc=1 vncpassword=passwd4VNC ip=192.168.2.137 netmask=255.255.255.0 ksdevice=eth0 ks=ftp://192.168.2.253/RHEL/PPC/6.4/ks.d/cn01- ks.cfg devfs=nomount ramdisk_size=10240 nofb " allow bootp; allow booting; ddns-update-style none; ignore client-updates; #Subnet Defination subnet 192.168.2.0 netmask 255.255.255.0 { #Common settings default-lease-time 14400; max-lease-time 86400; option domain-name "cluster"; option time-offset -18000; next-server 192.168.2.253; filename "yaboot"; range dynamic-bootp 192.168.2.1 192.168.2.250; host cn01{ server-name "cn01"; hardware ethernet 6c:ae:8b:01:3c:40; fixed-address 192.168.2.11; } } /etc/dhcpd.conf service tftp { disable = no socket_type = dgram protocol = udp wait = yes user = root server = /usr/sbin/in.tftpd server_args = -s /tftpboot/RHEL/PPC/6.4 per_source = 11 cps = 100 2 flags = IPv4 } /etc/xinetd.d/tftp DHCPDARGS="-cf /etc/dhcpd.conf eth0“ /etc/sysconfig/dhcpd anonymous_enable=Yes anon_umask=022 anon_root=/tftpboot local_enable=YES write_enable=YES local_umask=022 anon_upload_enable=YES anon_mkdir_write_enable=YES anon_other_write_enable=YES dirmessage_enable=YES xferlog_enable=YES connect_from_port_20=YES xferlog_std_format=YES idle_session_timeout=600 data_connection_timeout=120 ftpd_banner=Welcome to blah FTP service. listen=YES pam_service_name=vsftpd userlist_enable=NO tcp_wrappers=YES /etc/vsftpd/vsftpd.conf
  • 23. © 2013 IBM Corporation 通过网络全自劢安装SLES11SP2 23 IBM Confidential 选择启劢项 选择启劢设备 列出所有可启劢设备 选择网卡启劢 查看网卡信息 设定网卡作为启劢项 退出SMS菜单1 2 3 4 5 6 7 从TFTP服务器下载yaboot 从TFTP服务器下载yaboot配置 文件 8 9
  • 24. © 2013 IBM Corporation 通过网络全自劢安装SLES11SP2(续) 24 IBM Confidential 进入自劢安装模式 下载内核和根打包镜像 加载自劢安装脚本至内核 软件自劢安装界面 安装启劢项并进入第一次重启 自劢逃过SMS进入第二次启劢 自劢配置系统10 11 12 13 14 15 16 进入系统 17
  • 25. © 2013 IBM Corporation 配置部署服务器实现SLESSP2自劢安装 25 IBM Confidential SLES ├── autoyast.d │ └── cn01-autoyast.xml ├── inst64 -> media/suseboot/inst64 ├── log ├── media ├── yaboot └── yaboot.conf-6c-ae-8b-01-3c-40 <- Default is: yaboot.conf timeout=3 image=inst64 label=autoyast append="vnc=1 vncpassword=passwd4VNC hostip=192.168.2.137 netmask=255.255.255.0 autoyast=ftp://192.168.2.253/SLES/PPC/11.2/autoyast.d/cn01-autoyast.xml install=ftp://192.168.2.253/SLES/PPC/11.2/media netdevice=eth0 dhcptimeout=150 " allow bootp; allow booting; ddns-update-style none; ignore client-updates; #Subnet Defination subnet 192.168.2.0 netmask 255.255.255.0 { #Common settings default-lease-time 14400; max-lease-time 86400; option domain-name "cluster"; option time-offset -18000; next-server 192.168.2.253; filename "yaboot"; range dynamic-bootp 192.168.2.1 192.168.2.250; host cn01{ server-name "cn01"; hardware ethernet 6c:ae:8b:01:3c:40; fixed-address 192.168.2.11; } } /etc/dhcpd.conf service tftp { disable = no socket_type = dgram protocol = udp wait = yes user = root server = /usr/sbin/in.tftpd server_args = -s /tftpboot/SLES/PPC/11.2 per_source = 11 cps = 100 2 flags = IPv4 } /etc/xinetd.d/tftp DHCPDARGS="-cf /etc/dhcpd.conf eth0“ /etc/sysconfig/dhcpd anonymous_enable=Yes anon_umask=022 anon_root=/tftpboot local_enable=YES write_enable=YES local_umask=022 anon_upload_enable=YES anon_mkdir_write_enable=YES anon_other_write_enable=YES dirmessage_enable=YES xferlog_enable=YES connect_from_port_20=YES xferlog_std_format=YES idle_session_timeout=600 data_connection_timeout=120 ftpd_banner=Welcome to blah FTP service. listen=YES pam_service_name=vsftpd userlist_enable=NO tcp_wrappers=YES /etc/vsftpd/vsftpd.conf
  • 26. © 2013 IBM Corporation 采用NIM网络安装Linux 张军利 2014年6月26日
  • 27. © 2013 IBM Corporation 网络地址示例配置 27 IBM Confidential NIM服务器 客户端 FTP服务器 RHEL# IPL In SMS-> ip: 172.16.14.201/24, gw: 172.16.14.1, server: 172.16.15.188 SLES# IPL In SMS-> ip: 172.16.14.202/24, gw: 172.16.14.1, server: 172.16.15.188 ip: 172.16.15.29/24, gw: 172.16.15.1 ip: 172.16.15.188/24, gw: 172.16.15.1
  • 28. © 2013 IBM Corporation NIM上的配置 28 IBM Confidential /tftpboot/ |-- ... |-- rhel | |-- rhel6u4_initrd.img | `-- rhel6u4_vmlinuz |-- sles11u2_inst64 |-- yaboot.conf |-- yaboot.rhel `-- yaboot.sles /etc/ |-- ... |-- bootptab |-- tftpaccess.ctl `-- yaboot.conf NIM Server timeout=600 default=sles11.2_autoinstall image[64bit]=sles11u2_inst64 label=sles11.2_autoinstall append="quiet sysrq=1 insmod=sym53c8xx insmod=ipr insmod=ibmveth hostip=172.16.14.202 netmask=255.255.255.0 gateway=172.16.14.1 autoyast=ftp://172.16.15.29/os/sles/11.2/autoyast.xml install=ftp://172.16.15.29/os/sles/11.2/os netdevice=eth0 dhcptimeout=150" timeout=600 default=rhel6.4_Autoinstall image=rhel/rhel6u4_vmlinuz label=rhel6.4_Autoinstall initrd=rhel/rhel6u4_initrd.img append="mpath devfs=nomount ramdisk_size=10240 nofb ip=172.16.14.201 netmask=255.255.255.0 gateway=172.16.14.1 ksdevice=eth0 ks=ftp://172.16.15.29/os/rhel/6.4/ks.cfg" read-only rhel:bf=/tftpboot/yaboot.rhel:ip=172.16.14.201:ht=ethernet:sa=172.16.15.188:gw=172.16.14.1:sm=255.255.255.0: sles:bf=/tftpboot/yaboot.sles:ip=172.16.14.202:ht=ethernet:sa=172.16.15.188:gw=172.16.14.1:sm=255.255.255.0: # NIM access for network boot allow:/tftpboot
  • 29. © 2013 IBM Corporation FTP服务器配置 29 IBM Confidential lftp 172.16.15.29:/os/rhel/6.4> ls drwxr-xr-x 2 527 501 4096 Sep 27 08:22 iso -r-xr-xr-x 1 0 0 3729 Nov 02 13:06 ks.cfg dr-xr-xr-x 9 0 0 8192 Jul 16 04:15 os lftp 172.16.15.29:/os/sles/11.2> ls -r--r--r-- 1 0 0 6009 Nov 04 03:08 autoyast.xml drwxr-xr-x 2 527 501 4096 Jul 18 13:31 iso dr-xr-xr-x 9 0 0 6144 Jul 18 13:24 os FTP Server SUSE安装光盘介质 Redhat安装光盘介质 Redhat自动安装脚本 SUSE自动安装脚本
  • 30. © 2013 IBM Corporation 采用LVM兊隆系统 张军利 2014年6月26日
  • 31. © 2013 IBM Corporation 常见的系统兊隆方式 31 IBM Confidential 磁盘对拷模式 MBR The original partitioning scheme for PC hard disks allowed only four partitions. This quickly turned out to be too little in real life, partly because some people want more than four operating systems (Linux, MS-DOS, OS/2, Minix, FreeBSD, NetBSD, or Windows/NT, to name a few), but primarily because sometimes it is a good idea to have several partitions for one operating system. For example, swap space is usually best put in its own partition for Linux instead of in the main Linux partition for reasons of speed (see below). To overcome this design problem, extended partitions were invented. This trick allows partitioning a primary partition into sub-partitions. The primary partition thus subdivided is the extended partition; the sub-partitions are logical partitions. They behave like primary partitions, but are created differently. There is no speed difference between them. By using an extended partition you can now have up to 15 partitions per disk. The partition structure of a hard disk might look like that in Figure on left. The disk is divided into three primary partitions, the second of which is divided into two logical partitions. Part of the disk is not partitioned at all. The disk as a whole and each primary partition has a boot sector. 分卷压缩备份和恢复模式
  • 32. © 2013 IBM Corporation PowerLinux系统磁盘布局 32 IBM Confidential MBR PrePBoot Boot LVM root swap 该分区仅在启动时为固件所读取,其上保存一个静态 连接的内核 bootloader,故在系统启动后无需挂载。 该分区存有Linux内核和一些内核信息,启动时 不为固件所读取。 Linux正式 开始启动。 在找到一块可启动磁盘 后,固件会在该磁盘上 寻找一个磁盘类型为41 的PRePBoot分区,从该 分区中读取出bootloder 并执行。bootloder接下 来会启动Linux。 固件(类似于PC上的 BIOS)先寻找可启动设 备,通常为软盘、光盘、 硬盘或网络等设备。 PowerLinux启动流程
  • 33. © 2013 IBM Corporation 以光盘启劢进入维护模式 33 IBM Confidential 1 2 3 4 5 6
  • 34. © 2013 IBM Corporation 调整根卷的大小 34 IBM Confidential sh-4.1# pvs PV VG Fmt Attr PSize PFree /dev/sda3 VolGroup lvm2 a-- 14.50g 0 sh-4.1# lvs -o +devices LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert Devices lv_root VolGroup -wi------ 6.57g /dev/sda3(0) lv_swap VolGroup -wi------ 7.94g /dev/sda3(1681) sh-4.1# lvchange -ay VolGroup/lv_root sh-4.1# mkdir -p /media/rootvg sh-4.1# mount /dev/VolGroup/lv_root /media/rootvg sh-4.1# rootvgsm=$[ `df --block-size=1m /media/rootvg|grep /media/rootvg|awk '{print $2}'` + 512 ] sh-4.1# umount /media/rootvg sh-4.1# sh-4.1# sh-4.1# lvs LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert lv_root VolGroup -wi-a---- 3.11g lv_swap VolGroup -wi------ 1.00g 一般情况下,根卷的大小往往超出其上存储内容总容量。如果丌减小根卷大小,那么在系统备份时将会浪费丌大量丌必要的时 间。这里采取的先将根卷调整至其实际容量+512M以便进行后续操作。 root swap root swap free
  • 35. © 2013 IBM Corporation 建立镜像存储池 35 IBM Confidential sh-4.1# pvs PV VG Fmt Attr PSize PFree /dev/sda3 VolGroup lvm2 a-- 14.50g 10.39g sh-4.1# Logical volume "lv_clone" created sh-4.1# pvs PV VG Fmt Attr PSize PFree /dev/sda3 VolGroup lvm2 a-- 14.50g 404.00m sh-4.1# mkfs.ext4 /dev/VolGroup/lv_clone sh-4.1# mkdir -p /media/clone sh-4.1# 这里简单起见,采用本地盘独立分出一部分空间以便存储镜像文件。实际过程中可以将镜像存储在其他盘或者是网络服务器上。 root swap freeclone
  • 36. © 2013 IBM Corporation 备份分区表、MBR、PrepBoot和boot分区 36 IBM Confidential sh-4.1# cd /media/clone sh-4.1# fdisk -l /dev/sda Disk /dev/sda: 16.1 GB, 16106127360 bytes 64 heads, 32 sectors/track, 15360 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xe8010200 Device Boot Start End Blocks Id System /dev/sda1 * 2 5 4096 41 PPC PReP Boot Partition 1 does not end on cylinder boundary. /dev/sda2 6 505 512000 83 Linux Partition 2 does not end on cylinder boundary. /dev/sda3 506 15360 15211520 8e Linux LVM Partition 3 does not end on cylinder boundary. sh-4.1# sh-4.1# sh-4.1# sh-4.1# root swap freeclone boot prepboot mbr 1 2 3 4 1 2 3 4
  • 37. © 2013 IBM Corporation 备份根卷之创建备份卷介质 37 IBM Confidential sh-4.1# mount /dev/VolGroup/lv_root /media/rootvg sh-4.1# rootvgsm=$[ `df --block-size=1m /media/rootvg|grep /media/rootvg|awk '{print $2}'` + 1024 ] sh-4.1# umount /media/rootvg/ sh-4.1# sh-4.1# mknod /dev/loop8 b 7 8 sh-4.1# chmod 660 /dev/loop8 sh-4.1# sh-4.1# sh-4.1# pvs PV VG Fmt Attr PSize PFree /dev/loop8 VolGroup lvm2 a-- 3.60g 3.60g /dev/sda3 VolGroup lvm2 a-- 14.50g 404.00m 由于采用LVM进行备份,而LVM丌能支持普通文件作为设备文件。因此,本例采用将普通文件映射为回环设备方式来实现对 LVM备份的支持。 root swap freeclone
  • 38. © 2013 IBM Corporation 备份根卷之映像根卷 38 IBM Confidential sh-4.1# lvs LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert lv_clone VolGroup -wi-ao--- 10.00g lv_root VolGroup -wi-a---- 3.11g lv_swap VolGroup -wi------ 1.00g sh-4.1# FATAL: Module dm_log_userspace not found. /sbin/modprobe failed: 1 /sbin/dmeventd: stat failed: No such file or directory /sbin/dmeventd: stat failed: No such file or directory VolGroup-lv_root: event registration failed: No such process VolGroup/lv_root: mirror segment monitoring function failed. VolGroup/lv_root: Converted: 0.0% ... ... VolGroup/lv_root: Converted: 100.0% sh-4.1# sync sh-4.1# lvs LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert lv_clone VolGroup -wi-ao--- 10.00g lv_root VolGroup mwi-a-m-- 3.11g lv_root_mlog 100.00 lv_swap VolGroup -wi------ 1.00g root swap freeclone
  • 39. © 2013 IBM Corporation 备份根卷之拆解根卷映像 39 IBM Confidential sh-4.1# FATAL: Module dm_log_userspace not found. /sbin/modprobe failed: 1 /sbin/dmeventd: stat failed: No such file or directory Logical volume lv_root converted. sh-4.1# lvs --segments -o +devices LV VG Attr #Str Type SSize Devices lv_clone VolGroup -wi-ao--- 1 linear 6.94g /dev/sda3(1937) lv_clone VolGroup -wi-ao--- 1 linear 3.06g /dev/sda3(796) lv_root VolGroup -wi-a---- 1 linear 3.11g /dev/sda3(0) lv_root_n VolGroup -wi-a---- 1 linear 3.11g /dev/loop8(0) lv_swap VolGroup -wi------ 1 linear 1.00g /dev/sda3(1681) sh-4.1# lvchange -an VolGroup/lv_root_n root swap freeclone
  • 40. © 2013 IBM Corporation 备份根卷之剥离映像设备卷 40 IBM Confidential sh-4.1# sh-4.1# lvs --segments -o +devices LV VG Attr #Str Type SSize Devices lv_clone VolGroup -wi-ao--- 1 linear 6.94g /dev/sda3(1937) lv_clone VolGroup -wi-ao--- 1 linear 3.06g /dev/sda3(796) lv_root VolGroup -wi-a---- 1 linear 3.11g /dev/sda3(0) lv_swap VolGroup -wi------ 1 linear 1.00g /dev/sda3(1681) lv_root_n VolGroup_n -wi------ 1 linear 3.11g /dev/loop8(0) sh-4.1# pvs PV VG Fmt Attr PSize PFree /dev/loop8 VolGroup_n lvm2 a-- 3.60g 500.00m /dev/sda3 VolGroup lvm2 a-- 14.50g 404.00m sh-4.1# lvcreate -L 256M -n lv_swap VolGroup_n sh-4.1# lvchange -an VolGroup_n/lv_swap sh-4.1# lvs -o +devices LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert Devices lv_clone VolGroup -wi-ao--- 10.00g /dev/sda3(1937) lv_clone VolGroup -wi-ao--- 10.00g /dev/sda3(796) lv_root VolGroup -wi-a---- 3.11g /dev/sda3(0) lv_swap VolGroup -wi------ 1.00g /dev/sda3(1681) lv_root_n VolGroup_n -wi------ 3.11g /dev/loop8(0) lv_swap VolGroup_n -wi------ 256.00m /dev/loop8(796) root swap freeclone root swap freeclone
  • 41. © 2013 IBM Corporation 备份根卷之导出映像卷 41 IBM Confidential sh-4.1# lvchange -ay VolGroup_n/lv_root_n sh-4.1# mount /dev/VolGroup_n/lv_root_n /media/rootvg/ sh-4.1# sed -i -e 's:VolGroup:VolGroup_n:g' -e 's:lv_root:lv_root_n:g' /media/rootvg/etc/fstab sh-4.1# umount /media/rootvg/ sh-4.1# lvchange -an VolGroup_n/lv_root_n sh-4.1# sh-4.1# pvs PV VG Fmt Attr PSize PFree /dev/loop8 VolGroup_n lvm2 ax- 3.60g 244.00m /dev/sda3 VolGroup lvm2 a-- 14.50g 404.00m sh-4.1# sh-4.1# rm /dev/loop8 sh-4.1# pvs PV VG Fmt Attr PSize PFree /dev/sda3 VolGroup lvm2 a-- 14.50g 404.00m sh-4.1# mkdir -p /media/boot sh-4.1# mount ./boot.img /media/boot/ -o loop sh-4.1# sed -i -e 's:VolGroup:VolGroup_n:g' -e 's:lv_root:lv_root_n:g' /media/boot/etc/yaboot.conf sh-4.1# umount /media/boot/ sh-4.1# ls -lh total 4.1G -rw-r--r--. 1 root root 500M 2013-10-16 08:19 boot.img -rw-r--r--. 1 root root 259 2013-10-16 07:44 diskp.log drwx------. 2 root root 16K 2013-10-16 07:43 lost+found -rw-r--r--. 1 root root 512 2013-10-16 07:44 mbr.img -rw-r--r--. 1 root root 4.0M 2013-10-16 07:44 prepboot.img -rw-r--r--. 1 root root 3.7G 2013-10-16 08:16 rootvg.img root swap freeclone root swap freeclone
  • 42. © 2013 IBM Corporation 系统恢复之定位恢复可用介质 42 IBM Confidential sh-4.1# fdisk -l Disk /dev/sda: 16.1 GB, 16106127360 bytes 64 heads, 32 sectors/track, 15360 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/sdb: 21.5 GB, 21474836480 bytes 64 heads, 32 sectors/track, 20480 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x787b0e00 Device Boot Start End Blocks Id System /dev/sdb1 1 8193 8389616 83 Linux sh-4.1# mkdir -p /media/clone sh-4.1# sh-4.1# ls -lh /media/clone/ total 4.1G -rw-r--r--. 1 root root 500M 2013-10-16 08:19 boot.img -rw-r--r--. 1 root root 259 2013-10-16 07:44 diskp.log drwx------. 2 root root 4.0K 2013-10-16 07:43 lost+found -rw-r--r--. 1 root root 512 2013-10-16 07:44 mbr.img -rw-r--r--. 1 root root 4.0M 2013-10-16 07:44 prepboot.img -rw-r--r--. 1 root root 3.7G 2013-10-16 08:16 rootvg.img diskp.log 1 2 3 4 5 mbr.img prepboot.img boot.img rootvg.img
  • 43. © 2013 IBM Corporation 系统恢复之恢复分区表 43 IBM Confidential sh-4.1# Checking that no-one is using this disk right now ... OK Disk /dev/sda: 15360 cylinders, 64 heads, 32 sectors/track /dev/sda: unrecognized partition table type Old situation: No partitions found New situation: Units = sectors of 512 bytes, counting from 0 Device Boot Start End #sectors Id System /dev/sda1 * 2048 10239 8192 41 PPC PReP Boot /dev/sda2 10240 1034239 1024000 83 Linux /dev/sda3 1034240 31457279 30423040 8e Linux LVM /dev/sda4 0 - 0 0 Empty Successfully wrote the new partition table Re-reading the partition table ... If you created or changed a DOS partition, /dev/foo7, say, then use dd(1) to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1 (See fdisk(8).) diskp.log 1 2 3 4 5 mbr.img prepboot.img boot.img rootvg.img sda3sda1 sda2
  • 44. © 2013 IBM Corporation 系统恢复之恢复MBR、PrePBoot和boot分区 44 IBM Confidential sh-4.1# count=1 sh-4.1# sh-4.1# sh-4.1# mkdir -p /media/boot sh-4.1# mount /dev/sda2 /media/boot sh-4.1# df -h /media/boot/ Filesystem Size Used Avail Use% Mounted on /dev/sda2 485M 45M 415M 10% /media/boot sh-4.1# umount /media/boot/ diskp.log 1 2 3 4 5 mbr.img prepboot.img boot.img rootvg.img sda3sda1 sda2
  • 45. © 2013 IBM Corporation 系统恢复之导入备份卷 45 IBM Confidential sh-4.1# mknod /dev/loop8 b 7 8 sh-4.1# chmod 660 /dev/loop8 sh-4.1# pvs sh-4.1# sh-4.1# pvs PV VG Fmt Attr PSize PFree /dev/loop8 VolGroup_n lvm2 ax- 3.60g 244.00m sh-4.1# sh-4.1# lvs LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert lv_root_n VolGroup_n -wi------ 3.11g lv_swap VolGroup_n -wi------ 256.00m diskp.log 1 2 3 4 5 mbr.img prepboot.img boot.img rootvg.img sda3sda1 sda2
  • 46. © 2013 IBM Corporation sh-4.1# sh-4.1# lvchange -ay VolGroup_n/lv_root_n sh-4.1# lvs LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert lv_root_n VolGroup_n -wi-a---- 3.11g lv_swap VolGroup_n -wi------ 256.00m sh-4.1# FATAL: Module dm_log_userspace not found. /sbin/modprobe failed: 1 /sbin/dmeventd: stat failed: No such file or directory /sbin/dmeventd: stat failed: No such file or directory VolGroup_n-lv_root_n: event registration failed: No such process VolGroup_n/lv_root_n: mirror segment monitoring function failed. VolGroup_n/lv_root_n: Converted: 0.0% ... ... VolGroup_n/lv_root_n: Converted: 100.0% sh-4.1# lvs -o +devices LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert Devices lv_root_n VolGroup_n mwi-a-m-- 3.11g lv_root_n_mlog 100.00 lv_root_n_mimage_0(0),lv_root_n_mimage_1(0) lv_swap VolGroup_n -wi------ 256.00m /dev/loop8(796) sh-4.1# sync 系统恢复之镜像备份卷 46 IBM Confidential diskp.log 1 2 3 4 5 mbr.img prepboot.img boot.img rootvg.img sda3sda1 sda2
  • 47. © 2013 IBM Corporation 系统恢复之生成新根卷 47 IBM Confidential sh-4.1# FATAL: Module dm_log_userspace not found. /sbin/modprobe failed: 1 /sbin/dmeventd: stat failed: No such file or directory Logical volume lv_root_n converted. sh-4.1# lvs -o +devices LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert Devices lv_root VolGroup_n -wi-a---- 3.11g /dev/sda3(0) lv_root_n VolGroup_n -wi-a---- 3.11g /dev/loop8(0) lv_swap VolGroup_n -wi------ 256.00m /dev/loop8(796) sh-4.1# lvchange -an VolGroup_n/lv_root sh-4.1# Checking for new volume group "VolGroup" Checking for volume group "VolGroup_n" Archiving volume group "VolGroup_n" metadata (seqno 10). Writing out updated volume groups Archiving volume group "VolGroup" metadata (seqno 0). Creating volume group backup "/etc/lvm/backup/VolGroup" (seqno 1). Creating volume group backup "/etc/lvm/backup/VolGroup_n" (seqno 11). Creating volume group backup "/etc/lvm/backup/VolGroup" (seqno 2). New volume group "VolGroup" successfully split from "VolGroup_n" sh-4.1# lvs -o +devices LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert Devices lv_root VolGroup -wi------ 3.11g /dev/sda3(0) lv_root_n VolGroup_n -wi-a---- 3.11g /dev/loop8(0) lv_swap VolGroup_n -wi------ 256.00m /dev/loop8(796) root backuproot mirror
  • 48. © 2013 IBM Corporation 系统恢复之卸载恢复卷 48 IBM Confidential sh-4.1# lvchange -an VolGroup_n/lv_root_n sh-4.1# sh-4.1# pvs PV VG Fmt Attr PSize PFree /dev/loop8 VolGroup_n lvm2 ax- 3.60g 244.00m /dev/sda3 VolGroup lvm2 a-- 14.50g 11.39g sh-4.1# sh-4.1# rm /dev/loop8 sh-4.1# pvs PV VG Fmt Attr PSize PFree /dev/sda3 VolGroup lvm2 a-- 14.50g 11.39g sh-4.1# lvs LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert lv_root VolGroup -wi------ 3.11g root mirror root backuproot mirror
  • 49. © 2013 IBM Corporation 系统恢复之新根卷微调 49 IBM Confidential sh-4.1# pvs PV VG Fmt Attr PSize PFree /dev/sda3 VolGroup lvm2 a-- 14.50g 11.39g sh-4.1# lvs LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert lv_root VolGroup -wi------ 3.11g sh-4.1# pvs PV VG Fmt Attr PSize PFree /dev/sda3 VolGroup lvm2 a-- 14.50g 11.39g sh-4.1# lvchange -ay VolGroup/lv_root sh-4.1# sh-4.1# Logical volume "lv_swap" created sh-4.1# lvs LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert lv_root VolGroup -wi-a---- 6.11g lv_swap VolGroup -wi-a---- 1.00g sh-4.1# mkdir -p /media/rootvg sh-4.1# mount /dev/VolGroup/lv_root /media/rootvg/ sh-4.1# df -h /media/rootvg Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup-lv_root 6.1G 2.7G 3.1G 46% /media/rootvg sh-4.1# sh-4.1# mount /dev/sda2 /media/boot/ sh-4.1# sh-4.1# reboot sda3sda1 sda2 root mirror
  • 50. © 2013 IBM Corporation50 IBM Confidential