大网数据广告活动
服务器运维问答

Hot increase boot partition size ubuntu command line

· 52CE 我爱测

I'm not expert with filesystem and partitioning. I've tried to follow lots of tutorials in this site (and other sites) but I don't know how to adapt the solution to my case. I want to enlarge root (1) partition with command line …

问题原文

原帖链接 · Marco · CC BY-SA 3.0

I'm not expert with filesystem and partitioning.

I've tried to follow lots of tutorials in this site (and other sites) but I don't know how to adapt the solution to my case.

I want to enlarge root (1) partition with command line on Ubuntu 16

~# parted
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Model: VMware Virtual disk (scsi)
Disk /dev/sda: 68.7GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type      File system     Flags
 1      1049kB  10.2GB  10.2GB  primary   ext4            boot
 2      10.2GB  10.7GB  535MB   extended
 5      10.2GB  10.7GB  535MB   logical   linux-swap(v1)

(parted)

I've followed guide like this: guide

But I'm only able to generate a partition (3) with only 1kb.

I can see that partition 1 have no space at the end, and I suppose that the empty space (~50 GB!!!) are at the end of the partition 5 (swap).

Is there a way to solve my problem and add the empty space in the partition 1 even if the space is at the end of the partition 5?

UPDATE!!!

As suggested in the answers, I've solved removing the swap disk with this solution (sorce solution)

and is not necessary to follow my guide because I'm using ext4

已采纳解答

原帖链接 · mzhaase · CC BY-SA 3.0

No, since it is not lvm. What you will need to do is to create a swap file, change the swap location to that file, remove the swap partition. Then you can enlarge the root partition like described in the guides you mentioned. After you did this, you can either create a new swap partition, or keep using a swapfile on the local drive instead.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-02-24)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。