Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
how to recompress tar.xz /mnt?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
jordanweb
n00b
n00b


Joined: 27 Oct 2020
Posts: 11

PostPosted: Sat Nov 21, 2020 12:55 pm    Post subject: how to recompress tar.xz /mnt? Reply with quote

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
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 46684
Location: 56N 3W

PostPosted: Sat Nov 21, 2020 1:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1959

PostPosted: Sat Nov 21, 2020 8:37 pm    Post subject: Reply with quote

Quote:
Gentoo is very difficult to break so badly that it cannot be repaired.
chmod -R 777 /
Been there, done that :lol:

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
View user's profile Send private message
figueroa
l33t
l33t


Joined: 14 Aug 2005
Posts: 858
Location: Lower right-hand corner USA

PostPosted: Sun Nov 22, 2020 5:06 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
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