Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: alexo on October 13, 2015, 05:18:00 AM

Title: mksquashfs help
Post by: alexo on October 13, 2015, 05:18:00 AM
Hello all in the forum,
I'm absolutly new to Tiny Core Linux [not to the Linux OS]
I was able to install it on a USB pen drive and after installing hplip and setting it up for my printer, in order to make these changes persistents, I tried to make a personal extention for them.
Here comes the problem...
I installed mksquash-tool from the repository as onboot tce, but I can't execute mksquashfs. This command is not amongst the root's command line tools.

I'm using the 6.4 distribution

Any suggestion?
Thank you.
Title: Re: mksquashfs help
Post by: nitram on October 13, 2015, 05:38:15 AM
Welcome.
mksquashfs is located in squashfs-tools.

To see if the extension is loaded, try:
ls /usr/local/tce.installed/ | grep squash

If it's loaded then just run 'mksquashfs ...' as regular user, not root.

If squashfs-tools is downloaded but not installed (to ram), then navigate to your /optional directory and load:
tce-load -i squashfs-tools

If squashfs-tools needs to be downloaded from repository and installed then wget and install:
tce-load -wi squashfs-tools

Creating personal extensions can be useful.
If it's just a couple config files you need to save for every boot, they can be added to /opt/filetool.lst, example:
etc/X11/xorg.conf
usr/local/sbin/basic-firewall
var/lib/locate/locatedb
etc/exports
Title: Re: mksquashfs help
Post by: alexo on October 13, 2015, 02:17:15 PM
Thanks a lot.

I tried many times loading the tools in memory, but...PEBKAC !
Now it works fine.

In facts it's just to lines that I have to add to the /opt/.filetool.lst
Then when I reboot I have to chose the backup option, isn'it it

The doubt I still have is:
do I need to backup every reboot or shutdown? or It's a thing I have to do only when I modify files like .filetool.lst and only once?

thank you
Title: Re: mksquashfs help
Post by: Rich on October 13, 2015, 02:43:30 PM
Hi alexo
You only need to run a backup when you modify  filetool.lst  or when you modify one of the backed up files.
Title: Re: mksquashfs help
Post by: ttz on October 13, 2015, 08:08:47 PM
interpreting the question:
Quote
do I need to backup every reboot or shutdown?

as: when do i need to backup?

There is a risk here since i boot from a stick created with tc-install (hdd install) and know no other case. Given that, let's say:

Code: [Select]
>lsblk                                                                             x
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT                                        x
sda      8:0    0 186.3G  0 disk                                                   x>
|-sda1   8:1    0  93.2G  0 part                                                   x
`-sda2   8:2    0  93.2G  0 part                                                   x
sdb      8:16   1   7.5G  0 disk                                                   x
`-sdb1   8:17   1   7.5G  0 part /mnt/sdb1                                         x
zram0  251:0    0 678.1M  0 disk [SWAP]

For me, sda is an internal drive and sdb is my tc (usb) drive.

now, just for fun:

Code: [Select]
>umount /mnt/sdb1/                                                                 x
                                                                                   x
                                                                                   x>cd
>lsblk                                                                             x
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT                                        x
sda      8:0    0 186.3G  0 disk                                                   x>
|-sda1   8:1    0  93.2G  0 part                                                   x
`-sda2   8:2    0  93.2G  0 part                                                   x
sdb      8:16   1   7.5G  0 disk                                                   x
`-sdb1   8:17   1   7.5G  0 part                                                   x
zram0  251:0    0 678.1M  0 disk [SWAP]   

nothing i do now will write to my tc drive.

But, let's scratch last:

Code: [Select]
>mount /mnt/sdb1                                                                   x
                                                                                   x
                                                                                   x>cd
>lsblk                                                                             x
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT                                        x
sda      8:0    0 186.3G  0 disk                                                   x>
|-sda1   8:1    0  93.2G  0 part                                                   x
`-sda2   8:2    0  93.2G  0 part                                                   x
sdb      8:16   1   7.5G  0 disk                                                   x
`-sdb1   8:17   1   7.5G  0 part /mnt/sdb1                                         x
zram0  251:0    0 678.1M  0 disk [SWAP]

