Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieve path device and filesystem via df command #606

Closed
wants to merge 1 commit into from

Conversation

karlicoss
Copy link

So, I finally decided to automate my backups and use backintime. I tested scheduled udev-triggered backups on a flash drive few days ago, everything worked fine. So I decided to configure backups on my external HDD today, but it didn't work, plugging in the drive didn't trigger backintime.

After a short investigation, I found out my udev file was set up to trigger on some unknown UUID, even blkid wouldn't list it. So, I dug in source code and figured out that the tools.device function returned None for my drive.

The reason was: its label ('karlicoss hdd') contained a space, so it was mounted to /media/karlicos/karlicoss hdd/, however, /etc/mtab treats spaces as separators, so he escapes paths like

`/dev/sdb1 /media/karlicos/karlicoss\040hdd fuseblk rw,nosuid,nodev,....`

As you can see, spaces map to \040. So, probably a good idea is, instead of manually parsing /etc/mtab, use the df command from coreutils, which does all the job for us.

A followup question, what is the rationale behind this UUID fallback logic? In my case, it seemed to have cached the flash drives' UUID, and silently used it instead my HDD's UUID. Maybe, we should at list show some warning/notification to user so he knows something went not as expected?

df command encapsulates mtab so we don't have to parce it ourselves.
In particular, fixes a bug when paths with spaces where not handled
properly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant