Closed funSoftwareProjects closed 7 years ago
I just remembered, when I do manage to set up the external drive as the storage source, the data doesn't appear in the drive (/media/7blah blah blah). For some reason it appears in /media/USBdrive. As far as I can tell, the drive is not mounted to /media/USBdrive, and adding files to nextcloud does not put them on the external drive.
Thanks for your help!
Hi,
what's the output of
sudo grep datadirectory /var/www/nextcloud/config/config.php
ls -l /media
Hi,
I just finished a tool to help with support. Please, update
sudo ncp-update
and then post the output of
sudo ncp-report
[sudo grep datadirectory] 'datadirectory' => '/media/USBdrive/ncdata',
[ls -l /media] total 16 drwxr-x--- 7 www-data www-data 4096 Nov 18 00:15 7* drwxr-xr-x 3 root root 4096 Nov 18 01:15 a08d85ae-015d-49c8-98f1-604c416f0a6e drwxr-xr-x 2 root root 4096 Nov 18 01:17 ncdata drwxr-xr-x 2 root root 4096 Nov 18 01:17 USBdrive
[sudo ncp-report]
Thanks for the help!
Also, nextcloudpi never seems to update. When I boot it up and login over ssh, I get this message "NextCloudPi v0.34.15 is up to date". Then when I open raspi-config--> nextcloudpi config it says "Update to v0.36.0?" I do this, it says "Downloading updates Performing updates vm.overcommit_memory = 1" Is it supposed to say that bit at the end? When I reboot it still says v0.34.15" Could this be related?
Your data is not at /media/USBdrive/ncdata
. Have you been moving files around? Maybe it is that folder in /media/ncdata
?
Try this
sudo mv /media/ncdata /media/USBdrive
And if it doesn't work, output of
mount
Here is the output of mount. Will doing a fresh install have the same effect as mv the files? If I were trying a fresh install, should I try using the wizard to setup the external drive? Does the nextcloud external drive setup use symlinks? What directory would the drive be linked to, /media/USBdrive?
/dev/mmcblk0p2 on / type ext4 (rw,noatime,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=470184k,nr_inodes=117546,mode=755)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=31,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
sunrpc on /run/rpc_pipefs type rpc_pipefs (rw,relatime)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
/dev/mmcblk0p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
/dev/sda on /media/a08d85ae-015d-49c8-98f1-604c416f0a6e type ext4 (rw,nosuid,nodev,relatime,stripe=8191,data=ordered,uhelper=udisks2)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=94956k,mode=700,uid=1000,gid=1000)
UPDATE: I started fresh and wrote the nextcloud image to the sd card again, and updated with nc-update (which worked fine). I loaded up the nextcloudpi wizard in the browser, formatted the usb drive, then tried to move the data to the usb drive. I got this message: [ nc-format-USB ] /dev/sda: 2 bytes were erased at offset 0x00000438 (ext4): 53 ef Drive sda formatted successfuly and labeled myCloudDrive [ nc-datadir ] Refusing to move to the SD card. Abort
All I see in the /media directory is USBdrive, I don't see any myclouddrive. It kinda looks like the usb drive isn't being mounted properly, despite being formatted correctly.
Hi,
Thanks for reporting again. What you mention surprises me... is automount failing?
Can you try the wizard again, skipping the formatting step?
If it fails, give m the output of
sudo ncp-report
I reran the wizard, sudo ncp-report says:
<--! Paste this in GitHub report -->
the wizard fails again in the same place?
ls -l /media
doesn't show the drive?
Well, it shows it here:
total 8 drwxr-xr-x 3 root root 4096 Nov 19 21:34 myCloudDrive drwxr-xr-x 2 root root 4096 Nov 19 21:40 USBdrive
Now ls /media
shows myCloudDrive USBdrive
When I specify /media/USBdrive/ncdata for nc-datadir
from the nextcloudpi config website, I get Refusing to move to the SD card. Abort
.
I think I know what's going in your case. Let's try this
v.37.2
( from web-ui or sudo ncp-update
)or
v.37.2
( from web-ui or sudo ncp-update
)sudo umount /media/*
sudo rmdir /media/*
sudo rm -rf /media/USBdrive
sudo rm /media/*
sudo reboot
Most of the commands failed. I think the drive wasn't automounted. I tried to open the wizard, but it didn't work, so I opened the nextcloud web interface first and then tried the wizard and it worked. In the wizard, I automounted the usb drive then tried to format it, but of course it said it was still mounted. I unmounted it via the terminal, and tried formatting it again, which took quite a while. The formatting was succesfull and it said Drive sda formatted successfuly and labeled myCloudDrive
, but then when I tried to move the data directory it said
[ nc-datadir ] /media/USBdrive does not exist
So I did sudo mkdir /media/USBdrive
and then sudo mount /dev/sda /media/USBdrive
and that command didn't work. I tried some other commands and then tried nc-datadir again and it said
[ nc-datadir ] Refusing to move to the SD card. Abort
What directory is nc-datadir looking for? Can I just mount the drive manually in the right spot?
ok, that's what I thought, so let's see why you are not getting the link...
/media/USBdrive
foldersystemctl status nc-automount-links
, and ls -l /media
What directory is nc-datadir looking for? Can I just mount the drive manually in the right spot?
Yes, we can do that. I am trying to investigate why it is not working for you, so I can fix it for others. It is strange because in all this time this hasn't happened before
● nc-automount-links.service - Monitor /media for mountpoints and create USBdrive* symlinks
Loaded: loaded (/usr/lib/systemd/system/nc-automount-links.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2017-11-20 16:35:06 UTC; 23s ago
Main PID: 308 (nc-automount-li)
CGroup: /system.slice/nc-automount-links.service
├─308 /bin/bash /usr/local/etc/nc-automount-links-mon
├─316 inotifywait --monitor --event create --event delete --format %f %e /media/
├─317 grep --line-buffered ISDIR
└─318 /bin/bash /usr/local/etc/nc-automount-links-mon
Nov 20 16:35:06 nextcloudpi systemd[1]: Started Monitor /media for mountpoints and create USBdrive* symlinks.
Nov 20 16:35:06 nextcloudpi nc-automount-links-mon[308]: Setting up watches.
Nov 20 16:35:06 nextcloudpi nc-automount-links-mon[308]: Watches established.
Nov 20 16:35:11 nextcloudpi nc-automount-links-mon[308]: myCloudDrive CREATE,ISDIR
output of
ls -l /media
Do you think the reason I am having the problem is due to the hard drive's power strain on the pi? Everything seems to be fine though.
Do you think the reason I am having the problem is due to the hard drive's power strain on the pi? Everything seems to be fine though.
shouldn't be related
total 4 drwxr-xr-x 3 root root 4096 Nov 20 16:06 myCloudDrive
Ok, now run this command,
sudo /usr/local/etc/nc-automount-links
and let's see
ls -l /media
total 4 drwxr-xr-x 3 root root 4096 Nov 20 16:06 myCloudDrive lrwxrwxrwx 1 root root 19 Nov 20 16:38 USBdrive -> /media/myCloudDrive
ok, now it worked... the problem is why it doesn't work by itself.
/media/USBdrive
systemctl stop nc-automount-links
systemctl start nc-automount-links
ls -l /media
systemctl status nc-automount-links
This is what I got for the first commands
Failed to stop nc-automount-links.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files
See system logs and 'systemctl status nc-automount-links.service' for details.
Failed to start nc-automount-links.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files
● nc-automount-links.service - Monitor /media for mountpoints and create USBdrive* symlinks
Loaded: loaded (/usr/lib/systemd/system/nc-automount-links.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2017-11-20 16:35:06 UTC; 39min ago
Main PID: 308 (nc-automount-li)
CGroup: /system.slice/nc-automount-links.service
├─308 /bin/bash /usr/local/etc/nc-automount-links-mon
├─316 inotifywait --monitor --event create --event delete --format %f %e /media/
├─317 grep --line-buffered ISDIR
└─318 /bin/bash /usr/local/etc/nc-automount-links-mon
Nov 20 16:35:06 nextcloudpi systemd[1]: Started Monitor /media for mountpoints and create USBdrive* symlinks.
Nov 20 16:35:06 nextcloudpi nc-automount-links-mon[308]: Setting up watches.
Nov 20 16:35:06 nextcloudpi nc-automount-links-mon[308]: Watches established.
Nov 20 16:35:11 nextcloudpi nc-automount-links-mon[308]: myCloudDrive CREATE,ISDIR
Nov 20 16:44:21 nextcloudpi nc-automount-links-mon[308]: myCloudDrive DELETE,ISDIR
sorry, I forgot that everything goes with sudo
/media/USBdrive
sudo systemctl stop nc-automount-links
sudo systemctl start nc-automount-links
ls -l /media
systemctl status nc-automount-links
total 0
● nc-automount-links.service - Monitor /media for mountpoints and create USBdrive* symlinks
Loaded: loaded (/usr/lib/systemd/system/nc-automount-links.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2017-11-20 17:20:32 UTC; 2min 3s ago
Main PID: 1972 (nc-automount-li)
CGroup: /system.slice/nc-automount-links.service
├─1972 /bin/bash /usr/local/etc/nc-automount-links-mon
├─1974 inotifywait --monitor --event create --event delete --format %f %e /media/
├─1976 grep --line-buffered ISDIR
└─1977 /bin/bash /usr/local/etc/nc-automount-links-mon
Nov 20 17:20:32 nextcloudpi systemd[1]: Started Monitor /media for mountpoints and create USBdrive* symlinks.
Nov 20 17:20:32 nextcloudpi nc-automount-links-mon[1972]: Setting up watches.
Nov 20 17:20:32 nextcloudpi nc-automount-links-mon[1972]: Watches established.
did you plug the USB in after systemctl start
and before systemctl status
?
Hmm, I'll have to try it again.
Ok, just do the whole sequence step by step in order
/media/USBdrive
sudo systemctl stop nc-automount-links
sudo systemctl start nc-automount-links
ls -l /media
systemctl status nc-automount-links
total 0
● nc-automount-links.service - Monitor /media for mountpoints and create USBdriv Loaded: loaded (/usr/lib/systemd/system/nc-automount-links.service; enabled; Active: active (running) since Mon 2017-11-20 19:14:43 UTC; 21min ago Main PID: 4048 (nc-automount-li) CGroup: /system.slice/nc-automount-links.service ├─4048 /bin/bash /usr/local/etc/nc-automount-links-mon ├─4049 inotifywait --monitor --event create --event delete --format % ├─4050 grep --line-buffered ISDIR └─4051 /bin/bash /usr/local/etc/nc-automount-links-mon
Nov 20 19:14:43 nextcloudpi systemd[1]: Started Monitor /media for mountpoints a Nov 20 19:14:43 nextcloudpi nc-automount-links-mon[4048]: Setting up watches. Nov 20 19:14:43 nextcloudpi nc-automount-links-mon[4048]: Watches established.
Currently if I do the wizard it says
[ nc-datadir ]
Refusing to move to the SD card. Abort
As if it doesn't even recognize the drive.
This doesn't make sense. Automount was working for you before. Is it activated?
systemctl status nc-automount
Yes it is.
systemctl status nc-automount
● nc-automount.service - Automount USB drives Loaded: loaded (/usr/lib/systemd/system/nc-automount.service; enabled; vendor preset: enabled) Active: active (running) since Mon 2017-11-20 16:35:06 UTC; 3h 43min ago Main PID: 325 (udiskie) CGroup: /system.slice/nc-automount.service └─325 /usr/bin/python3 /usr/bin/udiskie -NTF
Nov 20 17:10:47 nextcloudpi udiskie[325]: In some cases useful info is found in syslog - try Nov 20 17:10:47 nextcloudpi udiskie[325]: dmesg | tail or so. Nov 20 17:22:04 nextcloudpi udiskie[325]: failed to mount /org/freedesktop/UDisks2/block_devices/sda1: GDBus.Error:org.freedesktop.UDisks2.Error.Failed: Error mounting system-mana Nov 20 17:22:04 nextcloudpi udiskie[325]: missing codepage or helper program, or other error Nov 20 17:22:04 nextcloudpi udiskie[325]: In some cases useful info is found in syslog - try Nov 20 17:22:04 nextcloudpi udiskie[325]: dmesg | tail or so. Nov 20 19:35:54 nextcloudpi udiskie[325]: failed to mount /org/freedesktop/UDisks2/block_devices/sda1: GDBus.Error:org.freedesktop.UDisks2.Error.Failed: Error mounting system-mana Nov 20 19:35:54 nextcloudpi udiskie[325]: missing codepage or helper program, or other error Nov 20 19:35:54 nextcloudpi udiskie[325]: In some cases useful info is found in syslog - try Nov 20 19:35:54 nextcloudpi udiskie[325]: dmesg | tail or so.
I ran dmesg | tail:
[10844.589652] sd 0:0:0:0: Attached scsi generic sg0 type 0 [10845.601250] sd 0:0:0:0: [sda] 1953525167 512-byte logical blocks: (1.00 TB/932 GiB) [10845.601758] sd 0:0:0:0: [sda] Write Protect is off [10845.601775] sd 0:0:0:0: [sda] Mode Sense: 47 00 00 08 [10845.602261] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [10845.714065] sda: sda1 [10845.718467] sd 0:0:0:0: [sda] Attached SCSI disk [10846.326360] FAT-fs (sda1): bogus number of reserved sectors [10846.326373] FAT-fs (sda1): Can't find a valid FAT filesystem [10985.465760] systemd[1]: apt-daily.timer: Adding 55min 54.860604s random time.
aha, you have some problem with udiskie
can you mount manually?
sudo mount /dev/sda1 /mnt
mount
/dev/mmcblk0p2 on / type ext4 (rw,noatime,data=ordered) devtmpfs on /dev type devtmpfs (rw,relatime,size=470184k,nr_inodes=117546,mode=755) sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime) proc on /proc type proc (rw,relatime) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000) tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755) tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k) tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755) cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd) cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct) cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio) cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls) cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer) cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices) cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset) systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=28,pgrp=1,timeout=0,minproto=5,maxproto=5,direct) debugfs on /sys/kernel/debug type debugfs (rw,relatime) sunrpc on /run/rpc_pipefs type rpc_pipefs (rw,relatime) mqueue on /dev/mqueue type mqueue (rw,relatime) configfs on /sys/kernel/config type configfs (rw,relatime) /dev/sda1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro) tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=94956k,mode=700,uid=1000,gid=1000) /dev/sda1 on /mnt type ext4 (rw,relatime,data=ordered)
ls -l still says total 0
ok, udiskie can't mount it but you can mount it manually... smells bad. Did you format it with the wizard ?
can you try doing that again? careful, if you have data it will be lost.
I could format it again, it takes a long time.
let's try that
It's formatting right now.
[ nc-format-USB ] /dev/sda: 8 bytes were erased at offset 0x00000200 (gpt): 45 46 49 20 50 41 52 54 /dev/sda: 8 bytes were erased at offset 0xe8e0db5c00 (gpt): 45 46 49 20 50 41 52 54 /dev/sda: 2 bytes were erased at offset 0x000001fe (PMBR): 55 aa Error: Partition(s) 1 on /dev/sda have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes.
I am trying to use a 1TB hard drive (spinning disk) as the data location with my raspberry pi 2. Every time I try to do this with the NextCloudPi Wizard, I get the message
[ nc-datadir ] Error reading data directory. Is NextCloud running and configured?
I have also received other error messages such as "device is already mounted" or "the directory is not empty" and tried the obvious solution (like deleting data in the drive or unmounting it" but I can't fix it. I can't log into the web interface because it says there is no data directory, but I can log into the config thing at port:4443. I have ssh access currently. Please help! I am planning on using it to sync multiple files across computers, I have gotten it working in the past with just the sd card's small storage, but I can't upgrade to the hard drive.
Thanks!