Function of the -sort option?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Function of the -sort option?

Brian
I'm having a hard time finding documentation on this.  What exactly does
the -sort option do?  My best guess is that it affects what order the
files are added to the squashfs?

For instance, suppose the following:

  - I have a directory tree (several TB) with thousands of directories
that I'd like to archive.
  - Each "leaf" directory has a handful of data files and one text file
describing them.
  - The text files describing them tend to be similar to each other, but
not identical.

If I give the text files sequential -sort priority id's, will they get
added to the squashfs sequentially, ending up in the same blocks?  I
feel like this would help compression, that's why I ask.

Thanks,
Brian

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Squashfs-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squashfs-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Function of the -sort option?

Brian
On 05/24/2017 09:57 AM, Brian wrote:

> I'm having a hard time finding documentation on this.  What exactly does
> the -sort option do?  My best guess is that it affects what order the
> files are added to the squashfs?
>
> For instance, suppose the following:
>
>   - I have a directory tree (several TB) with thousands of directories
> that I'd like to archive.
>   - Each "leaf" directory has a handful of data files and one text file
> describing them.
>   - The text files describing them tend to be similar to each other, but
> not identical.
>
> If I give the text files sequential -sort priority id's, will they get
> added to the squashfs sequentially, ending up in the same blocks?  I
> feel like this would help compression, that's why I ask.
>
> Thanks,
> Brian
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Squashfs-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/squashfs-devel
Answered the question myself by making a simple test script (attached).

I was right, the text files were added before all the "data" files, and
the squashfs size was a bit smaller.  I didn't need sequential sort IDs,
giving them all the same (non-zero) sort ID worked fine.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Squashfs-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squashfs-devel

squashSortTest.sh (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Function of the -sort option?

plougher
On Wed, May 24, 2017 at 4:43 PM, Brian <[hidden email]> wrote:

> On 05/24/2017 09:57 AM, Brian wrote:
>> I'm having a hard time finding documentation on this.  What exactly does
>> the -sort option do?  My best guess is that it affects what order the
>> files are added to the squashfs?
>>
>> For instance, suppose the following:
>>
>>   - I have a directory tree (several TB) with thousands of directories
>> that I'd like to archive.
>>   - Each "leaf" directory has a handful of data files and one text file
>> describing them.
>>   - The text files describing them tend to be similar to each other, but
>> not identical.
>>
>> If I give the text files sequential -sort priority id's, will they get
>> added to the squashfs sequentially, ending up in the same blocks?  I
>> feel like this would help compression, that's why I ask.
>>
>> Thanks,
>> Brian
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Squashfs-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/squashfs-devel
>
> Answered the question myself by making a simple test script (attached).
>
> I was right, the text files were added before all the "data" files, and
> the squashfs size was a bit smaller.  I didn't need sequential sort IDs,
> giving them all the same (non-zero) sort ID worked fine.
>

Yes, that's OK.  All the  text files will get the same priority and get
packed together in scan order.  All other files will get the default
(lower) 0 priority, and be added afterwards in scan order.

Phillip

>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Squashfs-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/squashfs-devel
>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Squashfs-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squashfs-devel
Loading...