I don't  know how to show this; you'll have to take my word for it - you'll have to try it. If i write ANYTHING (or remove ANYTHING) from /mnt/sdb1 it is a done deal - backup is don't matter.

For lack of better wording, if I am in/using my tc drive and it is mounted and i want backup/persistence i must have whatever is to be backed up (what is to persist) in /opt/.filetool.lst.

Only thing else I can say is spend time with 'the book', wiki, keep pushing thru trial and error - good luck!!

I'm really still a noob. With that in mind: welcome,
ttz
Title: Re: mksquashfs help
Post by: alexo on October 14, 2015, 05:23:57 AM
Thanks for your replies guys!

Quote
interpreting the question:
Quote
do I need to backup every reboot or shutdown?
as: when do i need to backup?

That's right the question I had in mind, but ttz's reply didn't fade doubts away. And if he doesn't mind my words, I didn't understand it at all, sorry.
I'll read the book and the wiki as soon as possible.

I noticed that the backup process is really time consuming and, since it writes files down on the USB stick, it can reduce its lifetime. Up to now I left the backup option every single reboot o shootdown I did, but is there a way to remove this default?
 
thank you.



Title: Re: mksquashfs help
Post by: nitram on October 14, 2015, 05:41:05 AM
Yes read book and wiki, very informative. TC isn't your typical distribution, takes some extra thinking.

Use /opt/xfiletool.lst to flag files that don't need to be saved on shutdown, examples:
Code: [Select]
home/tc/.cache/mozilla
home/tc/.macromedia
home/tc/.adobe
home/tc/.dbus
home/tc/.local/share/recently-used.xbel
home/tc/.mozilla/firefox/Crash Reports
home/tc/.mozilla/firefox/tc.default/healthreport
home/tc/.mozilla/firefox/tc.default/minidumps
home/tc/.mozilla/firefox/tc.default/downloads.sqlite
home/tc/.mozilla/firefox/tc.default/signons.sqlite
home/tc/.mozilla/firefox/tc.default/sessionstore-backups
home/tc/.mozilla/firefox/tc.default/urlclassifierkey3.txt
home/tc/.mozilla/firefox/tc.default/cookies.sqlite
home/tc/.mozilla/firefox/tc.default/cookies.sqlite-shm
home/tc/.mozilla/firefox/tc.default/cookies.sqlite-wal
home/tc/.mozilla/firefox/tc.default/cookies.sqlite.bak
home/tc/.mozilla/firefox/tc.default/cookies.sqlite.bak-rebuild
home/tc/.mozilla/firefox/tc.default/crashes
home/tc/.mozilla/firefox/tc.default/healthreport.sqlite
home/tc/.mozilla/firefox/tc.default/healthreport.sqlite-shm
home/tc/.mozilla/firefox/tc.default/healthreport.sqlite-wal
home/tc/.mozilla/firefox/tc.default/webapps
home/tc/.mozilla/firefox/tc.default/gmp-gmpopenh264

Another alternative is to look into specifying a dedicated /home partition, not on the USB.

If you're booting into graphics, the TC Exit Options popup (exittc command) allows you to change backup option to none (not persistent preference). For persistence i think you can change /etc/sysconfig/backup to 0 (don't quote me, read up or trial and error).

Edit:
- The TC Control Panel > Backup/Restore makes it easy to change xfiletool.lst and filetool.lst
- When booting with text bootcode/no GUI there is no auto backup, so entering sudo poweroff gets no backup, run 'backup' to backup :)
Title: Re: mksquashfs help
Post by: Rich on October 14, 2015, 09:47:57 AM
Hi alexo
Quote
Up to now I left the backup option every single reboot o shootdown I did, but is there a way to remove this default?
The default is in your  .profile  file in your home directory. Find:
Code: [Select]
export BACKUP=1and change the 1 to a 0.
Title: Re: mksquashfs help
Post by: gerald_clark on October 14, 2015, 11:37:15 AM
Then do a backup so the .profile will be saved.
Title: Re: mksquashfs help
Post by: alexo on October 14, 2015, 11:49:11 AM
Quote
The default is in your  .profile file in your home directory. Find:

I'll try when I'm home.

TC is quite nice, but I realize it needs many manual configuration.
Is it thought to be a recovery tool or can be used as a standalone distro?
Personally I've always dreamed of a linux OS on USB and tried Slax, but I didn't like it.

Quote
Then do a backup so the .profile will be saved

Yes I'm starting to understand that anything modified needs a backup at exit.
But, why does it take so much time? at least 15-20 seconds on a USB 2 port.

Title: Re: mksquashfs help
Post by: curaga on October 14, 2015, 11:57:57 AM
Core is not really a recovery tool like SystemRescueCD, it's a toolkit to build appliances and distro setups, including recovery tools if desired. It can be used as a standalone distro, but may require more configuration than the turn-key options.

If your backup is slow, check its size, for example the bigHomeFiles tab in the control panel stats.
Title: Re: mksquashfs help
Post by: gerald_clark on October 14, 2015, 02:43:32 PM
Also, you can use 'mc' to browse the mydata.tgz file.
This will allow you to discover why it is so large.

Show us the output of 'showbootcodes'.
Title: Re: mksquashfs help
Post by: alexo on October 15, 2015, 05:03:01 AM
Following curaga's advise, I have watched the big home files and I've found there were 3 files over 30 MB each.
I removed them, because they were entrys for programs I had uninstalled, and the backup process is now of less than 10 seconds.
Moreover I had turned to 0 the backup entry in the .profile file so I'll make persistent files when it's really necessary, avoiding to backup internet garbage in the history of navigation or the like.

I'll post the output of showbootcodes as soon as possible.
Title: Re: mksquashfs help
Post by: alexo on October 15, 2015, 08:03:23 AM
here is the output of showbootcodes:

Code: [Select]
tc@alexo:~$ showbootcodes
initrd=/tce/boot/core.gz quiet vga=795 waitusb=5:UUID="e32db81f-0f5c-48b9-8309-7336dbe7d4e1" tce=UUID="e32db81f-0f5c-48b9-8309-7336dbe7d4e1" BOOT_IMAGE=/tce/boot/vmlinuz
Title: Re: mksquashfs help
Post by: ttz on October 15, 2015, 07:41:45 PM
I don't sense that the question of backup is yet solved.

Quote
I noticed that the backup process is really time consuming and, since it writes files down on the USB stick, it can reduce its lifetime. Up to now I left the backup option every single reboot o shootdown I did, but is there a way to remove this default?

Best I can think of is to break that down into parts. First:

Quote
noticed that the backup process is really time consuming

I have to set this aside for now. Don't know what amount of time it is taking, what you are backing up, or what you expect.

Quote
it writes files down on the USB stick, it can reduce its lifetime

Format with ext2 and carefully choose your writes/backups.

Quote
is there a way to remove this default?

Yes. Edit ~/.profile so that you have:

Code: [Select]
export BACKUP=0
Don't know what it means/matters, but I, in about 10 months of using tc, didn't even try to address personal extensions until, like, last month. It just feels a certain way.

Sorry if my last reply to you did not help! Really hope this one is more useful.

Humbly yours,
ttz
Title: Re: mksquashfs help
Post by: ttz on October 15, 2015, 08:03:28 PM
propose that this is not a mksquashfs problem; it is backup problem and should be mv'd/re-titled.

yes?
Title: Re: mksquashfs help
Post by: alexo on October 16, 2015, 04:10:58 AM
As stated in an early message, I've solved the backup problem.

Quote
export BACKUP=0

thanks to this instruction I now backup manually and

Quote
If your backup is slow, check its size, for example the bigHomeFiles tab in the control panel stats.

after that checking and the removing of big unneded files, now it takes about 5 seconds to complete the task. When I started this topic it took about 25.

My USB stick is already formatted as ext2.

thank you all,