View previous topic :: View next topic |
Author |
Message |
jordanweb n00b

Joined: 27 Oct 2020 Posts: 14
|
Posted: Sat Nov 21, 2020 12:55 pm Post subject: how to recompress tar.xz /mnt? |
|
|
Hi, I'm new to Gentoo Linux, this is my 5th times installing Gentoo for my pc, each installation took about 20-30 hours, but I broke my installation many times and now I had to format and reinstall gentoo.
I'm now installing again Gentoo it's 50% progress status now, if my installation is 99% complete (without grub yet), can I go navigate to /mnt folder and compress the whole directory to .tar.xz
so next time I can install using tar Code: | Xpvf stage3-.tar.xz --xattrs-include=*.* --numeric-owner |
if so can I just use the default file-roller to compress whole directory to .tar.xz? I do not need add lines or anything like -xpvf? require something for "tarball" etc. is it okay
that's my question sorry for bad grammar, and thanks for helping. |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 47032 Location: 56N 3W
|
Posted: Sat Nov 21, 2020 1:06 pm Post subject: |
|
|
jordanweb,
If your intent is to make a stage4 tarball, then yes, you can do that.
Google stage4.
The filesystem you want to tar must not be in use. At least, it must not have any files open for writing as they will not be complete in the tarball.
Than means you must make your stage4 from outside the Gentoo install with the Gentoo install mounted read only.
Gentoo already has stage1, stage2 and stage3 tarballs. stage4 is a name for a tarball of your install.
Google will tell how to do it and restore it.
Gentoo is very difficult to break so badly that it cannot be repaired. You will learn much more from repairing it than from reinstalling.
Reinstalling only lets you make a different mistake :) _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
szatox Veteran

Joined: 27 Aug 2013 Posts: 1988
|
Posted: Sat Nov 21, 2020 8:37 pm Post subject: |
|
|
Quote: | Gentoo is very difficult to break so badly that it cannot be repaired. | chmod -R 777 /
Been there, done that
Quote: | I'm new to Gentoo Linux, this is my 5th times installing Gentoo for my pc, each installation took about 20-30 hours, but I broke my installation many times and now I had to format and reinstall gentoo. | Well, The first install is expected to take ages. The second one should go in a few hours.
With a little bit of practice cleaning up your mess, you start taking shortcuts and then can reboot into your new system in 30 minutes. Not much longer than installing ubuntu takes. (well, yeah, ubuntu would have some user interface and gentoo is kinda bare bones at this point)
Fine tuning it for your needs is another story - but you can start using your system before even attempting to optimize it.
The easy way to create a txz archive:
Code: | cd my/new/system/root_directory
tar cJf ../stage4.txz ./ |
c for create an archive
J for xz compression
f for following string is the archive name |
|
Back to top |
|
 |
figueroa Veteran


Joined: 14 Aug 2005 Posts: 1027 Location: The Matrix? USA
|
Posted: Sun Nov 22, 2020 5:06 am Post subject: |
|
|
X = exclude
x = extract
When I make the weekly full system backup of my ext4 filesystem (no personal files) I use: -acls --xattrs --numeric-owner
Don't back up any files in /proc, /sys, /dev, /media, /run, /tmp. You need the directories, but not any files they may contain.
I regularly restore the resulting backup to a secondary drive to double check that I have a working backup system.
I do not recommend the program file-roller for this.
Something like this, as a script:
Code: | tar cpf /mnt/backup0/stage4.tar.zst -I "zstd -9 -T0" --acls --xattrs --numeric-owner -X /home/username/bin/exclude.master / |
Code: | $ cat /home/username/bin/exclude.master
dev/*
home/username/*
home/lost+found
lost+found
media/*
mnt/*
proc/*
root/.cache
run/*
scratch/*
sys/*
tmp/*
var/tmp/*
var/cache/distfiles/* |
I don't ordinarly do this into a single file, but with a script into one file per directory in /. I did just run this and it gives me 3.9 GB on the currently running system. Feedback? _________________ Andy Figueroa
andy@andyfigueroa.net Working with Unix since 1983.
Automate and Test Your Backups |
|
Back to top |
|
 |
figueroa Veteran


Joined: 14 Aug 2005 Posts: 1027 Location: The Matrix? USA
|
Posted: Tue Dec 08, 2020 8:20 pm Post subject: |
|
|
I've actually made this into an improved script, with an improved exclude file. Now using zstd compression level 19, gives me a 3.7 GB full-system tarbarll:
Code: | #!/bin/sh
#stage4.scr
mount /mnt/backup0
cd /
date > /mnt/backup0/stage4date.txt
tar cpf /mnt/backup0/stage4.tar.zst -I "zstd -19 -T0" --acls --xattrs --numeric-owner --no-wildcards-match-slash -X /home/usename/bin/exclude.master /
date >> /mnt/backup0/stage4date.txt
cd
|
Code: | $ cat /home/username/bin/exclude.master
dev/*
home/username/*
home/lost+found
lost+found
media/*
mnt/*/*
proc/*
root/.cache/*
run/*
scratch/*
sys/*
tmp/*
var/tmp/*
var/cache/distfiles/*
|
The unusual line in the exclude file "mnt/*/*" gives me the equivalent of no-recursion past the first level of directories in /mnt, but still backs up the existing mountpoints. This script can be run on a live system as long as you aren't concurrently making changes in critical OS files in /bin /sbin /usr /var so it's OK to keep reading your email, browsing the web, and doing other ordinary work while the script runs. _________________ Andy Figueroa
andy@andyfigueroa.net Working with Unix since 1983.
Automate and Test Your Backups |
|
Back to top |
|
 |
|
|
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
|
|