Ubuntu16.04.5以lvm方式安装全记录
操作系统版本:root@openstack-computer:~# more /etc/os-release
NAME="Ubuntu"
VERSION="16.04.5 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.5 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial 操作系统版本为16.04.5服务器版
本文目录:
1.操作系统安装
2.系统优化
本文介质:
链接:https://pan.baidu.com/s/1LenCI68uacAE-U_uIj1ecg
提取码:dbfr
16.04.5各版本下载地址:http://nl.releases.ubuntu.com/16.04/?_ga=2.15533814.1988147862.1543216875-909190780.1539682835
Part1 操作系统安装
语言选择‘English’,16.04版本如果选择‘中文(简体)’安装过程中会报错‘无法安装busybox-initramfs’,貌似这是个bug
http://s1.运维网.com/images/20181129/1543477841128966.png
回车
http://s1.运维网.com/images/20181129/1543477869725871.png
选择‘English’
http://s1.运维网.com/images/20181129/1543477914311256.png
如图,回车
http://s1.运维网.com/images/20181129/1543477979126538.png
选择'No',回车
http://s1.运维网.com/images/20181129/1543478020252092.png
选择如图,回车
http://s1.运维网.com/images/20181129/1543478058140396.png
回车
http://s1.运维网.com/images/20181129/1543478099107644.png
安装中
http://s1.运维网.com/images/20181129/1543478156785448.png
选择网卡
http://s1.运维网.com/images/20181129/1543478189356651.png
配置网络
http://s1.运维网.com/images/20181129/1543478213183757.png
DHCP配置失败,回车
http://s1.运维网.com/images/20181129/1543478257182279.png
手动配置网络
http://s1.运维网.com/images/20181129/1543478282887133.png
配置ip
http://s1.运维网.com/images/20181129/1543478309130099.png
掩码
http://s1.运维网.com/images/20181129/1543478327848687.png
网关
http://s1.运维网.com/images/20181129/1543478359506726.png
name server为空
http://s1.运维网.com/images/20181129/1543478408402523.png
主机名
http://s1.运维网.com/images/20181129/1543478448703842.png
domain为空
http://s1.运维网.com/images/20181129/1543478576370114.png
新建用户monitor
http://s1.运维网.com/images/20181129/1543478602181492.png
回车,下一步
http://s1.运维网.com/images/20181129/1543478626180218.png
设置密码,回车
http://s1.运维网.com/images/20181129/1543478653475974.png
确认密码,回车
http://s1.运维网.com/images/20181129/1543478671272843.png
选择Yes,启用弱密码
http://s1.运维网.com/images/20181129/1543478702289568.png
选择No,不加密家目录
http://s1.运维网.com/images/20181129/1543478729310697.png
时区选择,随便选一个,系统装好后可以修改
http://s1.运维网.com/images/20181129/1543478786761513.png
分区设置,选择手动
http://s1.运维网.com/images/20181129/1543478824464071.png
选择磁盘
http://s1.运维网.com/images/20181129/1543478842897762.png
选择Yes
http://s1.运维网.com/images/20181129/1543478858138316.png
选择磁盘,准备分区设置
http://s1.运维网.com/images/20181129/1543478890641393.png
创建新的区
http://s1.运维网.com/images/20181129/1543478907371374.png
大小为500M
http://s1.运维网.com/images/20181129/1543478947477659.png
选择主分区
http://s1.运维网.com/images/20181129/1543478963272756.png
选择Beginning
http://s1.运维网.com/images/20181129/1543478987429458.png
准备设置文件系统格式和挂载点
http://s1.运维网.com/images/20181129/1543479048489769.png
文件系统格式为Ext4
http://s1.运维网.com/images/20181129/1543479070656062.png
挂载点为boot
http://s1.运维网.com/images/20181129/1543479090532015.png
go back
http://s1.运维网.com/images/20181129/1543479117535981.png
继续分区,回车
http://s1.运维网.com/images/20181129/1543479134288175.png
同理,创建为主分区的swap分区,大小为8GB,文件系统格式选择swap
http://s1.运维网.com/images/20181129/1543479199280900.png
返回
http://s1.运维网.com/images/20181129/1543479220591448.png
创建卷组和逻辑卷
http://s1.运维网.com/images/20181129/1543479253630843.png
http://s1.运维网.com/images/20181129/1543479279342169.png
使用全部剩余磁盘空间
http://s1.运维网.com/images/20181129/1543479300137545.png
选择为主分区
http://s1.运维网.com/images/20181129/1543479323932861.png
文件系统类型为lvm
http://s1.运维网.com/images/20181129/1543479345389324.png
返回
http://s1.运维网.com/images/20181129/1543479359112206.png
配置卷组逻辑卷
http://s1.运维网.com/images/20181129/1543479388932849.png
选择Yes
http://s1.运维网.com/images/20181129/1543479410886885.png
创建卷组
http://s1.运维网.com/images/20181129/1543479431244309.png
卷组名为rootvg
http://s1.运维网.com/images/20181129/1543479446948168.png
磁盘选择/dev/sda3
http://s1.运维网.com/images/20181129/1543479482414079.png
开始创建逻辑卷
http://s1.运维网.com/images/20181129/1543479510878684.png
选择唯一的vg rootvg,回车
http://s1.运维网.com/images/20181129/1543479531641620.png
逻辑卷名为root
http://s1.运维网.com/images/20181129/1543479551367886.png
大小为10GB
http://s1.运维网.com/images/20181129/1543479569397430.png
同理创建opt、var、usr、tmp、home等逻辑卷
查看已创建的逻辑卷
http://s1.运维网.com/images/20181129/1543479715998181.png
http://s1.运维网.com/images/20181129/1543479726234817.png
选择Finish,准备挂载逻辑卷
http://s1.运维网.com/images/20181129/1543479754240908.png
选择逻辑卷home,如图
http://s1.运维网.com/images/20181129/1543479785536780.png
默认为未使用状态
http://s1.运维网.com/images/20181129/1543479816900630.png
文件系统选择Ext4
http://s1.运维网.com/images/20181129/1543479833481611.png
挂载点默认为空,选择/home
http://s1.运维网.com/images/20181129/1543479859579472.png
http://s1.运维网.com/images/20181129/1543479986691913.png
http://s1.运维网.com/images/20181129/1543479899909686.png
同理挂载其它逻辑卷
配置完成如图
http://s1.运维网.com/images/20181129/1543480055426431.png
完成分区,写入磁盘
http://s1.运维网.com/images/20181129/1543480075570141.png
选择Yes
http://s1.运维网.com/images/20181129/1543480094375655.png
系统安装中
http://s1.运维网.com/images/20181129/1543480117437558.png
为空,继续
http://s1.运维网.com/images/20181129/1543480289822594.png
不更新
http://s1.运维网.com/images/20181129/1543480317268178.png
安装包选择,这里选择ssh和virtual machine host,ssh是为了方便远程登录,virtual machine host是kvm服务
http://s1.运维网.com/images/20181129/1543480490319349.png
选择Yes
http://s1.运维网.com/images/20181129/1543480539727864.png
弹出磁盘,继续
http://s1.运维网.com/images/20181129/1543480655539110.png
完成安装,使用monitor账号登陆
http://s1.运维网.com/images/20181129/1543484889876260.png
Part2 系统优化
系统已完成安装,此时可以通过crt、putty等工具远程登录
1.允许root登陆并设置root密码
monitor@openstack-computer:~$ sudo view /etc/ssh/sshd_config
PermitRootLogin yes
PasswordAuthentication yes
monitor@openstack-computer:~$ sudo service ssh restart 设置root的密码
monitor@openstack-computer:~$ sudo su - root
root@openstack-computer:~# passwd root
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully 2.配置ip和dns
root@openstack-computer:~# view /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto ens160
iface ens160 inet static
address 172.27.34.38
netmask 255.255.255.0
network 172.27.34.0
broadcast 172.27.34.255
gateway 172.27.34.1
dns-nameserver 218.104.111.122
dns-search foo.org.bar.co
root@openstack-computer:~# service networking restart dns-nameserver请根据实际情况填写,配置后重启网络服务
3.配置apt源
root@openstack-computer:~# view /etc/apt/sources.list
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
root@openstack-computer:~# apt update 将源设置为阿里源并更新
4.修改时区
查看当前时区
root@openstack-computer:~# date -R
Thu, 29 Nov 2018 03:53:49 -0500 修改时区
root@openstack-computer:~# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 验证
root@openstack-computer:~# date -R
Thu, 29 Nov 2018 16:58:15 +0800 时区修改完成
至此完成Ubuntu16.04.5操作系统安装
页:
[1]