如何创建 Ubuntu 持久化立付 U 盘
U 盘 立付
![](/data/attachment/album/202309/06/162606ivjl1zoohb1h8vuo.jpg)



> 
> 体验带有持久化的立付 U 盘，你在立付会话中做出的所有改动都会被保存。在此教程中，你将学习如何创建一个持久化的 U 盘。
> 
> 
> 


如果我告诉你，你能将完整的 Ubuntu 系统装载在一个可移动的 U 盘上，你会有何感想？


在外置 U 盘上 [安装 Ubuntu](https://itsfoss.com/intsall-ubuntu-on-usb/) 过程相当复杂。一种更容易的方法是制作一个带有持久化存储的 <ruby> 立付 <rt>  Live </rt></ruby> U 盘，这样你对 U 盘做出的改动都会被保存下来。


请相信我，这个过程跟使用 [BalenaEtcher](https://itsfoss.com/install-etcher-linux/) 或其他任何刻录工具创建可引导驱动器的过程十分相似。


然而，我们在开始之前，让我们先弄清楚持久化立付 U 盘是什么。


### 什么是持久化立付 U 盘？


当你使用立付 Linux U 盘时，你在 <ruby> 立付会话 <rt>  Live session </rt></ruby> 中做出的所有更改，在重启以后都将丢失。比如，你必须重新连接 Wi-Fi，并且你下载的文件及安装的应用均不会被保留。而持久化立付 U 盘将会为你保存这些所有的更改。


这样，你就可以将该 U 盘作为一个外置操作系统使用，它将会保存你所做出的所有更改，比如创建用户账号，安装软件包，和一切你通常在电脑上做的事情。


当然，保存的文件数量将取决于你使用的 U 盘的大小！


但你已经明白我要表达的意思了吧。那么，我们开始学习如何创建一个带有持久性的 Ubuntu 立付 U 盘吧。


### 如何创建一个持久化的 Ubuntu U 盘


在这个教程中，我将引导你完成一个持久化的 Ubuntu U 盘的制作过程：


* 通过在 Windows 上的 Rufus 工具
* 或者，通过在 Linux 上的 mkusb 工具


你可以参照教程中的适合你的部分。



> 
> ? 本教程中，你将会创建一个 Ubuntu 的持久化 U 盘。并非所有的 Linux 发行版都支持数据的持久化存储，所以这个方法可能并非所有的发行版本适用。
> 
> 
> 


### 方法 1：在 Windows 上创建持久化的 Ubuntu U 盘


在 Windows 上创建一个持久化的 Ubuntu U 盘，我会使用 Rufus，这是一款自由开源工具，专门用于将 ISO 文件刻录到 U 盘上。


请访问 [Rufus 的官方下载页面](https://rufus.ie/en/)，获取 Windows 版本的可执行文件：


![](/data/attachment/album/202309/06/162637zksnhjqb1ptxhk8n.png)


然后，打开 Rufus，它将要求以管理员身份运行；请授予该权限，因为你即将在外部驱动器上做改动，需要相应的权限。


接下来，根据以下步骤使用 Rufus 创建持久化 U 盘：


* 选中 U 盘设备（如果只有一个 U 盘，它将默认被选中）。
* 点击 “<ruby> 选择 <rt>  Select </rt></ruby>” 按钮，在文件管理器中选择 ISO 文件。
* 你可以使用滑块或直接设定持久化分区的大小（可以放心地设定为最大值）。
* 其他选项保持默认设置（除非你清楚在做什么）。
* 点击 “<ruby> 开始 <rt>  Start </rt></ruby>” 按钮，开始进行刻录。


![](/data/attachment/album/202309/06/162726wtpwwjikwpzjwjyz.jpg)


该程序你会告诉你，选中的驱动器上的所有数据将会被删除，所以你可以放心忽略这个警告。


完成后，我们可以来瞧瞧如何在 Windows 中直接启动到 UEFI 设置。


#### 通过 U 盘启动（简化版）


这个方法应适用于大多数用户，如果无效，你总是可以选择传统的方式，那就是重新启动系统并按下 `Esc`、`Delete`、`F1`、`F2`、`F10`、`F11` 或 `F12` 等按键。


步骤如下：按 `Win + X`，然后以管理员身份启动 Windows PowerShell：


![](/data/attachment/album/202309/06/162733ggxntj6jtxae0p6j.jpg)


一旦你看见提示符，直接运行以下命令：



```
shutdown.exe /r /fw

```

这将会计划一个关机动作，稍后，你会进入到 UEFI 固件设置。


到了这步，选择 U 盘作为首选的启动选项并保存设置：


![](/data/attachment/album/202309/06/162640pol18mm8nog8suma.jpg)


你会看到一个正常的 GRUB 屏幕：


![](/data/attachment/album/202309/06/162640nfggh7whrhfphbb4.png)


当你启动后，选择试用 Ubuntu 的选项，然后你所做的任何改动都可以被保存下来，即使你重新启动了电脑也无所谓。


### 方法 2：在 Ubuntu Linux 上创建持久化 Ubuntu U 盘



> 
> ? 请注意，这种方法主要适用于 Ubuntu 和 Debian 的 ISO。
> 
> 
> 


如果你还不知道，`mkusb` 是一个带有 GUI 的工具，让你能够将 ISO 文件刷到磁盘驱动器上，并且有附加功能，例如在 Ubuntu 上创建持久化驱动器。


你需要添加 `mkusb` 的 PPA 来进行安装，具体命令如下：



```
sudo add-apt-repository ppa:mkusb/ppa

```

要使改变生效，需要更新软件库索引：



```
sudo apt update

```

最后，安装 `mkusb` 以及其他相关软件包：



```
sudo apt install --install-recommends mkusb mkusb-nox usb-pack-efi

```

就这样！


首先，从系统菜单启动 `mkusb` 工具，它会提示你输入超级用户密码：


![](/data/attachment/album/202309/06/162640me202yrfdqrvvyq0.png)


操作完成后，它会提示你所有驱动器上的数据将会被新数据覆盖。


只需简单地点击 “OK” 按钮即可：


![](/data/attachment/album/202309/06/162640fl555b1ri1z0d8dd.png)


然后它会显示 `mkusb` 工具能执行的多项操作，你需要选择第一选项 “<ruby> 安装（制作一个启动设备） <rt>  Install (make a boot device) </rt></ruby>”：


![](/data/attachment/album/202309/06/162641v1eb9m9eqe60zqcf.png)


接下来，它会显示许多安装选项，你需要选择第三个选项 “<ruby> 持久化立付（仅针对 Debian 和 Ubuntu） <rt>  'Persistent live' - only Debian and Ubuntu </rt></ruby>”：


![](/data/attachment/album/202309/06/162641k8804z6iw6054ig0.png)


在下一个步骤中，它会让你在多种方法/工具中选择一个，如果没有使用特定类型的版本，例如超精简版本，建议使用第一个名为 “dus-Iso2usb” 的方法：


![](/data/attachment/album/202309/06/162642wriplhiiiuy2gbzt.png)


接着，它会让你从文件管理器中选择你需要的 ISO 文件：


![](/data/attachment/album/202309/06/162642bwyqbbnxpdzxyyxq.png)


工具会显示已选 ISO 文件的名称，以及创建持久化 U 盘所要使用的工具：


![](/data/attachment/album/202309/06/162642ghhsez7yb22jj25e.png)


下一步，你需要选择驱动器将之前选择的 ISO 文件刷入：


![](/data/attachment/album/202309/06/162642kiyzou3dtlotsyic.png)


以上全部完成后，将会有 3 个选项供你选择。如果你不确定使用哪一个，那么就点击 “<ruby> 使用默认 <rt>  Use defaults </rt></ruby>” 按钮，但是大多数用户选择第二个选项 “grold” 即可（我也是选择这个）：


![](/data/attachment/album/202309/06/162642x62fw70mxlg1fxx1.png)


检查一切都无误后，点击 “<ruby> 开始 <rt>  Go </rt></ruby>” 开始刷新过程：


![](/data/attachment/album/202309/06/162642oy91uh97i67e9938.png)


现在，刷入过程已经开始了！


![](/data/attachment/album/202309/06/162642hmkmz8gmk2mwmezm.png)


**注意，这个刷入过程会比你使用 BalenaEtcher 刷入要长一些时间！**


完成后，会有通知告诉你，过程已经完成，此时你可以取下 U 盘，然后重新插上，以查看更改的内容：


![](/data/attachment/album/202309/06/162642yjpxt0ect50cug0s.png)


#### 从持久化 U 盘启动


如果你要从 U 盘启动，通常可以重启你的系统，连续按下对应的按钮即可，但这已经是旧方法了！


在 Linux 中，有一种更为简便的方式访问 BIOS，你只需在终端执行以下命令：



```
systemctl reboot --firmware-setup

```

然后，进入启动菜单并将 U 盘设置为首选的启动选项：


![](/data/attachment/album/202309/06/162642k038r3cm1qil3lj0.jpg)


一旦你从 U 盘启动，你将有两个选项：


* 带有持久化模式的 ISO
* 以实时模式进行启动


如其名，你需要选择第一个选项以启动进入 Ubuntu 的持久化模式：


![](/data/attachment/album/202309/06/162643p9rgg9crq5wagxgh.png)


现在，你可以进行各种修改，如安装你喜欢的软件包，[创建新用户](https://learnubuntu.com/add-delete-users/) 等等！


我希望这个指南对你有所帮助。


*（题图：MJ/423c72d6-d6eb-4146-acd5-1e58eed11f41）*




---


via: <https://itsfoss.com/ubuntu-persistent-live-usb/>


作者：[Sagar Sharma](https://itsfoss.com/author/sagar/) 选题：[lujun9972](https://github.com/lujun9972) 译者：ChatGPT 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
![Warp Terminal](/assets/images/warp-terminal.webp)


![Warp Terminal](/assets/images/warp-terminal.webp)

What if I tell you you can carry a complete Ubuntu system in a removable disk drive?

[Installing Ubuntu on an external USB](https://itsfoss.com/intsall-ubuntu-on-usb/) is a complicated process. The simpler option is to make a live USB but with persistent storage that will save all the changes you make to it.

And trust me; the process is similar to [using BalenaEtcher](https://itsfoss.com/install-etcher-linux/) or any flashing tool to make a bootable drive.

But before that, let's have a look at what persistent live USB means.

## What is a persistent live USB?

When you use a live Linux USB, any changes you made in the live session are lost. If you boot from it again, you'll have to connect to WiFi again, your downloaded files and installed apps won't be there. A persistent live USB will save all those changes.

This way, you can keep using that USB drive as an external operating system that saves all the changes you've made like creating a user account, installing packages, and all sorts of things that you generally do with a normal computer.

Of course, the number of files would depend on the size of the disk you use!

But you got the point. Right? Let's see about creating a live Ubuntu USB with persistence.

## How to create a persistent Ubuntu drive

In this tutorial, I will walk you through the process of creating a persistent Ubuntu USB:

- On Windows using Rufus tool
- On Linux using mkusb tool

You can follow the appropriate section of the tutorial.

### Method 1: Create a persistent Ubuntu drive on Windows

To create a persistent Ubuntu drive on Windows, I will be using Rufus, a free and open-source tool to flash ISO files on USB drives.

[Visit the official download page of Rufus](https://rufus.ie/en/) to get the executable file for Windows:

![Download Rufus to create a persistent Ubuntu drive on Windows](https://itsfoss.com/content/images/2023/09/Download-Rufus-to-create-persistant-Ubuntu-drive-in-Windows.png)

Now, open the Rufus and it will ask you to run as an administrator; grant the permissions as you're about to make changes in the external drive and permissions are necessary for that.

Next, follow the given steps to use Rufus to make a persistent USB drive:

- Select the USB device (if there's only one USB stick, it will be selected by default).
- Hit the
`Select`

button to select the ISO file from the file manager. - You can either use the slider or specify the size of the persistent drive directly (you can go to the max, no worries).
- Leave the other options to default (unless you know what you are up to).
- Hit the
`Start`

button to start the flashing.

![](https://itsfoss.com/content/images/2023/09/Use-rufus-to-create-Ubuntu-persistant-drive.png)

It will show you warnings that the data on the selected drive will be removed, so you can easily ignore them.

Once done, let's have a look at how you can directly boot to the UEFI settings in Windows.

#### Boot from the USB drive (the easy way)

This method should work for most users and if not, you can always use the traditional way by rebooting the system and pressing Esc, Delete, F1, F2, F10, F11, or F12 keys.

To follow the easy method, press `Win + X`

and start Windows PowerShell as an admin:

![](https://itsfoss.com/content/images/2023/09/Start-Windows-powershell-as-admin.png)

Once you see the prompt, simply execute the following command:

`shutdown.exe /r /fw`


It will schedule the shutdown and in a moment, you'll be booted into the UEFI firmware setup.

From there, choose the USB as a first preference to boot from and save changes:

![Boot from persistent Ubuntu drive](https://itsfoss.com/content/images/2023/09/Boot-from-UEFI-1.jpg)

You will see a normal grub screen:

![boot from persistent Ubuntu drive](https://itsfoss.com/content/images/2023/09/Boot-from-persisted-storage-USB-drive-made-using-Rufus-on-Windows-machine.png)

Once you boot, select the option to test Ubuntu and from there you can save changes and they won't be removed even if you reboot the system.

### Method 2: Create a persistent Ubuntu drive on Ubuntu Linux

For those who don't know, mkusb is a GUI tool that lets you flash ISO on a disk drive but with additional features like creating a persistent drive on Ubuntu.

And for the installation, you have to add mkusb PPA using the following:

`sudo add-apt-repository ppa:mkusb/ppa`


To take effect from the changes, update the repository index:

`sudo apt update`


Finally, install mkusb and other packages:

`sudo apt install --install-recommends mkusb mkusb-nox usb-pack-efi`


That's it!

First, start what mkusb tool from the system menu. It will ask you to enter your superuser password:

![Start mkusb tool from system menu](https://itsfoss.com/content/images/2023/08/Start-mkusb-tool-from-system-menu.png)

Once done, it will show you the warning of all the data in the drive will be wiped with the new data.

Simply, press the `OK`

button:

![Data will be wiped warning](https://itsfoss.com/content/images/2023/08/Data-will-be-wiped-warning-.png)

And it will show you multiple actions that can be performed with the mkusb tool. From which, you have to select the first option "Install (make a boot device)":

![Select the first option in mkusb tool to create persistent USB drive of Ubuntu](https://itsfoss.com/content/images/2023/08/Select-the-first-option-in-mkusb-tool-to-create-persistent-USB-drive-of-Ubuntu.png)

After that, it will show you multiple options for the installation. From there, you select the third option `'Persistent live' - only Debian and Ubuntu`

:

![Select the persistent option](https://itsfoss.com/content/images/2023/08/Select-the-persistent-option.png)

In the next step, it will ask you to choose between multiple methods.

And unless you're using something specific like an extremely stripped-down version, go with the first method named `dus-Iso2usb`

:

![Select the grub option](https://itsfoss.com/content/images/2023/08/Select-the-grub-option.png)

Next, it will ask you to select the ISO file from the file manager:

![Select an ISO file to create persistent USB from Ubuntu](https://itsfoss.com/content/images/2023/08/Select-an-ISO-file-to-create-persistent-USB-from-Ubuntu.png)

It will show you the name of the selected ISO file along with what tools it will be using to create a persistent USB drive:

![Showing seelcted ISO file](https://itsfoss.com/content/images/2023/08/Showing-seelcted-ISO-file.png)

Next, you have to select the drive that needs to be flashed with the previously selected ISO file:

![Choose drive to create persistent drive](https://itsfoss.com/content/images/2023/08/Choose-drive-to-create-persistent-drive.png)

Once done, you will be given 3 choices. If you don't know which one to use, then press the `Use defaults`

button but for most users, going with the 2nd option `grold`

will get the job done (I'm going with the same):

![Choose bootloader](https://itsfoss.com/content/images/2023/08/Choose-bootloader.png)

After everything is correct, choose `Go`

option to start the flashing process:

![Select go ahead option in mkusb to create persistent USB drive](https://itsfoss.com/content/images/2023/08/Select-go-ahead-option-in-mkusb-to-create-persistent-USB-drive.png)

And it will start the flashing process!

![Flashing process to make persistent usb of Ubuntu](https://itsfoss.com/content/images/2023/08/Flashing-process-to-make-persistent-usb-of-Ubuntu.png)

**Remember, it will take longer compared to the usual flashing that you do using BalenaEtcher!**

Once done, you'll be notified that the process has been completed and you can unplug and re-plug the drive to see changes:

![Persistent drive has been made](https://itsfoss.com/content/images/2023/08/Persistent-drive-has-been-made.png)

#### Boot from persistent USB drive

To boot from the USB drive, you can reboot your system, press the respective key multiple times, and get there but NO!

That's a decade-old method.

There's[ a simple way to access BIOS in Linux](https://itsfoss.com/access-uefi-from-linux/) where all you have to do is execute the following command in your terminal:

`systemctl reboot --firmware-setup`


Here, go to the Boot menu and select the USB drive as a first priority to boot from:

![boot from persisted storage USB in Ubuntu](https://itsfoss.com/content/images/2023/09/Boot-from-UEFI.jpg)

Once you boot from the USB, you'll have two options:

- ISO with persisted mode
- Booting from live mode

As the name suggests, you go with the first option to boot into the Ubuntu persisted mode:

![Boot from persisted storage USB drive](https://itsfoss.com/content/images/2023/08/Boot-from-persisted-storage-USB-drive.png)

And now, you can make changes like installing your favorite packages, [creating a new user](https://learnubuntu.com/add-delete-users/), and a lot more!

## Carry multiple ISOs in one drive!

Did you know that you can carry multiple ISOs in a single drive and those ISOs could be any Linux distro or even a Windows ISO file? Ventoy is an awesome tool for that.

[Install and Use Ventoy on Ubuntu [Complete Guide]Tired of flashing USB drives for every ISO? Get started with Ventoy and get the ability to easily boot from ISOs.](https://itsfoss.com/use-ventoy/)![](https://itsfoss.com/content/images/2023/07/install-ventoy-on-ubuntu-linux.png)


![](https://itsfoss.com/content/images/2023/07/install-ventoy-on-ubuntu-linux.png)

[How to Install Multiple Live Linux Distros on One USBThis tutorial shows the steps you can take to create a live USB stick that allows you to boot into more than Linux distributions without needing to re-image the drive.](https://itsfoss.com/multiple-linux-one-usb/)![](https://itsfoss.com/content/images/2023/08/multiple-live-linux-on-usb.png)


![](https://itsfoss.com/content/images/2023/08/multiple-live-linux-on-usb.png)

I hope you will find this guide helpful.