Does puppy write to NTFS system disk without asking?[Solved]

Using applications, configuring, problems
Message
Author
carolus
Posts: 128
Joined: Wed 14 Feb 2007, 21:54

Does puppy write to NTFS system disk without asking?[Solved]

#1 Post by carolus »

"Unfortunately Puppy requires a swap file or volume while booting; if a linux swap partition is not available it will CREATE a swap file WITHOUT ASKING."

http://www.murga-linux.com/puppy/viewtopic.php?t=36856

I just came across this in an old thread and wondered if it is still true. And if true, where the swap file is created - on the system disk (NTFS in my case) or on the USB drive where the pup save file is located..
Last edited by carolus on Sat 08 Jan 2011, 16:01, edited 1 time in total.

User avatar
linuxsansdisquedur
Posts: 248
Joined: Tue 13 Jan 2009, 21:17
Location: South of France

#2 Post by linuxsansdisquedur »

Running on live cd mode puppy do not add anything. 8)
You have to create a swap if necessary where you want and puppy will find it. :wink:
le max avec le min

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#3 Post by Béèm »

carolus, You should have read the whole thread.
Barry has stopped creating a swap file automatically, somewhere around the 2.x

So there is no need to worry about it.
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

carolus
Posts: 128
Joined: Wed 14 Feb 2007, 21:54

#4 Post by carolus »

Beem wrote:

Barry has stopped creating a swap file automatically, somewhere around the 2.x

Barry wrote:

Note also, this automatic creation of a swapfile, named 'pupswap.swp', existed in the 'rc.sysinit' script in the Puppy 3.x series (I don't recall about the 2.x series), and I removed it for the 4.x series. Now I have brought it back, but now creating it at the first shutdown.

http://bkhome.org/blog/?viewDetailed=00863

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#5 Post by Béèm »

Thanks for the reference.
So indeed on systems with 256MB or less, it is created.

All I can say is to ask Barry to make this an option.

Also I saw a lot of posts from people with 128MB and they didn't have a swap file altho they had a save file. Some had even be persuaded to create one.

But if you create the save file on your ntfs partition, why are you upset about the swap file?
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

carolus
Posts: 128
Joined: Wed 14 Feb 2007, 21:54

#6 Post by carolus »

Béèm wrote:
But if you create the save file on your ntfs partition, why are you upset about the swap file?
I don't write anything to my NTFS system disk. I only (knowingly) write to a FAT flash drive. For a while I was using a swap file on the flash drive with Puppy 2.16, so I know that can be done. I would have no complaint about an automatic swap file as long as that is where it is placed and not on my NTFS system disk.

When I ran puppy on all the display laptops at the local Best Buy, to find one that played well with puppy, I did not think there was any risk of writing to their hard drives except by blunder. I suppose there was indeed no risk, since no new computer has 256 MB or less. My present computers all have at least 512 MB, and "free" shows no swap memory.

Nevertheless, I think a warning and an option are appropriate before writing to an NTFS file system. Or at least a conspicuous README that describes exactly when this can occur, where the file is created, and whether it is permanent or deleted on poweroff.

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#7 Post by Béèm »

You know now that a wap file can be automatically created when you create a save file.
So if you don't want it to be written to a ntfs partition, don't create your save file on it.

Now if you want some warning, you have to convince Barry Kauler of this.
You can also PM this.

But bear in mind that writing to ntfs is considered save now.

I do write to ntfs on which my windows still is, but only the necessary files to boot from. The partition is not mounted then, which is what I want also.
My save file and swap is on a vfat partition.

I have another ntfs partition, which I use to share data. I have no problems running this.
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#8 Post by Flash »

I agree with Béèm, that writing to NTFS from Puppy is perfectly safe. I've been sharing a NTFS partition between various versions of Puppy, and Windows XP and 2000 for over 5 years. The only problem I ever had, which may have been caused by Windows (Windows could still tell a deleted file was there but couldn't do anything with it) was quickly fixed by Puppy if I remember right, and no data was lost or corrupted. That happened twice when I first started using Puppy.

