Page 1 of 1

Unsquashfs, put in different folder?

Posted: Sat Apr 16, 2022 8:26 pm
by Mike3

So I wanna use unsquashfs in order to take away files permanently from the sfs files.

From what I understan, if one puts the unsquahed file in the same folder as the file one does the unsquashing to, then there is an issue that all files are doubled, duplicated which results in a larger file, so I want the unsquashed file to end up in a different folder. How do I do that?

I first make a new directory on my USB with, that is no problem and works, I use the following command:

mkdir -p /mnt/sdg1/unsquasged/puppy

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?

How does the

/

thing work after the unsquashfs command in the terminal? Does that make it look for the file in all directories / folders higher up in the folder / directory tree so to speak?


Re: Unsquashfs, put in different folder?

Posted: Sat Apr 16, 2022 8:53 pm
by Keef

You need the path to the puppy.sfs (or whatever it's name maybe). It may be simpler to copy it to the new directory and just run:

Code: Select all

unsquashfs puppy.sfs

(no "/" needed) then delete it before repacking.


Re: Unsquashfs, put in different folder?

Posted: Sat Apr 16, 2022 9:04 pm
by fredx181
Mike3" wrote:

I want the unsquashed file to end up in a different folder. How do I do that?

First, /puppy.sfs apparently doesn't exist , so you need to specify the exact path e.g. /path/to/puppy.sfs, or as Keef said, cd to the dir containing puppy.sfs and make it puppy.sfs (without the "/").
To unsquash to a directory of choice, you can use the -d switch, e.g. unsquashfs -d /mnt/sdg1/unsquashed/puppy.sfs-unsquash /path/to/puppy.sfs
Then the files will appear in puppy.sfs-unsquash folder, no need to make the directory first.


Re: Unsquashfs, put in different folder?

Posted: Sat Apr 16, 2022 10:52 pm
by mikeslr

This application might be of interest to you, nicOS-SFS-Editor, viewtopic.php?p=54846#p54846


Re: Unsquashfs, put in different folder?

Posted: Sun Apr 17, 2022 4:49 am
by Phoenix
Mike3 wrote: Sat Apr 16, 2022 8:26 pm

So I wanna use unsquashfs in order to take away files permanently from the sfs files.

From what I understan, if one puts the unsquahed file in the same folder as the file one does the unsquashing to, then there is an issue that all files are doubled, duplicated which results in a larger file, so I want the unsquashed file to end up in a different folder. How do I do that?

I first make a new directory on my USB with, that is no problem and works, I use the following command:

mkdir -p /mnt/sdg1/unsquasged/puppy

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?

How does the

/

thing work after the unsquashfs command in the terminal? Does that make it look for the file in all directories / folders higher up in the folder / directory tree so to speak?

What /puppy.sfs means the very first directory, the root, then access the puppy.sfs located there. Most likely it isn't there but you meant the current one. So simply use puppy.sfs instead of the / as said by others.

/ is the highest level there is and is called 'root'. Any program will interpret it as such and directly navigate as was written. But ./ means something else entirely. That dot right there means the current directory, so if you were in the directory foo it means foo. Then the / is essentially a divider. Of course you could have entirely dropped the ./ and wrote puppy.sfs, as it is implicitly referring to the current directory. .. means the parent directory, so if you were in /foo/bar and used .. it will refer above the directory bar.

So, / is direct.
No / or using . or .. is relative to the current directory.


Re: Unsquashfs, put in different folder?

Posted: Tue Apr 19, 2022 3:28 am
by superchook

Just to clarify did you really type

mkdir -p /mnt/sdg1/unsquasged/puppy

as in the original post?


Re: Unsquashfs, put in different folder?

Posted: Wed Apr 20, 2022 11:49 am
by mikewalsh

@Mike3 :-

Always, always, ALWAYS work on files/packages/whatever in a completely separate location. It saves confusing Puppy!

I have 4 'work-areas' on my large secondary data HDD; 'WORK-1', 'WORK-2', etc. I'm sometimes working on multiple items simultaneously, hence the multiple directories.

If it was me, I'd copy the relevant SFS (puppy.sfs?) to one of these. Then, open a terminal in that directory; Right-click in a blank part of the window->Window->Terminal here.

I'd then simply enter

Code: Select all

unsquashfs ./puppy.sfs

.....and hit Enter.

As Fred & phoenix have tried to explain, the "." tells the system you're looking in the current directory, and

Code: Select all

/puppy.sfs

.....then looks for that file in the current directory.

Having done what I wanted to with the extracted directory, I would then re-squash it again using mksquashfs:-

Code: Select all

mksquashfs{space}./whatever-the-directory-is-now-called{space}./puppy.sfs

Once the SFS file is created, swap it over with the original SFS (making a copy of the original first, just in case).

(I appreciate that you may be trying to do this the 'official' Linux way, completely via the terminal, but there IS such a thing as "over-thinking" things! I was guilty of this myself in the early days with Puppy; nowadays, I usually look for the simplest option, even if that should turn out to be a GUI option. There's no shame in it; the K.I.S.S principle is as true today as it's ever been...)

Mike. ;)