Renaming .2fs files

Booting, installing, newbie
Post Reply
Message
Author
cichlasoma
Posts: 69
Joined: Sun 13 Sep 2009, 01:57

Renaming .2fs files

#1 Post 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.)

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#2 Post 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.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

cichlasoma
Posts: 69
Joined: Sun 13 Sep 2009, 01:57

#3 Post 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.)

cichlasoma
Posts: 69
Joined: Sun 13 Sep 2009, 01:57

#4 Post 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)?

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#5 Post 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.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

cichlasoma
Posts: 69
Joined: Sun 13 Sep 2009, 01:57

#6 Post 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... :-( )

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#7 Post 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.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

Post Reply