Page 1 of 1
Delete files from pupp.sfs main file keep coming back why?
Posted: Tue Dec 14, 2021 2:35 am
by Mike3
So I got an older computer working and I used a harddrive I've used with the computer before that had puppy ready installed.
But then the mouse didn't work, so I tried starting the computer in: SAFE MODE (without X).
So after that I installed puppy from there onto a USB and it works to start up and everything and the mouse works.
Then I wanted to remove permanently some files that are part of the main sfs file (puppy_linux...sfs). So I did the:
# unsquashfs puppy_linux...sfs command in terminal, deleted the files and then did the:
# mksquashfs squashfs-root puppy_linux...sfs command in terminal to save to a new main sfs.
Then I deleted the old sfs and put in this new one where the old one was.
The main sfs file and kernel is in:
mnt/home
So then after save and restart I check and the files that I deleted are back! The are like under:
/root .... and so on.
Why are they not deleted? Is this because I loaded from a USB? and it still reads in files from the harddrive?
Or doesn't the unsquashfs and mksquashfs commands work as I thought are there any other files I have to change other than the main sfs file?
Is it because I installed puppy on the USB from the safe mode (without x)?
Re: Delete files from pupp.sfs main file keep coming back why?
Posted: Tue Dec 14, 2021 2:55 am
by TerryH
Check you savefile/save folder, they may be in there.
Re: Delete files from pupp.sfs main file keep coming back why?
Posted: Tue Dec 14, 2021 3:04 am
by Mike3
There aint no save folder I saved to the whole partition of the USB at first shutdown.
I noticed that the main: pupp_linux...sfs file was also in :
/
And not just in:
mnt/home when I restarted the computer from the USB. So it seems to have been copied there automatically it was not there on the first restart. Weird?
Re: Delete files from pupp.sfs main file keep coming back why?
Posted: Tue Dec 14, 2021 6:29 am
by Phoenix
Can you show a tree diagram of how your system is laid out (filesystem only)
Including any base .sfs files located on other partitions/devices.
And you don't have a savefile/savefolder? (Savefiles are typically .2fs, .3fs, or .4fs)
Re: Delete files from pupp.sfs main file keep coming back why?
Posted: Tue Dec 14, 2021 3:31 pm
by snoring_cat
Hi Mike3,
I don't know which Puppy Linux distribution you are using, so will provide some commands that should work across all versions. If you run "df -h | grep initrd", you should see some mount points that puppy uses for system level SFS files. For example, on FossaPup 64, I get the following
Code: Select all
df -h | grep initrd
/dev/loop0 132M 132M 0 100% /initrd/pup_ro2
/dev/loop1 40M 40M 0 100% /initrd/pup_f
/dev/loop2 27M 27M 0 100% /initrd/pup_z
/dev/loop3 1.1G 1.1G 0 100% /initrd/pup_a
The main Puppy Linux is usually mounted read-only at /initrd/pup_ro2. If you can see the files that you thought your removed in that folder, then
You did not remove the files from the SFS file. One test to do is to create a new blank file somewhere that will be visible when re-creating the SFS file again. This way you can confirm you are looking at the right SFS file content on reboot. Then you can remove the file from the SFS file and try to see if it goes away
Your system is mounting a different SFS than you think during boot up. This can happen, for example, when booting from USB, but have your main SFS file also located on an internal hard drive. Puppy will prioritize the hard drive version of the same file
Even though you did remove the file correctly from your wanted SFS file, a different SFS file might have that file, and is loading it
Even though you did remove the file correctly from your waned SFS file, your savefile might have that file, and is loading it
Some code might be generating the file you are removing automatically. We would need to know a filename you are having problems with to research this
I modifiy my SFS files all of the time, so it is possible. I don't use the unsquashfs commands, but don't think that is your problem.
Re: Delete files from pupp.sfs main file keep coming back why?
Posted: Tue Dec 14, 2021 5:04 pm
by Mike3
Hi snoring_cat
Ok so it seems a lot of the file system is duplicated so I have a lot of the same files in the top directory:
/
as I have in the
/mnt/home directory.
I assume this is because the top directory is RAM and USB is copied there at start is this so?
I have attached pictures of the two folders.
I also did the: # df -h | grep initrd and did see that there is a pup_ro2 file.
There is a bunch of files I wanna delete. But for starters i want to get rid of the: pnscan files.
snoring_cat wrote: ↑Tue Dec 14, 2021 3:31 pm
Your system is mounting a different SFS than you think during boot up. This can happen, for example, when booting from USB, but have your main SFS file also located on an internal hard drive. Puppy will prioritize the hard drive version of the same file
If that's the case how do I make it boot from the sfs on the USB? Can it be done with some setting?
snoring_cat wrote: ↑Tue Dec 14, 2021 3:31 pm
Even though you did remove the file correctly from your wanted SFS file, a different SFS file might have that file, and is loading it
So I have to unsquashfs all sfs files? Which ones should I go for normally? The; adrv, fdrv & zdrv.sfs's or other ones?
snoring_cat wrote: ↑Tue Dec 14, 2021 3:31 pm
Some code might be generating the file you are removing automatically. We would need to know a filename you are having problems with to research this
How do I find this code if so?
snoring_cat wrote: ↑Tue Dec 14, 2021 3:31 pm
I modifiy my SFS files all of the time, so it is possible. I don't use the unsquashfs commands, but don't think that is your problem.
How do you do it if you don't use the unsquashfs command?
Re: Delete files from pupp.sfs main file keep coming back why?
Posted: Tue Dec 14, 2021 5:10 pm
by Feek
Mike3 wrote: ↑Tue Dec 14, 2021 2:35 am
Then I wanted to remove permanently some files that are part of the main sfs file (puppy_linux...sfs). So I did the:
# unsquashfs puppy_linux...sfs command in terminal, deleted the files and then did the:
# mksquashfs squashfs-root puppy_linux...sfs command in terminal to save to a new main sfs.
If you really need to remove something from the main sfs file, I saw a method for it from taersh (see on the picture).
I personally never needed to do this.
It seems that the linux partition is important here to achieve proper result with UExtract and PackIt.
There are more types of compression of mksquashfs in PackIt and I don't know which is the right one.
Re: Delete files from pupp.sfs main file keep coming back why?
Posted: Tue Dec 14, 2021 5:33 pm
by Mike3
Ok, so I changed the search thing in pFind (advanced -> took away excluded which was the pup_ro2) and it turns out the pnscan file is in the pup_ro2 folder also.
Also when I do the usquashfs thing from terminal it seems that the unsquashed files end up in different places:
/squashfs-root/...
/initrd/mnt/dev_save/squashfs-root...
/initrd/mnt/tmpfs/pup_rw/squashfs-root
Do I have to delete the file from all these folders? In effect when I mksquash I just use one of these files, the /mnt/home/squashfs-root, right?
Re: Delete files from pupp.sfs main file keep coming back why?
Posted: Wed Dec 15, 2021 12:31 am
by snoring_cat
Hi again Mike3,
OK this post will just be some background. The next one will address your problem specifically
Puppy Linux mounts many filesystems (as visible from the df -h command), and layers them on top of each other. In some situation you might see duplicates, when in fact there is only one iteration of a file that is being displayed multiple times. If you think you are using a 10MB file 10 times, you might be just using 10MB of disk space.
In your situation with pnscan, you might have it in multiple locations. This is how you can check
Code: Select all
find /initrd/pup* -type f -name "pnscan" -ls
26925 31 -rwxr-xr-x 1 root root 30776 Aug 14 20:47 /initrd/pup_a/usr/bin/pnscan
26925 31 -rwxr-xr-x 1 root root 30776 Aug 14 20:47 /initrd/pup_ro2/usr/bin/pnscan
98732 1 -rw-r--r-- 1 root root 32 Aug 14 20:48 /initrd/pup_a/var/packages/builtin_files-norm/pnscan
Notice the above command returns 3 lines, meaning that there are 3 files called pnscan mounted. From observation, the actual pnscan program is in fact being duplicated at /initrd/pup_a/usr/bin/pnscan and /initrd/pup_ro2/usr/bin/pnscan. If you remove one of those from an SFS file, you would still see /usr/bin/pnscan on your system after rebooting. To remove it, you'd have to remove all iterations of the program in puppy.sfs, adrive_puppy.sfs, etc.
The SFSfiles that should containt files you want to remove are
puppy.sfs - which shows up as /initrd/pup_ro2 - contains the base puppy install and applications
adrive_puppy.sfs - which shows up as /initrd/pup_a - contains "applications" that are extra to the base puppy install.
Re: Delete files from pupp.sfs main file keep coming back why?
Posted: Wed Dec 15, 2021 12:56 am
by snoring_cat
[ Disclaimer: this method is a bit advanced, and should not be encouraged as the way to modify SFS files for most users ]
Mike3,
I think there are some problems with the way you unsquashed your files. This is what you should see at the root of your disk
Code: Select all
vmlinuz
initrd.gz
puppy.sfs
adrv_puppy.sfs
fdrv_puppy.sfs
zdrv_puppy.sfs
When you did an unsquashfs, you put the files in the same root folder as the Puppy Linux. You should put each of the unsquashed SFS file content into individual temporary folders. Then you can inspect and change the contents of each SFS file individually. For example, you can check each temporary folder for the pnscan application, and then remove it.
Unsquashing
Code: Select all
mkdir -p /unsquashed/puppy
cd /unsquashed/puppy
unsquashfs /puppy.sfs
mkdir -p /usquashed/adrv
cd /unsquashed/adrv
unsquashfs /adrv_puppy.sfs
You must make sure that when you unsquash your SFS files, that you unsquash them on a Linux filesystem
Resquashing
After you are done making modifications to files under the /unsquashed folder, you have to squash the contents back again, so that Puppy Linux can find/use the files.
Code: Select all
mkdir /newfiels
mksquashfs /unsquashed/puppy /newfiles/puppy.sfs
mksquashfs /unsquashed/adrv /newfiles/adrv_pppy.sfs
Then you can backup and replace the original files with the same name in root with the files in /newfiles/. Note that the SFS files have to have the same name as the files you go from Puppy Linux. Also note that you cannot replace any of the working files if they currently are in use booting your Puppy Linux. Hopefully you managed to boot with Puppy Linux copying all SFS files into RAM (as is evident in the bootup on-screen messages)
Some background
When you originally unsquashed files into the / root folder, you mixed unsuashed files with your original Puppy Linux files. When you go to resquash, the new SFS would be about twice the size. To prevent this, we put our files under /unsquashed to prevent this duplications
Re: Delete files from pupp.sfs main file keep coming back why?
Posted: Wed Dec 15, 2021 2:29 am
by Mike3
Hi again snoring_cat
I followed your instructions and there are two copies of the squashfs-root folder being created.
The firsts ends up in:
/unsquashed/puppy according to terminal instructions.
Then there is the duplicate at:
/initrd/mnt/tmpfs/pup_rw/unsquashed/puppy/
So it seems to have made a duplicate of the folders made also. But when I delete the 'squashfs-root' file from the directory created (/unsquashfs/puppy), it also automatically deletes it from: /initrd/mnt/tmpfs/pup_rw/unsquashed/puppy/
And I also tried deleting a single folder from the first location and then it also is deleted from the second automatically.
So it seems that I won't have to delete files in both: unsquashfs/puppy/squashfs-root and: /initrd/mnt/tmpfs/pup_rw/unsquashed/puppy/unsquashedfs-root, but just in the first location?
And if, isn't it better to just delete the whole copy folder ( /initrd/mnt/tmpfs/pup_rw/unsquashed/puppy/unsquashedfs-root)? I mean otherwise I would just find duplicate copies of everything when searching with pFind. Pr is the duplicate folder needed for something? Does it serve a purpose here?
Also, do you think the rest of files that should be deleted are located in:
adrv_puppy.sfs
Or does one usually have to check all four .sfs files (i.e. also the fdrv...sfs & zdrw...sfs).
Re: Delete files from pupp.sfs main file keep coming back why?
Posted: Wed Dec 15, 2021 2:43 am
by mikeslr
Being no further advance than an 6 year old playing with blocks, to remaster I use one of amethysts' tools. viewtopic.php?p=12983#p12983. That post specifically mentions 2. But the Suite includes an older third.
- nicOS-Utility-Suite.png (28.99 KiB) Viewed 727 times
.
They automate all the 'grunt' work and the mistakes I'd make doing that. Something worth considering.
Re: Delete files from pupp.sfs main file keep coming back why?
Posted: Wed Dec 15, 2021 4:41 am
by TerryH
Mike3 wrote: ↑Wed Dec 15, 2021 2:29 am
Hi again snoring_cat
I followed your instructions and there are two copies of the squashfs-root folder being created.
The firsts ends up in:
/unsquashed/puppy according to terminal instructions.
Then there is the duplicate at:
/initrd/mnt/tmpfs/pup_rw/unsquashed/puppy/
So it seems to have made a duplicate of the folders made also. But when I delete the 'squashfs-root' file from the directory created (/unsquashfs/puppy), it also automatically deletes it from: /initrd/mnt/tmpfs/pup_rw/unsquashed/puppy/
And I also tried deleting a single folder from the first location and then it also is deleted from the second automatically.
So it seems that I won't have to delete files in both: unsquashfs/puppy/squashfs-root and: /initrd/mnt/tmpfs/pup_rw/unsquashed/puppy/unsquashedfs-root, but just in the first location?
And if, isn't it better to just delete the whole copy folder ( /initrd/mnt/tmpfs/pup_rw/unsquashed/puppy/unsquashedfs-root)? I mean otherwise I would just find duplicate copies of everything when searching with pFind. Pr is the duplicate folder needed for something? Does it serve a purpose here?
Also, do you think the rest of files that should be deleted are located in:
adrv_puppy.sfs
Or does one usually have to check all four .sfs files (i.e. also the fdrv...sfs & zdrw...sfs).
unsquashfs makes an extracted copy of the sfs you select in an output directory squashfs-root. mksquashfs will repackage the squashfs-root directory as an sfs of a name you select. Nothing extra is being added, when the mksquashfs is executed.
You're seeing different views of the same thing. That's why when you delete from one, the other vanishes also.
In rox, click the adrv and, you will see it creates a new mount point, something like /mnt/+mnt+sdb2+adrv_yourpuppy.sfs. You can then 'view' the files which it contains. Maybe do this with all your Xdrv's + application.sfs's (select to view content, don't select to install), have a look to know what files they actually contain.
Note: Clicking on the sfs again will then unmount it. If you click on the mount point after the sfs has been unmounted, you will see an empty directory, as it is only a mountpoint, the contents has been 'removed' when the sfs is unmounted.
Re: Delete files from pupp.sfs main file keep coming back why?
Posted: Sat Apr 16, 2022 3:28 am
by Mike3
It worked a couple of times but now I have issues finding the puppy.sfs main file when unsquashing.
I first make a new directory on my USB with:
mkdir -p /mnt/sdg1/unsquasged/puppy
This makes the new directorys unsquashed and puppy no prblem but when I do the:
The I go to the directory with:
cd /mnt/sdg1/unsquashed/puppy (sdg1 is my usb).
But when I do the command
unsquashfs /puppy.sfs , it doesn't work. It sais:
Could not open /puppy.sfs, because no such file or directory
What is wrong here, it used to work. I am not that great with the commands in the terminal, but why cant it find the puppy.sfs file? How do I make sure it sees it (the puppy.sfs file) with the correct command and how do I make sure the unsquashed file ends up in the right directory?