New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Comments
why on earth can't you check the tgz yourself?
I prefer to ask there because the resulting tgz is too huge.
by definition there is no TAR file too huge to list its contents with 'tar -t'.
its not tar file but tgz and it is around 200gb big, want to save disk io
It depends. Is your version of tar linked with libattr? Check if
tar --xattrs
is supported.Why not just test it out on a small tar/vzdump?
I see i have tar (GNU tar) 1.23
and in its man page i see:
--xattrs
Save the user/root xattrs to the archive
--no-xattrs
Don’t extract the user/root xattrs from the archive
does it mean that immutable bit files are archived and also extracted by default?
create some random file and test it your self
This. How much time does it create to cd to /tmp, create a file, chattr it, tar it, blow it away, untar, and look at the file?
it indeed looks simple i tried to use tar czf and tar xzf
and the result if i did everything properly is that the immutable file is no longer immutable after extraction
before:
lsattr
-------------e- ./test2
----i--------e- ./test
after:
lsattr
-------------e- ./test2
-------------e- ./test
it is unpleasant surprise for me as i quite need to keep the immutable settings and not sure if vzdump command can be set to keep it.
Dont know if file is immutable in the tar archive, tried tar -t a.tar
Anyone know how to keep immutable files immutable after extraction?
I tried
tar --xattrs -p -czf archive.tgz foldertoarchive/*
tar --xattrs -p -xzf archive.tgz -C folderdestination/
-p to preserve permissions
but extracted folders/files do not have immutable bit even original had it
I am pretty sure vzdump does keep them
Except you can't usually chattr +i in /tmp since it's on tmpfs ;-)
But @postcd just choose any other directory and do the experiment yourself. Faster to try than to ask.
@Awmusic12635
Thx, and if vzdump is not used? just tar..
@rds100
yes, i tried, and cant find how to do it
I'm on my phone, but what you're looking for are instructions on how to do four things:
Should be easy to find instructions if you break up the task into those points and google them. Someone else might be more prepared to list the directions, but that's a starting path at least
Thx, i know all 4 steps except how to tar directory preserving immutable files and after extraction files having immutable bit
Have you confirmed that you need extra steps for that? I've honestly never tried.
@jarland
not sure what you mean, around 5 posts above i already mentioned tar have not "preserved"/remembered immutable after untarring.
Immutability is part of the extended attributes specific to ext2/3/4 filesystem and not BSD/POSIX standard. For instance, you can tar from ext4 and untar into ZFS/XFS/BTRFS and extended attributes wouldn't translate over.