Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 23 May 2019, 05:00
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
Difference between squash archive and 2fs file?
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [10 Posts]  
Author Message
musher0

Joined: 04 Jan 2009
Posts: 14146
Location: Gatineau (Qc), Canada

PostPosted: Thu 21 Nov 2013, 01:44    Post subject:  Difference between squash archive and 2fs file?  

Hello, all.

What is the difference between a squash (sfs) archive and a 2fs file?
I see them all the time in Puppy but I never thought to ask.

What happens when I type
Code:
mksquashfs -noD file1 file2

as compared to
Code:
dd if=/dev/zero of=$NOMsave-pupsave.2fs bs=1M count=384
mkfs.ext2 $NOMsave-pupsave.2fs

?

Both create file systems in a file, don't they? I always thought 2fs
was a variant of sfs.

I hope the experts will forgive me, I'm just trying to understand and learn.

Thanks in advance for any lead.

Best regards.

musher0

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 4208
Location: Kiel,Germany

PostPosted: Thu 21 Nov 2013, 02:24    Post subject:  

You could also rename the pupsave-file.2fs to pupsave-file.ext2 . Needs of course a dozen system script files to be adjusted .
.ext2 for the extended-2 file system.

And of course pupsave-file.ext3 and .ext4 instead of .3fs and .4fs


.sfs files are compressed read-only files . Compression former was gz, now it becomes xz .

Of course not :
Quote:
I hope the experts will forgive me

Punishment : 6 weeks Ubuntu casper . Very Happy
Back to top
View user's profile Send private message 
amigo

Joined: 02 Apr 2007
Posts: 2647

PostPosted: Thu 21 Nov 2013, 02:25    Post subject:  

"file systems in a file" -exactly, they are both filesystem images. the sf2 uses ext2 filesystem. You can do the same with any filesystem supported by linux.

squashfs, like cromfs and cramfs is read-only, but images of ext/reiserfs, etc are read-write images.
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 11254

PostPosted: Thu 21 Nov 2013, 05:02    Post subject:  

Hmm I tend to think of sfs as a mountable archive and image files as virtual partitions with a filesystem in there. Virtual machines differ as their image files are effectively virtual drives so include mbrs but can be mounted like a 2fs save file by ofsetting to the partition. . Its all sneaky clever useful stuff Smile

there are lzma sfs files in the linux world too... those extra compressions do slow things down a bit I find especially during making.

mike waffle
Back to top
View user's profile Send private message 
amigo

Joined: 02 Apr 2007
Posts: 2647

PostPosted: Thu 21 Nov 2013, 08:51    Post subject:  

No, they are all mountable filesystem images -at least in this case. A *disk* image is different from a filesystem/partition image. A disk image will contain an MBR, most likely with a partition table. Sometimes these are called 'containers'. A partition/filesystem is directly mountable as a loop mount(with or without losetup). A disk image has to be first set up as a whole device using losetup. Then, partitions on that virtual disk can be mounted.

FS images of iso9660(CD/dvd), cramfs, cromfs, squashfs and others are created a little differently from read-write partition images, in that the resulting image can only be created all at once. Hence, they seem to fit the 'image' description better, but technically they are all 'images'. sfs's are not really archives -nor any of the other mentioned above -even though the creation of the read-only types above does resemble archive creation. In an archive, all items are concatenated together into a single blob which is then usually compressed.

The kernels ability to virtualise things makes it possible to treat all these very distinct things in a similar way. User-space virtual file systems let you *mount* archives, and you can also apparently extract a disk image without having to mount it. But, it's the smoke and mirrors in the kernel/user-space that make it seem transparent to us.
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 11254

PostPosted: Thu 21 Nov 2013, 09:13    Post subject:  

Defining the awkward to define. I find sfs a little mystery as the component parts of the file system...eg inodes and so on are compressed in various ways plus duplicate files are are handled in a way not unlike an archive (ie one blob of data referenced many times which a partition image would not). Then it may get further compressed with such as lzma and xz, or only parts thereof...so mounted it appears as a filesystem but internally it has facets of an archive...an enigma. Files can be added to an sfs but only as additional folders iirc.... bit of a unique facet too.

So created like an archive...behaves as a read only filesystem.

Well all interesting stuff and we would be a little lost on here without such things

mike
Back to top
View user's profile Send private message 
amigo

Joined: 02 Apr 2007
Posts: 2647

PostPosted: Thu 21 Nov 2013, 14:38    Post subject:  

Yeah, the chief disadvantage to cromfs/cramfs/squashfs, apart from the fact that they are read-only, is that they discard much of the metadata associated with the files -hence they are unsuitable for making backups or duplicating filesystems which need a 'rich' metadata set.

Modern FS's like ext4 and btrfs have compression and journaling without metadata loss. Of course, btrfs is still not really ready for prime time as no fsck routines are available. I don't even use ext4 yet as it is still sometimes unstable. Good old ext3 for most of my purposes -I used to use reiserfs3, but it has bit-rotted already and was sometimes vulnerable to irrecoverable errors.

I play with ext-comp sometimes, but as with any code which goes in the kernel, but is not of the mainstream code, is a chore to keep up-to-date with newer kernel versions. Same can be said for aufs -although aufs has a pretty narrow 'point of insertion' in the code. Still, the day the developer loses interest (or worse), then using aufs will depend on one understanding the code enough and the kernel itself, in order to locally maintain and use the code.
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 14146
Location: Gatineau (Qc), Canada

PostPosted: Thu 21 Nov 2013, 14:52    Post subject:  

Many thanks, people! Smile
The concept is much clearer now.
Now I'll go do Karl_Godt's penance... Crying or Very sad Wink

musher0

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 4208
Location: Kiel,Germany

PostPosted: Fri 22 Nov 2013, 18:55    Post subject:  

Really ? Will you be buried until New Years Day ? - Not meant seriously, just posting now to fiddle out spell checking in FireFox .


Aside :
Ubuntu names its squashfs on the LiveCDs with .squashfs extension ( instead of .sfs ):

https://wiki.ubuntu.com/BootToRAM


And others give it .sqfs extension :

http://www.pcadvisor.co.uk/forums/1/tech-helproom/326100/what-to-do-with-a-sqfs-file/
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 14146
Location: Gatineau (Qc), Canada

PostPosted: Fri 22 Nov 2013, 19:19    Post subject:  

Karl Godt wrote:
Really ? Will you be buried until New Years Day ? - Not meant seriously, just posting now to fiddle out spell checking in FireFox.

Aside :
Ubuntu names its squashfs on the LiveCDs with .squashfs extension ( instead of .sfs ):
https://wiki.ubuntu.com/BootToRAM

And others give it .sqfs extension :
http://www.pcadvisor.co.uk/forums/1/tech-helproom/326100/what-to-do-with-a-sqfs-file/


Thanks for the additional information, Karl_Godt.

No-no! It was just a joke. I might bury myself in studying awk though...

This friendly Casper says good-bye!

...........................

musher0

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [10 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0377s ][ Queries: 11 (0.0055s) ][ GZIP on ]