LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-07-2023, 07:54 AM   #1
vieno
LQ Newbie
 
Registered: Mar 2023
Posts: 3

Rep: Reputation: 0
BTRFS, subvolumes and timeshift, snapshots, how to access without GUI.


TLDR:
Timeshift works fine (snapshots and restore from snapshots) with the btrfs option when I use the GUI, but if I can't access the GUI and need to fix my system/restore from command line how to I acess the timeshift folder with my snapshots?

Background:
I setup @ and @home on a laptop fedora installation as I wanted to use timeshift so as to benefit from snapshots. Timeshift says it saves snapshots to /timeshift-btrfs but when I $ls -la / I can't see this directory but it is in the subv list. I tried following https://fedoramagazine.org/working-w...fs-subvolumes/ but had issues with path names (think my luks encryption migth have complicated things).

Am struggling to understand btrfs subvols. Any advice and noob friendly guides/tutorials/info refs would be greatly welcomed

Further details:
Fedora Linux 37 (KDE Plasma) x86_64
Kernel: 6.1.14-200.fc37.x86_64
DE: Plasma 5.27.2
Theme: [Plasma], Breeze [GTK2/3]

$lsblk
```
NAME *****************************************MAJ:MIN RM **SIZE RO TYPE *MOUNTPOINTS
sda ********************************************8:0 ***1 ****0B *0 disk **
sdb ********************************************8:16 **1 ****0B *0 disk **
zram0 ****************************************252:0 ***0 ****8G *0 disk *[SWAP]
nvme1n1 **************************************259:0 ***0 953.9G *0 disk **
├─nvme1n1p1 **********************************259:2 ***0 465.7G *0 part **
└─nvme1n1p2 **********************************259:3 ***0 488.2G *0 part **
nvme0n1 **************************************259:1 ***0 **1.8T *0 disk **
├─nvme0n1p1 **********************************259:4 ***0 **600M *0 part */boot/efi
├─nvme0n1p2 **********************************259:5 ***0 ****1G *0 part */boot
└─nvme0n1p3 **********************************259:6 ***0 **1.8T *0 part **
*└─luks-dfc17fbe-52ed-4a9b-bd3c-3c8f6937f0e9 253:0 ***0 **1.8T *0 crypt /home
************************************************************************/
```

$ sudo btrfs subv list .The tutorials I've found and inside the software say that the path to backups is:

/run/timeshift/backup/timeshift-btrfs
or
/timeshift

However on my system it is:

/run/timeshift/**xxx_random_number_here_xxx**/backup/timeshift-btrfs

I noticed that the **xxx_random_number_here_xxx** changes each time timeshift is loaded and when timeshift is not running the folder completely disappears.The tutorials I've found and inside the software say that the path to backups is:

/run/timeshift/backup/timeshift-btrfs
or
/timeshift

However on my system it is:

/run/timeshift/**xxx_random_number_here_xxx**/backup/timeshift-btrfs

I noticed that the **xxx_random_number_here_xxx** changes each time timeshift is loaded and when timeshift is not running the folder completely disappears.
```
ID 256 gen 3544 top level 5 path @home
ID 257 gen 2408 top level 5 path timeshift-btrfs/snapshots/2023-03-06_13-18-12/@
ID 259 gen 2771 top level 5 path timeshift-btrfs/snapshots/2023-03-06_13-03-03/@
ID 260 gen 2766 top level 5 path timeshift-btrfs/snapshots/2023-03-06_22-21-41/@
ID 261 gen 2774 top level 5 path timeshift-btrfs/snapshots/2023-03-06_22-25-03/@
ID 262 gen 3544 top level 5 path @
```

