Glam Prestige Journal

Bright entertainment trends with youth appeal.

I have problems understanding the following.

In /etc/fstab I've mounted an external storage volume with:

// /home/me/external_backup_volume cifs user=xyz,password=xyz,users 0 0

Daily I'm syncing files from a local folder to the mount point:

rsync --progress -arnz /backup /home/me/external_backup_volume

When I unmount /home/me/external_backup_volume I still see subdirectory and folders. Are the files still available even when the backup storage is unmounted? From ls -al it looks like but If I check df with the drive mounted and not the local disc usage of /dev/md2 does not change:

me@Ubuntu-1804-bionic-64-minimal:~$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 16G 0 16G 0% /dev
tmpfs 3.2G 1.1M 3.2G 1% /run
/dev/md2 436G 105G 310G 26% /
tmpfs 16G 8.0K 16G 1% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/md1 488M 204M 259M 45% /boot
tmpfs 3.2G 0 3.2G 0% /run/user/1000
// 100G 46G 55G 46% /home/me/external_backup_volume
me@Ubuntu-1804-bionic-64-minimal:~$ umount /home/me/external_backup_volume
me@Ubuntu-1804-bionic-64-minimal:~$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 16G 0 16G 0% /dev
tmpfs 3.2G 1.1M 3.2G 1% /run
/dev/md2 436G 105G 310G 26% /
tmpfs 16G 8.0K 16G 1% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/md1 488M 204M 259M 45% /boot
tmpfs 3.2G 0 3.2G 0% /run/user/1000

So why do I still see the files when the drive is unmounted?

4

1 Answer

Mounting a remote share (or a partition)

To mount a remote share (or a partition of a hard drive), you first need to have a local folder in the location where you want to mount that partition or remote share.

In your case, /home/me/external_backup_volume means a local folder named external_backup_volume must have been created (by you) in your Home folder /home/me/.

When the remote share is unmounted...

The folder /home/me/external_backup_volume is just a local folder in the server. It should be empty. However, it is just a local folder like any other local folder. This means you can create sub-folders in it and put files in it.

If you put files in this local folder you won't be able to see or access them when the remote share is mounted.

What happens when the remote share is unmounted?

The local folder /home/me/external_backup_volume is exposed. This can happen by accident. May be network was down. Or you had forgotten that you had unmounted the share when you ran the rsync command. As a result rsync copied the contents of the /backup folder into the local folder instead of into the remote share where you wanted it to be copied.

That is the reason you find a copy of the contents of your /backup folder in the local folder /home/me/external_backup_volume when the remote share is unmounted. You can go through the files to figure out when this may have happened. You can also empty the local folder /home/me/external_backup_volume.

Just make sure the remote share is not mounted when you "empty" the local folder. Because if the remote share is mounted, then you will be emptying the contents of the remote share, not the local folder.

In the future you may want to make sure that the remote share is mounted before you run the rsync and once again after rsync has completed just to make sure all the files went to the remote share, and not in the local folder.

Hope this helps

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy