非持久性 Live CD 上的数据存储在哪里?
当我从 Live CD 启动 Linux Mint 时,我能够将文件保存到“文件系统”。但这些文件保存在哪里呢?不可能是光盘,因为它是 CDR。我不认为它存储在 RAM 中,因为它只能保存这么多数据,并且并不是真正打算用作“硬盘驱动器”。唯一的其他选择是硬盘驱动器...但它肯定不会保存到我所知道的硬盘驱动器上的任何分区,因为它们都没有安装。那么我的文件保存到哪里了?
When I boot up Linux Mint from a Live CD, I am able to save files to the "File System". But where are these files being saved to? Can't be the disc, since it's a CDR. I don't think it's stored in the RAM, because it can only hold so much data and isn't really intended to be used as a "hard drive". The only other option is the hard drive... but it's certainly not saving to any partition on the hard drive I know about, since none of them are mounted. Then where are my files being saved to??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
不管你信不信,它是一个 ramdisk :)
所有实时发行版都会在 RAM 内存中安装一个临时硬盘。这个过程是完全对用户透明的,这一切都归功于 Linux 内核的魔力。
事实上,操作系统首先将 RAM 内存区域分配到虚拟设备中,然后将其作为常规硬盘驱动器安装到文件系统中。
一旦重新启动,您就会丢失该内存驱动器中的所有数据。
几乎所有在 Live CD 上运行的软件都需要 Ramdrive。事实上,几乎所有程序,特别是桌面管理器,都是为了在执行期间写入文件(甚至是临时文件)而设计的。
例如,有两种方法可以在 Live CD 上运行 KDE:要么深入修改其代码以禁止更改壁纸等(桌面设置存储在 ~/.kde 中),要么将其重新部署到可写文件中系统(例如内存驱动器),以避免只读文件系统上的写入失败。
显然,您可以将真实的 HDD 或任何 USB 驱动器安装到虚拟文件系统中,并使对它们的所有写入永久化,但默认情况下,没有实时发行版会将您的驱动器安装到根文件系统中,而是它们通常安装到特定的子目录中,例如 /mnt、/media、/windows
希望对您有所帮助。
Believe it or not, it's a ramdisk :)
All live distros mount a temporary hard disk in RAM memory. The process is completely user-transparent and is all because of the magic of Linux kernel.
The OS, in fact, first allocates an area of your RAM memory into a virtual device, then mounts it as a regular hard drive in your file system.
Once you reboot, you lose all your data from that ramdrive.
Ramdrive is needed by almost all software running on Live CDs. In fact, almost all programs, in particular desktop managers, are designed in order to write files, even temporary, during their execution.
As an example, there are two ways to run KDE on a Live CD: either modify its code deeply in order to disallow you to change wallpaper etc. (the desktop settings are stored inside ~/.kde) or redeploy it onto a writable file system such as a ramdrive in order to avoid write fails on read-only file systems.
Obviously, you can mount your real HDD or any USB drive into your virtual file system and make all writes to them permanent, but by default no live distro mounts your drives into the root file system, instead they usually mount into specific subdirectories like /mnt, /media, /windows
Hope to have been of help.
它确实使用 RAM 来模拟磁盘;来自 维基百科:
It does indeed emulate a disk using RAM; from Wikipedia:
内存。在 Linux 以及大多数 UNIX 系统中,任何类型的设备都被视为文件系统。
例如,要获取 Linux 上的内存信息,请使用
cat /proc/meminfo
,其中cat
用于读取文件。然后,还有各种奇怪的东西,例如/dev/random
(读取随机垃圾)和/dev/null
(扔掉垃圾)。 ;-)RAM. In Linux, and indeed most unix systems, any kind of device is seen as a file system.
For example, to get memory info on linux you use
cat /proc/meminfo
, wherecat
is used to read files. Then, there's all sorts of strange stuff like/dev/random
(to read random crap) and/dev/null
(to throw away crap). ;-)为了使其持久化 - 使用 USB 设备 - 正确格式化并具有特殊名称。参见这里:
https://help.ubuntu.com/community/LiveCD/Persistence
To make it persistent - use a USB device - properly formatted and with a special name. See here:
https://help.ubuntu.com/community/LiveCD/Persistence