MrD*_*uck 7 live-usb persistence
我有一个 Ubuntu live USB,并且没有任何其他 PC、笔记本电脑或 USB 记忆棒。我可以让我的 live USB 持久化吗?如果没有,是否有其他方法可以将文件保存在其中,以便即使我重新启动电脑后它们也能保留在那里?
注意:我有一台配备 Intel 第六代 Core i3 处理器和 4GB RAM 的 PC,目前正在通过 16GB USB 记忆棒运行 Ubuntu。我不能借用别人的电脑或 USB 驱动器,但我有一部手机(如果有帮助的话)。
sud*_*dus 14
Usually I recommend using mkusb in order to create a persistent live USB drive. But in this case I think it is too risky, because there is no backup, the only working operating system is in the target drive.
Instead I suggest to make the default /var/log and /var/crash mounted writable partition into a 'free' usbdata partition, that can be mounted and unmounted by the user.
When booting, at the grub menu, press 'e' to make a temporary edit: add nopersistent to the line starting with linux
linux ... quiet splash nopersistent ---
Run Code Online (Sandbox Code Playgroud)
continue booting with F10 or ctrl x
now you can unmount the partition with ext4 file system
sudo umount /dev/sdx3
Run Code Online (Sandbox Code Playgroud)
where x is the drive letter (can be a, b, c ...)
change the label
sudo tune2fs -L usbdata /dev/sdx3
Run Code Online (Sandbox Code Playgroud)
shutdown, wait for 10 seconds and boot again.
The system will be live (not persistent live), but the ext4 partition can be used for storage. Until you have another drive available this is a rather safe method to create storage space on the drive. In order to make it convenient, you can create one or more directories at its top level and modify the ownership.
The partition will probably automount (it did when i tested with Lubuntu 20.04.4 LTS, which is lighter than standard Ubuntu).
cd /media/lubuntu/usbdata
sudo mkdir Docs
sudo chown 999 Docs
Run Code Online (Sandbox Code Playgroud)
999 is the numeric ID of the live user (for standard Ubuntu as well as Lubuntu and the other community flavours). Now you can go there and test writing files.
cd Docs
echo 'Hello World' > hello
cat hello
ls -l hello
Run Code Online (Sandbox Code Playgroud)
持久性 Linux USB 基本上只是带有持久性覆盖文件或分区的 Live USB(即 casper-rw、可写或 home -rw)。
可以从头开始制作持久 USB:
也可以从 Live USB 完全安装 Ubuntu,请参阅: https: //askubuntu.com/a/855805/43926
类似请参阅:如何使用启动磁盘创建器制作持久驱动器
| 归档时间: |
|
| 查看次数: |
6302 次 |
| 最近记录: |