Ubuntu 24.04 Server 版系统安装及配置

作者:nctcpc 发表于:2025-11-13

一、获取安装文件

Ubuntu 24.04 Server 版系统安装及配置

二、安装界面

选择English(US)

Ubuntu 24.04 Server 版系统安装及配置

问是否升级内核

Ubuntu 24.04 Server 版系统安装及配置

配置键盘

Ubuntu 24.04 Server 版系统安装及配置

Ubuntu 24.04 Server 版系统安装及配置

手动配置ipv4网络(可选)

Ubuntu 24.04 Server 版系统安装及配置

Ubuntu 24.04 Server 版系统安装及配置

子网、IP、网关、DNS

Ubuntu 24.04 Server 版系统安装及配置

Ubuntu 24.04 Server 版系统安装及配置

是否配置静像源

Ubuntu 24.04 Server 版系统安装及配置

系统使用默认静像源

Ubuntu 24.04 Server 版系统安装及配置

Ubuntu 24.04 Server 版系统安装及配置

使用默认磁盘分区

Ubuntu 24.04 Server 版系统安装及配置

Ubuntu 24.04 Server 版系统安装及配置

Ubuntu 24.04 Server 版系统安装及配置

设置服务器用户及账号信息

Ubuntu 24.04 Server 版系统安装及配置

不升级,默认的LTS版本维护周期5年

Ubuntu 24.04 Server 版系统安装及配置

安装SSH服务!!按空格选择它

Ubuntu 24.04 Server 版系统安装及配置

不安装系统应用

Ubuntu 24.04 Server 版系统安装及配置

系统安装中

Ubuntu 24.04 Server 版系统安装及配置

一定要等到这个状态,才算安装完成

Ubuntu 24.04 Server 版系统安装及配置

系统重启时,提示这个,敲回车,确认卸载光盘

Ubuntu 24.04 Server 版系统安装及配置


三、配置网络

[root@master01:/etc/netplan]# vi /etc/netplan/50-cloud-init.yaml
`这个是原先在安装界面时,配置好的IP地址,打开配置文件显示的内容`
# This file is generated from information provided by the datasource.  Changes
# to it will not persist across an instance reboot.  To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
    ethernets:
        ens33:
            addresses:
            - 192.168.100.10/24
            nameservers:
                addresses:
                - 8.8.8.8
                search: []
            routes:
            -   to: default
                via: 192.168.100.2
    version: 2

✅ 推荐手动配置网络

`在安装界面未配置IP时,可按视频教程手动配置以下内容`
# This file is generated from information provided by the datasource.  Changes
# to it will not persist across an instance reboot.  To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
    ethernets:
        ens33:
            dhcp4: no
            addresses:此外冒号后不要有空格
              - 192.168.100.10/24
            routes:
              - to: default
                via: 192.168.100.2
            nameservers:
              addresses: [119.29.29.29,8.8.8.8,114.114.114.114]
    version: 2
[root@master01:/etc/netplan]# netplan apply

Ubuntu 24.04 Server 版系统安装及配置

四、扩容根分区


🚨 为什么只用了 49G?不是应该用满 100G 吗?


这是因为:


✅ Ubuntu 安装程序默认设置有限制


默认只给根分区分配 48~50G 左右(取决于版本和安装选项)


即使你给了 100G 磁盘,它也不会自动把全部空间都用掉


除非你手动调整分区大小


✅ 如何解决?扩展根分区到 100G?


你可以通过以下步骤 扩大逻辑卷并扩容文件系统:


🔧 步骤一:检查当前 LVM 结构

sudo lvdisplay

🔧 步骤二:扩展逻辑卷(LV)

sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv

-l +100%FREE 表示使用剩余所有空间(这里是 49G)

🔧 步骤三:扩展文件系统(ext4)

sudo resize2fs /dev/ubuntu-vg/ubuntu-lv

注意:如果提示不支持,可能是文件系统类型不同,但 Ubuntu 默认是 ext4。

✅ 验证结果

df -h


文章来源:CSDN社区  博主亲测教程有效


版权声明

本文仅代表作者观点,不代表京强博客立场。
本文系作者授权百度百家发表,未经许可,不得转载。

分享:

扫一扫在手机阅读、分享本文

请发表您的评论

您是本站第3名访客 今日有0篇新文章/评论