Backup domoticz on Mac HDD through mount on Raspberry Pi

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
krizzz
Posts: 200
Joined: Wednesday 20 November 2013 20:36
Target OS: Linux
Domoticz version:
Location: The Netherlands
Contact:

Backup domoticz on Mac HDD through mount on Raspberry Pi

Post by krizzz »

Maybe someone here can help me with this. I am trying to mount my Mac HDD on a mount location on my Mac.

In My FSTAB I have the following entry

Code: Select all

 //192.168.0.XX/Volumes/Data2TB-1/Backup/Images/Domoticz /mnt/backup/ cifs vers=1.0,user=XXX,password=XXX,x-systemd.automount 0 0
But when mounting

Code: Select all

 sudo mount -a
I receive the following error.

Code: Select all

 mount error(2): No such file or directory
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
I know the location on the disk is right. I copied paste the location from the Mac.

Also the location on the Pi is correct with the correct reading and writing permissions

Code: Select all

 pi@raspberrypi:/mnt $ ls -l
total 4
drwxrwxr-x 2 root root 4096 Jan 2 23:36 backup
So I am lost why I keep getting this error message. Someone here with an idea?


Verzonden vanaf mijn iPhone met Tapatalk
User avatar
erem
Posts: 230
Joined: Tuesday 27 March 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Amsterdam/netherlands
Contact:

Re: Backup domoticz on Mac HDD through mount on Raspberry Pi

Post by erem »

try and remove the last slash from /mnt/backup/

or you can try to mount the directory in you backup script like this

Code: Select all

sudo mount -t cifs //192.168.0.XX/Volumes/Data2TB-1/Backup/Images/Domoticz /mnt/backup -o username=XXX,password=XXX,vers=1.0
and sudo umount /mnt/backup after
Regards,

Rob
krizzz
Posts: 200
Joined: Wednesday 20 November 2013 20:36
Target OS: Linux
Domoticz version:
Location: The Netherlands
Contact:

Re: Backup domoticz on Mac HDD through mount on Raspberry Pi

Post by krizzz »

erem wrote: Sunday 03 January 2021 12:10 try and remove the last slash from /mnt/backup/

or you can try to mount the directory in you backup script like this

Code: Select all

sudo mount -t cifs //192.168.0.XX/Volumes/Data2TB-1/Backup/Images/Domoticz /mnt/backup -o username=XXX,password=XXX,vers=1.0
and sudo umount /mnt/backup after
So first of all, thanks for the help! I tried your suggestion, bt received the following message:

Code: Select all

Couldn't chdir to /mnt/backup: No such device
That's strange, lets try to go to the directory:

Code: Select all

pi@raspberrypi:~ $ cd /mnt

Code: Select all

pi@raspberrypi:/mnt $ ls
backup
Ok, the backup dir is there

Code: Select all

pi@raspberrypi:/mnt $ cd backup
gives me

Code: Select all

-bash: cd: backup: No such device
Very very strange. So I thought I try and remove the dir and create new one:

Code: Select all

