Unsquashfs, put in different folder?

Issues and / or general discussion relating to Puppy

Moderator: Forum moderators

Post Reply
Mike3
Posts: 112
Joined: Fri Aug 28, 2020 1:26 pm
Been thanked: 1 time

Unsquashfs, put in different folder?

Post 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?

User avatar
Keef
Posts: 278
Joined: Tue Dec 03, 2019 8:05 pm
Has thanked: 3 times
Been thanked: 75 times

Re: Unsquashfs, put in different folder?

Post 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.

User avatar
fredx181
Posts: 3085
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 376 times
Been thanked: 1315 times
Contact:

Re: Unsquashfs, put in different folder?

Post 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.

User avatar
mikeslr
Posts: 2965
Joined: Mon Jul 13, 2020 11:08 pm
Has thanked: 178 times
Been thanked: 922 times

Re: Unsquashfs, put in different folder?

Post by mikeslr »

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

User avatar
Phoenix
Posts: 341
Joined: Fri Feb 12, 2021 2:03 am
Location: Canada
Has thanked: 4 times
Been thanked: 48 times

Re: Unsquashfs, put in different folder?

Post 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.

IRC: firepup | Time to hack Puppy!

superchook
Posts: 49
Joined: Mon Dec 23, 2019 9:57 pm
Location: Sydney, Australia
Has thanked: 15 times
Been thanked: 3 times

Re: Unsquashfs, put in different folder?

Post by superchook »

Just to clarify did you really type

mkdir -p /mnt/sdg1/unsquasged/puppy

as in the original post?

User avatar
mikewalsh
Moderator
Posts: 6163
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 795 times
Been thanked: 1983 times

Re: Unsquashfs, put in different folder?

Post 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. ;)

Post Reply

Return to “Users”