# 【Linux】分区向左扩容的方法

@[TOC](https://github.com/UnderTurrets/notes/blob/master/Linux/%E6%96%87%E7%AB%A0%E7%9B%AE%E5%BD%95/README.md)

***

## 为什么是向左扩容

Linux向右扩容非常简单，无论是系统自带的`disks`工具还是apt安装的`gparted`工具，都有图像化的界面可以操作。但是，都不支持向左扩容。笔者这里的磁盘情况如下：

![](https://cdn.jsdelivr.net/gh/UnderTurrets/ImageHosting@master/linux_extenddisk_mydisk.png)

其中磁盘1的99.5GB是我的Linux系统分区，已经捉襟见肘，需要扩容。而我分出的100GB又在它的左侧，这种情况下，无论是在win系统还是Linux系统，都是无法直接扩容的。

## 操作前的备份

无论扩容是否成功，请先进行数据克隆。笔者这里就找了一根1TB的硬盘对磁盘1进行全盘拷贝。这样就算Linux崩了也可以恢复：

![](https://cdn.jsdelivr.net/gh/UnderTurrets/ImageHosting@master/linux_extenddisk_backup.png)

## 方法：启动盘试用Ubuntu后进行操作

准备一个Ubuntu启动盘，开机加载启动盘，加载启动盘的方法见[此篇](https://hanxu.gitbook.io/blogs/linux/linuxinstall-xiang-xi-de-ubuntu-he-win-shuang-xi-tong-an-zhuang-zhi-nan)。然后进入`Try or install Ubuntu`，进入之后选择试用。然后在试用的情况下，才可以对Linux的分区进行扩容。

进入试用之后，可以试用时自带的`gparted`工具进行操作，有图形化界面，非常简单，不必赘述了。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hanxu.gitbook.io/blogs/linux/linux-fen-qu-xiang-zuo-kuo-rong-de-fang-fa.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
