Page 1 of 1

Renaming .2fs files

Posted: Thu 17 Sep 2009, 08:29
by cichlasoma
Hi. I'd just like to make sure, it shouldn't be a problem to rename a saved .2fs files changing the part of the file name following the hyphen.
(I do believe, I lost some of the changes I made in my session after rebooting to a renamed .2fs file and I don't know whether I should associate it with the renaming action. After rebooting, Puppy reported something about not finishing correctly last time, unfortunetally I closed the window too hastily before reading it carefully, yet I'm sure, there didn't seem to be anything special about the last shut-down.)

Posted: Thu 17 Sep 2009, 09:47
by disciple
Don't rename, delete or replace a save file while it is in use - the space it occupied on your hard drive will disappear, and you won't be able to get it back until you defragment your hard drive.
If you do so, I presume something weird will happen at shutdown or whatever, although I wouldn't have thought you'd lose much.

If you need to rename, delete or replace a save file, do it when it isn't in use, e.g. by booting using a different save file, with pfix=ram, or into a different operating system.

You can safely copy a save file that is in use - when you boot from the copy it will just tell you X didn't exit correctly and type xwin to start it.

Posted: Thu 17 Sep 2009, 10:00
by cichlasoma
Thank you for assurance, disciple!
(I renamed (and moved) the .2fs file when it wasn't in use, of course. The mentioned message I closed was probably the one about X having not exited correctly. I don't know why I lost part of the changes (if it actually happened as I'm convinced it did), yet I'm glad I really can freely move and rename save-files not being in use.)

Posted: Sun 27 Sep 2009, 15:08
by cichlasoma
disciple wrote: You can safely copy a save file that is in use - when you boot from the copy it will just tell you X didn't exit correctly and type xwin to start it.
Is it really safe even in case of a frugal install on a hard drive, especially when other processes run at the same time (which, as far as I can understand the matter, means, the savefile can change while being copied)?

Posted: Sun 27 Sep 2009, 21:21
by Pizzasgood
I used to do that a lot and never had any problems. But that's not the same as saying it's safe. There's always the chance that something could go wrong. The thing to consider is whether any programs are running that might write to the disk, such as the browser, email client, any program that autosaves, etc. If there are, close them. Also, run sync to flush any buffered writes down into the pup_save.2fs file (not the same as what happens with Flash drives and Puppy - that's a different sort of buffering). That way there should be little chance that any files are being written. You may also want to use the pfix=fsck option when booting the new save file.

Posted: Tue 29 Sep 2009, 16:25
by cichlasoma
Pizzasgood wrote:I used to do that a lot and never had any problems. But that's not the same as saying it's safe. There's always the chance that something could go wrong. The thing to consider is whether any programs are running that might write to the disk, such as the browser, email client, any program that autosaves, etc. If there are, close them. Also, run sync to flush any buffered writes down into the pup_save.2fs file (not the same as what happens with Flash drives and Puppy - that's a different sort of buffering). That way there should be little chance that any files are being written. You may also want to use the pfix=fsck option when booting the new save file.
I've tried to check md5 of the copied file (I ran no sync) and in the both cases, I've got different results then for the original, (Unfortunately, I'm afraid, I copied the savefiles I use in this way... :-( )

Posted: Fri 02 Oct 2009, 19:44
by Pizzasgood
The pup_save.2fs file is a filesystem image. That means that it isn't only storing the files themselves. It's also storing all their metadata, such as access times. If you access any file or directory, the access time will be updated, which will result in an update to the pup_save.2fs file. So I think it is probably impossible to both create an md5 sum of the pup_save.2fs file and also an exact copy of the file as it was prior to the md5sum use, unless you copy the 'cp' and 'md5sum' programs out into the harddrive and use those copies for the tasks (because running a program results in accessing the program's executable). And there's still the possibility of some daemon or running process to access a file...

The only surefire method to make and verify an exact copy is to not try copying a mounted image - i.e. using pfix=ram instead.