翻译:Howto resize slaxsave.dat

请有兴趣同志翻译一下这篇文档,来自slax的论坛,很有用。

Howto resize slaxsave.dat 

I have slax standard edition installed on a fat32 partition on my hard disk. I start it using the linux.bat / loadlin.exe as found in the /boot/dos directory.
I had previously setup a 512Mb slaxsave.dat and, as it worked very well and reliably, I decided that a bigger one would be useful. But, I had already made lots of changes and really didn't want to lose any data. Changing over to a 1Gb slaxsave.dat wasn't as easy as expected, and in the process I learned a lot about how slax works, even though I don't understand it all, or even at all!
So this is a guide for others to follow.

We don't want to overwrite our original slaxsave.dat by the new unzipped file, so RENAME it first!!!
Now let us get down to business.

First of all, the zip files of the variously sized slaxsave.dat's may be corrupt, or perhaps they just don't like being extracted by Windows' Winzip. Whatever, the 1Gb size didn't work for me. After unzipping, I found it was necessary to test them first. This is done by mounting them using slax with a sequence of commands something like this...

mkdir /mnt/temp1
mkdir /mnt/temp2
mount -t xfs /mnt/hda1/slaxsave.dat /mnt/temp1 -o loop

The first two lines prepare extra mount points for our use. The mount command is straightforward enough, but we are interested in the result. You would have to "dmesg | tail" to see the results after an error.

Possibility one. No message occurs after the mount command, you just get a new prompt.
Meaning - slaxsave.dat is good and NOT mounted at startup.

Possibility two. Message reads...
XFS:Filesystem loop27 has duplicate UUID - can't mount
Meaning - slaxsave.dat has already been mounted by the system and is in use.

Possibility three. Long error message from mount. Dmesg | tail gives...
XFS: bad magic number
XFS: SB validate failed
Meaning - slaxsave.dat is corrupt.

Let us consider possibility three first. You have to make a new filesystem on it first. cd to /sbin, then "mkfs.xfs /mnt/hda1/slaxsave.dat". You'll get a lot of lines afterwards which you probably wont understand. Nevermind, just try to mount it again as above. Now you should get no error message - i.e. possibility one. If this doesn't work, ditch it and start again.

Now possibility two tells us that we can't work on this file when it is in use. OK, I can live with that!

Possibility one is the confusing aspect. Why isn't it used by the system? From what I have read on this forum, a slaxsave.dat will automatically be found by slax. NOT so! It needs the "changes=/mnt/hda1/slaxsave.dat". Even more confusing is the fact, verified by experiment, that slaxsave.dat cannot be on the same partition as the slax system. (My system is on hda5)

OK, now we have two files; let us avoid all confusion and rename both files - original and new slaxsave.dat's - to something ridiculous, and move them to a different partition if necessary. Edit /boot/dos/config to remove any "changes=" so that next we can fire-up slax WITHOUT any slaxsave.dat

Oh, more confusion! No slaxsave.dat should mean not enough memory available. (I only have 256Mb RAM) But no, slax has found some extra space somewhere according to "df -h". Where the hell did that come from?
Whatever, to save memory, we wont "startx" since the GUI isn't necessary.
Remember, you have to make the mountpoints again - mkdir /mnt/temp1 and 2 as before.
Now mount both slaxsave.dat's (remember - they should have your ridiculous names) on /mnt/temp1 and /mnt/temp2. Get the order correct! Original first, then new one.
Mounted OK?
Copy the original to the new one.
cd /mnt/temp1
cp -dpR * /mnt/temp2

At least two warning messages appear but ignore them - a warning isn't an error!

All OK? Do a "df -h" and you should now see both temp1 and temp2 listed. Hey! The files aren't the same "Used" figure! Surely they should be if they are identical??? Apparently NOT - and I don't understand this either but just accept it.

Fine! umount both and then edit 'config' to include "changes=/mnt/hda1/ridiculous.shit" or just rename the new file to slaxsave.dat again if you so wish.

Strange, it doesn't seem to matter if you use /dev/hda1 or /mnt/hda1 in the "changes=" line. I guess the partition is already mounted anyway before this line takes effect.

Reboot with your fingers crossed.
Hopefully, your new slaxsave.dat is fully functional.

I expect many more experienced readers will ask "Why not just use the live, working system to copy the data to just one mounted slaxsave.new

slaxsave.dat must be mounted somewhere! Yes, it's in /mnt/live/memory and it consists of three folders - changes, images and modules.

In theory, from /mnt/live/memory you should be able to...
cp -dpR * /mnt/temp1

I tried it and it didn't work! I really don't know why.

Anyway, I got it working eventually as you have seen.
Probably many readers don't know how to use slax on a harddisk so I'll include a little extra stuff here.

Copy everything from the slax CD to a folder named 'slax' or 'popcorn' or 'killbill" - your choice!
Then find the /boot/dos folder inside and edit "config".

Any required cheatcodes are placed on the first line after ../vmlinuz WITHOUT the word slax!
e.g. ../vmlinuz changes=/mnt/hda1/slaxsave.dat

Add a new line at the end...
from=/dev/hda5/slax
(change the disk partition as needed and your chosen foldername!)

Now you can start from DOS by cd'ing to the \slax\boot\dos directory and typing "linux" - just remember to use the Windows/DOS slashes! Stuck on Windows? Press F8 repeatedly as your computer starts until the boot menu appears, then choose 'safe mode command prompt'

I hope this helps to make slax more enjoyable for you.

由 wjping119 于 周日, 04/29/2007 - 19:27 提交。
abong 的头像

如何更换slaxsave.dat的文件大小?(版本v0.1直译)

如何更换slaxsave.dat的文件大小?

我在硬盘的FAT32区分安装了slax标准版,用/boot/dos目录下的linux.bat / loadlin.exe来启动。
我已经有了一个512MB的slaxsave.dat,内容经过长期积累而相当好且性能可靠。但我想,一个更大slaxsave.dat将更有用。不过,这个512MB的文件经过我很多改动,我不想丢失其中的任何数据。
改用一个1GB的slaxsave.dat并不是预期的那么容易,在这个过程中,我学到了很多关于如何slax运作的机制,尽管我没有根本明白所有的一切。

因此,这是一个引导用户一步一步跟着做的操作指南。

我们不想用新解压的文件复盖原来的slaxsave.dat,因此先重命名一下!!!
现在让我们脚踏实地地干活吧

首先,各种大小的slaxsave.dat文件的ZIP压缩包可能被破坏,或者用WINDOWS下的Winzip解压出来的可能不行。不知何原因,我就开始用不了1GB大小的。解压后,我觉得有必要先来测试他们的正常与否。
以下是用slax来挂载slaxsave.dat的命令序列:

mkdir /mnt/temp1
mkdir /mnt/temp2
mount -t xfs /mnt/hda1/slaxsave.dat /mnt/temp1 -o loop

头两行命令准备供我们使用的额外挂载点。
挂载命令直截了当,但我们关心的是其结果。
你可以通过"dmesg|tail"命令来看结果有没错误信息。

可能性之一:
挂载命令执行后没有信息发生,马上回到提示符。意味着slaxsave.dat是完好的,并且没有在这之前挂载。
可能性之二:
显示如下信息
XFS:Filesystem loop27 has duplicate UUID - can't mount
Meaning - slaxsave.dat has already been mounted by the system and is in use
表示slaxsave.dat已被系统挂载使用。
可能性之三:
挂载过程中出现较长的错误信息,通过 Dmesg | tail 命令显示如下:
XFS: bad magic number
XFS: SB validate failed
表示slaxsave.dat已经损坏。

让我们先考虑第三种可能性,你必须要新建一个新的文件系统。改变目录到/sbin,然后 "mkfs.xfs /mnt/hda1/slaxsave.dat",你会看到不少行信息出来。或许你不大明白,没关系,只要照着以上命令试一下就可以。现在你应当不会看见出错信息,正如第一种可能性那样。如果这还不奏效的话,重新从头做起吧。

第二种可能性告诉我们,当这个文件在使用时我们不能重新挂载。好,我们继续使用吧!

第一种可能性是个令人困惑的问题。为何它不会被系统所用? 我看过论坛,说slaxsave.dat会被SLAX自动发现并启用,但事实绝非如此! 它需

要"changes=/mnt/hda1/slaxsave.dat"这句启动代码。让人更迷惑的事实是,我做了试验进行验证,slaxsave.dat文件不能在与slax系统同一

分区上(我的SLAX系统是在hda5上) 。

好,现在我们有两个文件,为避免混淆将原始的和新的slaxsave.dat文件重命名,如果有必要,将他们移到一个不同的分区。修改/boot/dos/config 文件,删除任何 "changes=" 以便下次可以启动时没有用slaxsave.dat文件。

哦,更糟了! 没有用slaxsave.dat将意味着没有足够大的内存(我只有256mb内存)。 但是不要紧,slax可以用"df -h"命令找到一些额外的剩余空间。 Where the hell did that come from?
无论如何,为节省内存,我们没有必要进入图形界面就不用运行startx了。
请记住,你必须要两次创建2个挂载点,用如前面所述的mkdir /mnt/temp1(2)命令。
Now mount both slaxsave.dat's (remember - they should have your ridiculous names) on /mnt/temp1 and /mnt/temp2.
现在把2个slaxsave.dat文件都挂载起来(别忘了他们应该有你给的2个不同的名字),分别挂在/mnt/temp1和/mnt/temp2。保持正确的顺序,先挂载原来的先挂新的一个。

挂载好了吧? 用以下命令把原来的所有内容复制到新的地方:
cd /mnt/temp1
cp -dpR * /mnt/temp2

至少会有两个警告信息显示出来,但可以忽略他们,毕竟是警告而不是错误嘛!

都复制好了吗?
运行一下"df -h",你现在应该看到temp1和temp2已经列在其中。嘿! 这2个系统文件中的文件居然是不相同的"Used"占用量!如果他们是相同的,当然应该一样啊? 可现实情况是显然不一样,虽然我不明白这其中道理,但只能接受它。

好! 卸除(umount)这2个文件,然后编辑'config'文件,包含"changes=/mnt/hda1/ridiculous.shit"这一行,注意ridiculous.shit应该是你刚刚更名的新slaxsave.dat文件。

奇怪的是,在"changes="这一行中用/dev/hda1或/mnt/hda1似乎都没有问题,我猜想在这一行生效之前分区已经挂载。

动动你的手指,让系统重启。但愿你的新slaxsave.dat文件没问题。

我想会有很多的有经验的读者会问:“为什么不直接把工作中的slaxsave.dat数据复制到一个已经挂载的新slaxsave.new?”

slaxsave.dat必须挂载在某个地方! Yes, it's in /mnt/live/memory and it consists of three folders - changes, images and modules.

没错,就挂在/mnt/live/memory,它包含三个文件夹:changes(更改)、images(图象)和modules(模块单元)。

从理论上讲,在/mnt/live/memory你应该可以...
cp -dpR * /mnt/temp1

我试了,但它没有如我所愿! 我真的不知道原因何在。

不管怎样,我用前面所示的方法成功了。

也许很多读者还不知道如何使slax安装一个硬盘,所以我还是在这里提一下吧。

拷贝slax光盘中的所有文件及文件夹到硬盘中一个自己命名的(如'slax'或'popcorn'或'killbill")文件夹!
然后找到/boot/dos文件夹,编辑其中的"config"文件。

任何所需的启动参数(cheatcodes)都放在第一行的../vmlinuz之后,
例如: ../vmlinuz changes=/mnt/hda1/slaxsave.dat

在最后添加一行...
from=/dev/hda5/slax
(根据你的实际情况改变磁盘分区和文件夹名称!)

现在你可以从dos中进入\slax\boot\dos目录,打入"Linux"即可从硬盘启动SLAX。注意Windows和DOS下的目录分隔符是左上到右下的斜线符!

能在WINDOWS中的DOS窗口中用吗?不行,必须要纯DOS。在安装WINDOWS98的电脑启动后,重复按F8键显示开机菜单,然后选择''safe mode command prompt(安全模式命令提示符)' ,这样就进入纯DOS了。

我希望这篇文档会让你更喜欢SLAX。

abong神速

abong神速Laughing

abong 的头像

夸奖啦

夸奖啦,Bug多多啊

abong 的头像

我来翻译看看

:)