前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Ubuntu16.04.5以lvm方式安装全记录

Ubuntu16.04.5以lvm方式安装全记录

作者头像
loong576
修改2019-10-23 11:23:24
1.5K0
修改2019-10-23 11:23:24
举报
文章被收录于专栏:运维ABC

操作系统版本:

代码语言:txt
复制
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

回车

选择‘English’

如图,回车

选择'No',回车

选择如图,回车

回车

安装中

选择网卡

配置网络

DHCP配置失败,回车

手动配置网络

配置ip

掩码

网关

name server为空

主机名

domain为空

新建用户monitor

回车,下一步

设置密码,回车

确认密码,回车

选择Yes,启用弱密码

选择No,不加密家目录

时区选择,随便选一个,系统装好后可以修改

分区设置,选择手动

选择磁盘

选择Yes

选择磁盘,准备分区设置

创建新的区

大小为500M

选择主分区

选择Beginning

准备设置文件系统格式和挂载点

文件系统格式为Ext4

挂载点为boot

go back

继续分区,回车

同理,创建为主分区的swap分区,大小为8GB,文件系统格式选择swap

返回

创建卷组和逻辑卷

使用全部剩余磁盘空间

选择为主分区

文件系统类型为lvm

返回

配置卷组逻辑卷

选择Yes

创建卷组

卷组名为rootvg

磁盘选择/dev/sda3

开始创建逻辑卷

选择唯一的vg rootvg,回车

逻辑卷名为root

大小为10GB

同理创建opt、var、usr、tmp、home等逻辑卷

查看已创建的逻辑卷

选择Finish,准备挂载逻辑卷

选择逻辑卷home,如图

默认为未使用状态

文件系统选择Ext4

挂载点默认为空,选择/home

同理挂载其它逻辑卷

配置完成如图

完成分区,写入磁盘

选择Yes

系统安装中

为空,继续

不更新

安装包选择,这里选择ssh和virtual machine host,ssh是为了方便远程登录,virtual machine host是kvm服务

选择Yes

弹出磁盘,继续

完成安装,使用monitor账号登陆

Part2 系统优化

系统已完成安装,此时可以通过crt、putty等工具远程登录

1.允许root登陆并设置root密码

代码语言:txt
复制
monitor@openstack-computer:~$ sudo view /etc/ssh/sshd_config 
PermitRootLogin yes
PasswordAuthentication yes
monitor@openstack-computer:~$ sudo service ssh restart

设置root的密码

代码语言:txt
复制
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

代码语言:txt
复制
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源

代码语言:txt
复制
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.修改时区

查看当前时区

代码语言:txt
复制
root@openstack-computer:~# date -R
Thu, 29 Nov 2018 03:53:49 -0500

修改时区

代码语言:txt
复制
root@openstack-computer:~# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

验证

代码语言:txt
复制
root@openstack-computer:~# date -R
Thu, 29 Nov 2018 16:58:15 +0800

时区修改完成

至此完成Ubuntu16.04.5操作系统安装

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2018/11/29 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档