Backing up system with Pika - /media/

Hi there, I found advice from Mr. Google on the above, which seems to contradict what I am finding regards backing up the /media/ directory.

I have all (14) of my mounted Nas and windows shares setup as mount points in /media/, and I want to backup the directories inside to avoid recreating them, NOT the data they contain.

Some advice says:
" * /media/: contains mount information, not the data itself.

  • A backup of /media/ would be a backup of the directory structure showing where things are mounted, not the contents of those mounted devices."

But when I include that directory in the Pika backup it seems to be backing up the actual contents of the shares. I say this because the 'total backup size' showing in Pika when running just keeps increasing without stopping. (I aborted it at 47Gb)

All that I want is a backup that best allows me to restore the system (and My Documents folder) in case of some how I mess it up.

What am I doing wrong? Ideas anyone!!
cheers CD

Your Googling is not wrong. Pika, however, seems to be. It should not backup the contents of mount points - but clearly it is.

That aside, if all you want is to backup your mount points, not the contents ; why not just save a copy of your fstab file backed up?

1 Like

Hi there, thanks for your reply.

Yep, am doing that, but just wanted to be lazy and not have to create all the entries in the /media/ directory.

cheers CD

I am not following you here... Are you saying you do not have the media entries in your fstab file?
How are they mounting when Pika tried to back up all of their contents?

Hi there, thanks for your reply.

The 14 shares are listed in 'fstab' example:
"//OEM1\Plex\040Photos /media/Plex-Photos cifs credentials=/home/.smbcreds,file_mode=0777,dir_mode=0777 0 0"
and the 14 directories are created in the /media directory example:
"/media/Plex-Photos/"

So I was just trying to backup the directories/structure inside the /media directory that's all.

cheers CD

Having looked at a page that explains pika it is a full backup tool, after which it only needs to create incremental backups. This is possibly what you are looking for:

"The rsync command-line tool is the most preferred backup tool in Linux systems for making incremental backups, including the entire directory tree, both locally and on a remote server.
It is particularly effective for backing up directory trees while preserving file permissions, ownership, and links.
The tool supports updating the entire directory tree and file system, making it ideal for this purpose.
Its functionality can be extended with a graphical user interface called Grsync, though automation is typically achieved through shell scripts and cron jobs for command-line use.
Other tools like Back In Time, Time Vault, and LuckyBackup also support creating incremental backups of directory trees, with Time Vault being described as the Linux equivalent of Apple's Time Machine.
Additionally, tools such as Duplicity and Duplicati use incremental backup methods, with Duplicity relying on librsync for efficient incremental archiving.

AI-generated answer. Please verify critical facts."

Hi there, thanks for your reply.

I did check out Grsync, and it has the same results. Meaning that the contents of the mounted shares are copied as well as the sub-directories in the /media/ folder.
It's going to be easier to take a screenshot of the sub-directories names and mkdir for each, if/when I reinstall or whatever.

cheers CD

1 Like