pi@raspberrypi:/mnt $ rmdir backup
rmdir: failed to remove 'backup': Permission denied
So there is something wrong with the permissions of the dir, maybe that we the issue in the first place. But now I am trying to remove the dir and it refuses :(

Code: Select all

pi@raspberrypi:/mnt $ rm -Rf backup
rm: cannot remove 'backup': Permission denied
MikeF
Posts: 350
Joined: Sunday 19 April 2015 0:36
Target OS: Raspberry Pi / ODroid
Domoticz version: V2022.2
Location: UK
Contact:

Re: Backup domoticz on Mac HDD through mount on Raspberry Pi

Post by MikeF »

krizzz wrote: Friday 08 January 2021 23:40
That's strange, lets try to go to the directory:

Code: Select all

pi@raspberrypi:~ $ cd /mnt

Code: Select all

pi@raspberrypi:/mnt $ ls
backup
Ok, the backup dir is there

Code: Select all

pi@raspberrypi:/mnt $ cd backup
gives me

Code: Select all

-bash: cd: backup: No such device
Are you sure /mnt/backup is actually a directory? (Could be why cd is giving an error). Try

Code: Select all

ls -al
and check.
Very very strange. So I thought I try and remove the dir and create new one:

Code: Select all

pi@raspberrypi:/mnt $ rmdir backup
rmdir: failed to remove 'backup': Permission denied
So there is something wrong with the permissions of the dir, maybe that we the issue in the first place. But now I am trying to remove the dir and it refuses :(

Code: Select all

pi@raspberrypi:/mnt $ rm -Rf backup
rm: cannot remove 'backup': Permission denied
You need to put sudo in front of your commands. Also, to create the directory from within /mnt, you'll need to do

Code: Select all

sudo mkdir backup
User avatar
erem
Posts: 230
Joined: Tuesday 27 March 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Amsterdam/netherlands
Contact:

Re: Backup domoticz on Mac HDD through mount on Raspberry Pi

Post by erem »

MikeF is right.

my /mnt dir looks like this

Code: Select all

pi@RPi-Rob-usb:/mnt $ ls -l
total 8
drwxr-xr-x 2 root root 4096 Apr  7  2020 NAS.MOUNTPOINT
drwxr-xr-x 2 root root 4096 Apr 10  2020 rob
pi@RPi-Rob-usb:/mnt $ 
so make sure you use sudo when trying to mount/umount.
and ls -l will show you the owner and rights. t is important the permissions are set correctly.
Regards,

Rob
krizzz
Posts: 200
Joined: Wednesday 20 November 2013 20:36
Target OS: Linux
Domoticz version:
Location: The Netherlands
Contact:

Re: Backup domoticz on Mac HDD through mount on Raspberry Pi

Post by krizzz »

MikeF wrote: Saturday 09 January 2021 13:19
krizzz wrote: Friday 08 January 2021 23:40
That's strange, lets try to go to the directory:

Code: Select all

pi@raspberrypi:~ $ cd /mnt

Code: Select all

pi@raspberrypi:/mnt $ ls
backup
Ok, the backup dir is there

Code: Select all

pi@raspberrypi:/mnt $ cd backup
gives me

Code: Select all

-bash: cd: backup: No such device
Are you sure /mnt/backup is actually a directory? (Could be why cd is giving an error). Try

Code: Select all

ls -al
and check.
Very very strange. So I thought I try and remove the dir and create new one:

Code: Select all

pi@raspberrypi:/mnt $ rmdir backup
rmdir: failed to remove 'backup': Permission denied
So there is something wrong with the permissions of the dir, maybe that we the issue in the first place. But now I am trying to remove the dir and it refuses :(

Code: Select all

pi@raspberrypi:/mnt $ rm -Rf backup
rm: cannot remove 'backup': Permission denied
You need to put sudo in front of your commands. Also, to create the directory from within /mnt, you'll need to do

Code: Select all

sudo mkdir backup
You are right, I tried with side, but nothing worked. To me now , it looks like a permission problem.

Code: Select all

pi@raspberrypi:/mnt $ ls -l
total 0
drwxr-xr-x 2 root root 0 Feb 14  2019 backup
There is one folder there, but the total says 0?

Also here when trying to remove with sudo, it doesn't work.

Code: Select all

pi@raspberrypi:/mnt $ sudo rmdir backup
rmdir: failed to remove 'backup': Device or resource busy
User avatar
erem
Posts: 230
Joined: Tuesday 27 March 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Amsterdam/netherlands
Contact:

Re: Backup domoticz on Mac HDD through mount on Raspberry Pi

Post by erem »

Maybe there is a problem with your file system.

You can check live file systems in read-only mode with this:

if running from an SD card: e2fsck -vfn /dev/mmcblk0p2
or when running from usb e2fsck -vfn /dev/sda? (sda? is where the root partition is mounted

if this finds errors, force an fchk on reboot via
sudo touch /forcefsck
sudo reboot

After your system boots, check if the file still exists:
sudo ls /forcefsck
If it does, you may want to remove it in order to avoid fsck on every system boot.
Regards,

Rob
Post Reply

Who is online

Users browsing this forum: Daro1003 and 1 guest