/etc/fstab
```
UUID=9bbd4929-c483-4b94-9b9b-3eb437b4eb69 / **********************btrfs **subvol=@,compress=zstd:1,x-systemd.device-
timeout=0 0 0
UUID=e5153368-03b4-4a38-abb1-2e9fThe tutorials I've found and inside the software say that the path to backups is:

/run/timeshift/backup/timeshift-btrfs
or
/timeshift

However on my system it is:

/run/timeshift/**xxx_random_number_here_xxx**/backup/timeshift-btrfs

I noticed that the **xxx_random_number_here_xxx** changes each time timeshift is loaded and when timeshift is not running the folder completely disappears.The tutorials I've found and inside the software say that the path to backups is:

/run/timeshift/backup/timeshift-btrfs
or
/timeshift

However on my system it is:

/run/timeshift/**xxx_random_number_here_xxx**/backup/timeshift-btrfs

I noticed that the **xxx_random_number_here_xxx** changes each time timeshift is loaded and when timeshift is not running the folder completely disappears.The tutorials I've found and inside the software say that the path to backups is:

/run/timeshift/backup/timeshift-btrfs
or
/timeshift

However on my system it is:

/run/timeshift/**xxx_random_number_here_xxx**/backup/timeshift-btrfs

I noticed that the **xxx_random_number_here_xxx** changes each time timeshift is loaded and when timeshift is not running the folder completely disappears.e912eaf5 /boot ******************ext4 ***defaults ****1 2
UUID=A7F8-FD21 ***************************/boot/efi **************vfat ***umask=0077,shortname=winnt 0 2
UUID=9bbd4929-c483-4b94-9b9b-3eb437b4eb69 /home ******************btrfs **subvol=@home,compress=zstd:1,x-systemd.dev
ice-timeout=0 0 0
```

UPDATE
The online tutorials I've found and inside the software say that the path to backups is:

/run/timeshift/backup/timeshift-btrfs
or
/timeshift

Yet on my system it is:
/run/timeshift/**xxx_random_number_here_xxx**/backup/timeshift-btrfs

I noticed that the **xxx_random_number_here_xxx** changes each time timeshift is loaded and when timeshift is not running the folder completely disappears. Now unsure whether it's a timeshift thing or btrfs thing.

Last edited by vieno; 03-07-2023 at 12:25 PM.
 
Old 03-13-2023, 04:21 AM   #2
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,162

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
From this link below, i believe you will need to mount the snapshot and recover from there.

https://archive.kernel.org/oldwiki/b...html#Snapshots


Quote:
Managing Snapshots
One typical structure for managing snapshots (particularly on a system's "main" filesystem) is based on the to flat schema from above. The top-level subvolume is mostly left empty except for subvolumes. It can be mounted temporarily while subvolume operations are being done and unmounted again afterwards. Alternatively an empty "snapshot" subvolume can be created (which in turn contains the actual snapshots) and permanently mounted at a convenient directory path.

The actual structure could look like this:

toplevel (volume root directory, not mounted)
+-- root (subvolume root directory, to be mounted at /)
+-- home (subvolume root directory, to be mounted at /home)
\-- snapshots (directory)
+-- root (directory)
+-- 2015-01-01 (root directory of snapshot of subvolume "root")
+-- 2015-06-01 (root directory of snapshot of subvolume "root")
\-- home (directory)
\-- 2015-01-01 (root directory of snapshot of subvolume "home")
\-- 2015-12-01 (root directory of snapshot of subvolume "home")
This link might help as well: https://www.ibm.com/docs/en/spectrum...rfs-subvolumes

Last edited by JJJCR; 03-13-2023 at 04:22 AM. Reason: edit
 
1 members found this post helpful.
Old 03-14-2023, 08:09 PM   #3
vieno
LQ Newbie
 
Registered: Mar 2023
Posts: 3

Original Poster
Rep: Reputation: 0
Thumbs up

[QUOTE=JJJCR;6417392]From this link below, i believe you will need to mount the snapshot and recover from there.

The references are useful and informative. In the end I read some guides and documentation by Arch and OpenSUSE for setting up snapshots using "Snapper" (instead of Timeshift). I then came to learn, as you've rightly pointed out - the necessity of not only setting up btrfs subvolumes / and /home but also snapshot subvolumes /.snapshots and /home/.snapshots

For anyone else who might be just getting started with btrfs and wanting to setup snapshots on Fedora 37, I recommend this website https://sysguides.com/ (there are also videos). The guide was easy to follow with adequate explanations for a newbie.

Thanks again for the info, it's starting to make more sense now.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Cannot seem to NFS mount Btrfs subvolumes rnturn Linux - Server 4 04-06-2018 05:04 AM
[bug?] Using generic kernel fails when using btrfs subvolumes in 14.2 moesasji Slackware 10 05-30-2017 06:48 AM
[SOLVED] which btrfs / subvolumes mixed with ext4 are needed? JZL240I-U Linux - Software 2 01-13-2015 01:22 AM
LXer: How to Manage Btrfs Storage Pools, Subvolumes And Snapshots on Linux (part 1) LXer Syndicated Linux News 0 03-21-2014 01:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration