Jump to content

tune2fs--- a mystery


abarbarian

Recommended Posts

abarbarian

ADrNebu.png

 

Thinking that I do not have a backup of my Arch, I know naughty me,  i thought I may give FSArchiver a try out. I have used Josh's super rysnc solution before but thought I would give something else a whirl.Reading up on FSArchiver I came across this,

 

FSArchiver home site

 

 

Quote

 

Mount options required

The standard attributes (permissions, owner, …) are always visible. Unfortunately, the extended-attributes and the ACL (which are stored as extended-attributes) may not be visible by the programs when the file-system is mounted with the wrong options. For example the ext3/ext4 filesystem may have to be mounted with options “user_xattr” and “acl”. It depends on the “default mount options”. If these required options are set as “default mount options” in the superblock of the filesystem, then it’s not necessary to specify these options then you mount it, or when it’s mounted via fstab. Here is an example of a partition which has “acl” as a default mount option, but “user_xattr” is not:


# dumpe2fs -h /dev/sda1 | grep -i "default mount options"
dumpe2fs 1.41.4 (27-Jan-2009)
Default mount options:    acl

If these mount options are not used, the risk is that extended attributes or ACLs may have been written in the filesystem in the past, and these attributes are now invisible because of the mount options. Then fsarchiver will warn about it because it cannot save these attributes and they would be lost when you restore the filesystem. Fortunately, this is an extreme case. In general, if the mount option does not allow extended-attributes or ACL to be seen, it just means you don’t have that in the filesystem. The bad scenario may happen if you mount a filesystem from different operating systems, or with different mount options during the time.

 

 

Knowing nothing about " options “user_xattr” and “acl”. " I set of searching for information. This led me to,

 

https://medium.com/@peteralex.bizjak/linux-series-1-managing-and-fixing-filesystems-fd03004cba50

 

Where I came across tune2fs information. This sounded familiar to me, I'm sure I fiddled around with it at some time in the past. In the article this instruction is given so that you can check out techy stuff on a partition. I can not pass up a chance to look deep inside my system so I tried said command,

 

# tune2fs -l /dev/nvme0n1p4

and also 

# tune2fs -l /dev/nvme0n1p5

These are my root and home partitions. You can see the results in the screenshot.

 

I was a tad shocked to find that my /home was last checked in August 2018 and puzzled that my / was last checked April 2020.

 

Filesystem created:       Sat Jun  3 13:39:20 2017
Last mount time:          Sat May 16 19:36:50 2020
Last write time:          Sat May 16 19:36:49 2020
Mount count:              11
Maximum mount count:      -1
Last checked:             Fri Apr  3 14:52:43 2020
Check interval:           0 (<none>)
Lifetime writes:          1242 GB
Filesystem created:       Sat Jun  3 13:39:21 2017
Last mount time:          Sat May 16 19:36:50 2020
Last write time:          Sat May 16 19:36:50 2020
Mount count:              166
Maximum mount count:      -1
Last checked:             Sun Aug 12 16:10:42 2018
Check interval:           0 (<none>)
Lifetime writes:          3698 GB

Both partitions were created at the same time so am a tad puzzled as to why they are different. I have deleted my dual boot with Windows and resized both partitions so that may have had some impact but then you would think they would both be affected in the same way.

Looking back I did try to speed up my boot time and may have fiddled around with tune2fs to do so, which may explain the oddity.

However I am not so bothered about boot times anymore so made the following changes using tune2fs so that hopefully my disk will be checked every 20 boot ups.

 

16:55:11-->Sun May 17-->~
-->sudo tune2fs -c 20 /dev/nvme0n1p5
tune2fs 1.45.6 (20-Mar-2020)
Setting maximal mount count to 20
17:35:05-->Sun May 17-->~
-->sudo tune2fs -c 20 /dev/nvme0n1p4
tune2fs 1.45.6 (20-Mar-2020)
Setting maximal mount count to 20

😎

Link to comment
Share on other sites

securitybreach

For install backups, use Clonezilla. I have been using it for many years to take snapshots of an installation partition or entire drives (when they are encrypted). You just need a partition at least the size of the drive/partition that you are backing up. Depending on the size and your system's resources, it could take 20+ minutes to clone your drive. The same to restore a drive or partition. That said, Clonezilla is basically flawless and works wonderfully.

Since I first started using it in 2012, the only time I had it mess up was when I was cloning an encrypted sata to nvme and I didn't take into account the sector sizes so that was really my fault.

Ian Chase wrote up a tutorial here on the forum:  Clonezilla Tutorial

Frank Golden also wrote up one:  Clonezilla Live to Image/Clone a Partition

Both tutorials are older but not much has changed with Clonezilla. It's very straightforward and just does it thing.

  • Like 1
Link to comment
Share on other sites

abarbarian
On 5/17/2020 at 5:58 PM, securitybreach said:

For install backups, use Clonezilla. I have been using it for many years to take snapshots of an installation partition or entire drives (when they are encrypted). You just need a partition at least the size of the drive/partition that you are backing up. Depending on the size and your system's resources, it could take 20+ minutes to clone your drive. The same to restore a drive or partition. That said, Clonezilla is basically flawless and works wonderfully.

 

 

I have used Clonezilla since I started out with the penguins way back when and it is a very good program. It does have that problem with not being able to reinstall to a smaller partition though.

I have also used the excellent rysync method that Josh used to use and you can use it to reinstall to a smaller partition.

However I like to try out different stuff. I mean if  you use the same old stuff that just works how are you ever going to have a chance of borking things up 🤣

Link to comment
Share on other sites

securitybreach
3 hours ago, abarbarian said:

I have also used the excellent rysync method that Josh used to use and you can use it to reinstall to a smaller partition.

 

Sorry if I was not clear. I use rsync as a cronjob to sync directories across drives. I use clonzilla to take snapshots of my actual installation or of the whole disk if its encrypted.

 

Rsync is ran daily as a cronjob whereas I only use clonezilla every 3 months to take a snapshot, overwriting the previous one after I have tested the restore.

Link to comment
Share on other sites

securitybreach
3 hours ago, abarbarian said:

if  you use the same old stuff that just works how are you ever going to have a chance of borking things up 🤣

 

Yeah but I was referring to system backups, you want those to 'just work'. I wouldn't want to chance some buggy software with a system backup. You take those so you have something to restore if/when something  goes wrong.

Link to comment
Share on other sites

abarbarian
1 hour ago, securitybreach said:

 

Yeah but I was referring to system backups, you want those to 'just work'. I wouldn't want to chance some buggy software with a system backup. You take those so you have something to restore if/when something  goes wrong.

 

FSarchiver is hardly buggy software, it is in the Arch Extra repository and was last updated today.

 

https://www.archlinux.org/packages/extra/x86_64/fsarchiver/

 

A long time ago you had a guide up on the site using rsync as a means to make a full system backup. I used that method several times successfully by making a script with an exclusion text. Used it to back up to an external drive that I identified by way of UUID. Worked a treat as I ran it from a usb Live Distro. I also ran it from a running system and it worked aswell though I used the Live Distro method as my preferred method.

 

This is pretty much the same rsync method as the one of yours that I used.

 

https://wiki.archlinux.org/index.php/Rsync#Full_system_backup

 

😎

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...