How to permanently mount a partition to a folder?

Context:
After not being able to boot my system(Fedora 33) and having to boot into a live image and fix the problem, I’ve to the conclusion that I should ask the comunity.
It all started when I decided I want to backup some of my files.
I tried timeshift and I encountered a bug which made me search for another program with similar funtionality.
After timeshift I tried Duplicati, which gave me some weird errors and warnings.
Finally I found KBackup BUT when I tried to do a backup on a folder(/run/media/kgbeast/backup) on which a dedicated backup partition is mounted, an error occurred that said something like “permission denied”.
So I tried to make a folder in my home dir, mount the backup partition on it, delete the dir on which the backup partition was mounted, edit the /etc/fstab file and reboot.
After this my system would not boot.

So the questions are:
How to create a folder in my home dir, mount a partition on it and edit the fstab properly?
Is it worth it, or should I use a different program for backup(which one, preferably with a GUI and a automatic backup option)?

In order to give you accurate instructions, can you share the output of

lsblk -o NAME,SIZE,TYPE,MOUNTPOINT,UUID,FSTYPE,LABEL 

Also, if you could let us know which partition it is you want to mount.

It depends what your backup target is. If it is an internal or external hard drive, I would use a permanent mount of some sort.

If it is the cloud or a local NAS you may be able to avoid that depending on the backup solution.

1 Like
[kgbeast@localhost ~]$ lsblk -o NAME,SIZE,TYPE,MOUNTPOINT,UUID,FSTYPE,LABEL
NAME          SIZE TYPE MOUNTPOINT UUID                                 FSTYPE LABEL
zram0         2.9G disk [SWAP]                                                 
nvme0n1     476.9G disk                                                        
├─nvme0n1p1   600M part /boot/efi  2F43-04EC                            vfat   
├─nvme0n1p2     1G part /boot      144df4e7-4dd6-445c-8969-a6e654e5a167 ext4   
├─nvme0n1p3 377.7G part /home      542e141b-ad94-43c9-a1c1-9b10d04488ae btrfs  fedora_localhost-live
└─nvme0n1p4  97.7G part            6bb550f2-780b-40d8-85fe-78f8408ef658 btrfs  backup
[kgbeast@localhost ~]$

I want to mount the nvme0n1p4 partition.

Is there a better and easier to setup program which I can use for backing up files from my PC on the same storage device, but on a different partition? It’s all local files, no network or cloud involved.

Something like this:

UUID=6bb550f2-780b-40d8-85fe-78f8408ef658       /location/to/mount           btrfs           rw,noatime,space_cache,autodefrag    0 0

replace /location/to/mount with where you want it mounted. Make sure the mount point exists. Before you reboot, test it with sudo mount /path/to/mount

Backup is a complicated subject depending on what your specific goals are.

A couple of options I don’t see listed that you have tried

  • deja-dup is a popular and simple option
  • borgbackup is a more comprehensive solution and there is a GUI for it called vorta
4 Likes

Thank you!

I tried deja-dub and it gives me this error message:
Giving up after 5 attempts. Error: Error opening file “/home/kgbeast/.backups/duplicity-full.20210408T152847Z.vol1.difftar.gpg”: Permission denied

And KBackups now gives me this error:
The file '/home/kgbeast/.backups/backup_2021.04.08-18.33.19_1.tar' can not be opened for writing.

I will try borgbackup and if that doesn’t work I’ll go even deeper into this rabbit hole about backups=)).

One important thing to understand is that it is not really a backup if it is on the same drive (in your case “nvme0n1”). If the drive fails, all data on that drive could be lost.

If you just want to be able to “version control” your files (i.e. restore older versions after you have changed or deleted them; possibly accidentally), then you should probably take a look at Btrfs snapshots. They are designed exactly for that purpose and you can automate them with a simple cron job.

3 Likes

Is there any front-end for btrfs snapshots?

If you just want to be able to copy the files out of the backup directory. I think you can do that with the normal gnome files graphical interface. I don’t think you really need a separate GUI application. You can find an intro to Btrfs snapshots here: Recover your files from Btrfs snapshots - Fedora Magazine

3 Likes

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.