carolus
Posts: 128
Joined: Wed 14 Feb 2007, 21:54

#9 Post by carolus »

Béèm wrote:You know now that a swap file can be automatically created when you create a save file. So if you don't want it to be written to a ntfs partition, don't create your save file on it.
That is a lot to infer from what little documentation I have found so far. You mean the automatic swap file is available only after rebooting? Then the swap file must not be necessary to boot puppy, so why make it automatic? If it is only to improve performance on a low-memory system, then make it an option, with a choice of where to put it. I don't understand Barry''s comment "Now I have brought it back, but now creating it at the first shutdown."

My chief concern now is about booting Puppy on someone else's computer. Can I tell them there is no risk? How can I ensure there is no risk?

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#10 Post by Flash »

If I understand correctly, using the "puppy pfix=ram" boot option forces Puppy to load entirely into RAM without looking for save files and the like. Puppy will still look for swap partitions, and will use them if it finds them, but will not create them.

That's my understanding of how the pfix=ram boot option works. Try it on a low-RAM computer to see what happens. I don't have one handy.

User avatar
linuxsansdisquedur
Posts: 248
Joined: Tue 13 Jan 2009, 21:17
Location: South of France

#11 Post by linuxsansdisquedur »

running pizzapup (with really puppy 2.14 inside :wink: ) i find in /etc/rc.sysinit

Code: Select all

if [ "$PUPMODE" = "12" ];then
 if [ -f /initrd/mnt/dev_save/pupswap.swp ];then
  echo -n "Activating swap file /initrd/mnt/dev_save/pupswap.swp..." >/dev/console
  swapon /initrd/mnt/dev_save/pupswap.swp;check_status $?
 else
  #only create a swap file if no swap partition...
  if [ "`free | grep 'Swap:' | tr -s " " | cut -f 3 -d " "`" = "0" ];then
   #v2.02final for now, no auto creation of swap on ntfs partition...
   if [ ! "`echo -n "$PUPSAVE" | cut -f 1 -d ',' | grep --extended-regexp 'msdos|vfat|ext2|ext3|reiserfs|minix'`" = "" ];then
so serie 2 use after 2.02 seem to use swap file but not to create it... 8)
le max avec le min

carolus
Posts: 128
Joined: Wed 14 Feb 2007, 21:54

#12 Post by carolus »

In 5.1.1 there is no /etc/rc.sysinit. In init, I don't recognize code that creates a swapfile, only code that detects a swapfile, and grepping on comment lines that contain the word "swap" did not reveal anything. But I'm not very good at reading big scripts, and maybe there are other relevant scripts hidden somewhere.

ICPUG
Posts: 1308
Joined: Mon 25 Jul 2005, 00:09
Location: UK

#13 Post by ICPUG »

I'm sure I read recently that a swap file would not be created unless an ext? partition was available?

In Puppy 4 Barry copied the .sfs file to NTFS partitions without asking, unless it was already there. This was only recently removed from his woof system so it no longer applies to anything built from the latest woof (Quirky 1.4, Wary 5, Lucid 5.2 when it appears).

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#14 Post by Béèm »

carolus wrote:In 5.1.1 there is no /etc/rc.sysinit. In init, I don't recognize code that creates a swapfile, only code that detects a swapfile, and grepping on comment lines that contain the word "swap" did not reveal anything. But I'm not very good at reading big scripts, and maybe there are other relevant scripts hidden somewhere.
There is probably a typo of linuxsandisquedur. Without a rc.sysinit your system would not come to the desktop. rc.sysinit is somwhere in the /etc/.... hierarchy.
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

User avatar
linuxsansdisquedur
Posts: 248
Joined: Tue 13 Jan 2009, 21:17
Location: South of France

#15 Post by linuxsansdisquedur »

There is probably a typo of linuxsandisquedur
there is :? you have to read /etc/rc.d/rc.sysinit :!: (on pizzapup/2.14pupplet :wink: )
le max avec le min

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#16 Post by Béèm »

There are differences between versions.
Following is code in the rc.shutdown script in the same directory as rc.init in Lucid 519. BTW rc.init here doesn't have code to create a swap file/partition.

Code: Select all

#w481 if low-ram, save-file is on a fast media, and no swap file/partition, then create one...
#note, rc.sysinit in puppy 3.01 had code to create a pupswap.swp, not in 4.x series.
swapfile_func() {
 localSMNTPT="$1"
 localSAVEPART="$2"
 if [ ! -f ${localSMNTPT}/pupswap.swp ];then
  if [ "$ATADRIVES" ];then #see /etc/rc.d/PUPSTATE 100912
   TOTALRAM=`free | grep 'Mem:' | tr -s ' ' | cut -f 3 -d ' '`
   if [ $TOTALRAM -lt 262145 ];then #was 128000, bump up <=256MB.
    TOTALSWAP=`free | grep 'Swap:' | tr -s ' ' | cut -f 3 -d ' '`
    if [ $TOTALSWAP -eq 0 ];then
     spPATTERN="`echo -n "$localSAVEPART" | sed -e 's/[0-9]*$//'` " #100912 ex: 'sda '
     if [ "`echo "$ATADRIVES" | grep "$spPATTERN"`" != "" ];then #100912
      smPATTERN=' '"$localSMNTPT"'$'
      FREESAVEM=`df -m | grep "$smPATTERN" | tr -s ' ' | cut -f 4 -d ' '`
      SWPSIZE=""
      [ $FREESAVEM -gt 100 ] && SWPSIZE="50"
      [ $FREESAVEM -gt 200 ] && SWPSIZE="100"
      [ $FREESAVEM -gt 500 ] && SWPSIZE="200"
      if [ "$SWPSIZE" ];then
       echo  >/dev/console
       echo "A swapfile named 'pupswap.swp' is being created in partition ${localSAVEPART}," >/dev/console
       echo "of size ${SWPSIZE}MB. This will be loaded at next boot, to ease the low-RAM" >/dev/console
       echo "situation of your PC. Creating now..." >/dev/console
       dd if=/dev/zero of=${localSMNTPT}/pupswap.swp bs=1048576 count=$SWPSIZE
       if [ $? -eq 0 ];then
        sync
        mkswap ${localSMNTPT}/pupswap.swp
       fi
       if [ $? -ne 0 ];then
        rm -f ${localSMNTPT}/pupswap.swp 2>/dev/null
	echo "...error, unable to create swapfile." >/dev/console
       fi
       sync
      fi
     fi
    fi
   fi
  fi
 fi
} #end swapfile_func
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

carolus
Posts: 128
Joined: Wed 14 Feb 2007, 21:54

#17 Post by carolus »

carolus wrote:In 5.1.1 there is no /etc/rc.sysinit. In init, I don't recognize code that creates a swapfile
I was just looking in initrd (which can be read with 7zip directly from the iso, without burning and booting). I now realize that a lot of the boot code is in the squash file.

carolus
Posts: 128
Joined: Wed 14 Feb 2007, 21:54

#18 Post by carolus »

Béèm wrote: Following is code in the rc.shutdown script in the same directory as rc.init in Lucid 519.]
Thanks. I interpret this as showing that there no risk of creating an automatic swap file whenever memory > 256MB.

But why not ask permission before proceeding? It should be no big nuisance since this condition occurs only on first boot.

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#19 Post by Béèm »

carolus, you should ask that to the person who developed the script, which is Barry Kauler.
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

carolus
Posts: 128
Joined: Wed 14 Feb 2007, 21:54

#20 Post by carolus »

Béèm wrote:carolus, you should ask that to the person who developed the script, which is Barry Kauler.
He seems to follow these discussions, and could not have the time to justify every decision he makes. But I remain curious.

Post Reply