[NC19] How to move user data, without hickups

,

sorry, I give you the right screenshot

i used this command : sudo chmod -R 750 /data-path

i found something : maybe your mount point isn’t accessible for www-data ?

sudo chown www-data:www-data /mnt/
or
sudo chown root:www-data /mnt/
sudo chown 770 /mnt/

Do you mean:

sudo chown www-data:www-data /mnt/
or
sudo chown root:www-data /mnt/
sudo chown 770 /mnt/

or /mnt/ncdata?

But we have to get back to problem 1 (which is my fault, i soft of forgot this problem), for some reason i have moved the data quite a while ago from the ZFS pool. But when i destroy the pool and remove the (virtual) discs, i am getting all kind of errors during a reboot.

Do you know if there are any connections between Nextcloud and the ZFS pool? I thought it only held the /ncdata/mnt mountpoint + the data. But it looks liks there some sort of other connections / dependency.

@Operations
The mount point /mnt is accessible for www-data ? www-data can read/write/modify in this directory ?
what kind of errore have you during reboot ?

I just read your topic from the beginning :
I’ve just read your topic from the beginning, an error was made when transferring files from one directory to another.
to move nexcloud and data files of user : sudo rsync -av /starting directory /arrival directory

@Mageunic,

How do i check this?

Thanks for your help so far. I you don’t mind i would like to create a fresh clone tomorrow (from my real Nextcloud) and start over with this “move the data and remove ZFS pool”.

A lot of problems keep coming back and some info is not valid anymore. Like i said i would like to start over i will tell you step by step what i did. This should also make it easier for you right?

I was also wondering we both used 750 to set the right, but looking here:

It looks like nextcloud is says you should use 770, right?

And of course i will use your move command instead of the one i used.

Sudo rsync -av /mnt/ncdata /mnt/ncdata_new directory

@Operations if you want you can use 770. There is no difference in this case because www-data is the owner and the group of the directories.

to check if the mount point /mnt is accessible for www-data :
ls -l / and check if www-data have right permission on /mnt

@Mageunic,

Is this the correct result?

@Operations www-data can only read and execute in /ncdata but not write in this directory :
sudo chown -R 770 /mnt/ncdata :x:

can you show me result for /mnt when you are in / with the same command : ls -l

@Mageunic,

Just to be clear, this is not my new test cloud. So i haven’t used 770 yet. I have used 750 like you and like i said. I wanted to first try and solve these last issues before i started all over again.

Sorry but i don’t know what you mean, you want me to do /mnt/ncdata/ls -l and show you the result (and than after doing sudo chown -R 770 /mnt/ncdata, check ls -l again?)?

ok sorry, I will try to find a solution for your zfs pool now

You of course don’t have to apologise :slight_smile:

I did the sudo chown -R 770 /mnt/ncdata:

Is this what you expect to see / the correct result?

Side question: could you explain why it shows drwxr-xxxx 16 root www-data DATE + TIME ncdata

And after my command it includes “770”? So

drwxr-xxxx 16 770 root www-data DATE + TIME ncdata

Why didnt it include “750” before? Since i did use sudo chown -R 750 /mnt/ncdata before.

@Mageunic

When i use the same command on my LIVE nextcloud the first column “drw
” is different and it also doesn’t show 770 and it show “www-data” twice instead of once. Shouldn’t my test and live nextcloud show the same? Isn’t this the problem?

@Operations
i made a big mistake on my comand 


do this :
sudo chown -R root:www-data /mnt/ncdata
sudo chmod -R 755 /mnt/ncdata

“chown” is for set users
and “chmod” is for set permission

in my last command : sudo chown -R 770 / mnt / ncdata

you have set 770 as a owner of your directory

read this to understand the file system permission of ubuntu :

it seems that nextcloud does not have write access on /mnt/ncdata :

rwx is for user root , r-x is for www-data and - - - is for other users.

" - " means that the user does not have permission

@Mageunic,

No problem of course we all make mistakes :stuck_out_tongue:
I have done what you said, but to understand what we are doing:
i should have done this:

sudo chmod -R 755 /mnt/ncdata instead of sudo chown -R 770 /mnt/ncdata right?

should this be correct?

@Operations
i have checked my last post and i made mistake again 
 maybe one day I’ll be able to do the command correctly.

So nextcloud needs write access to the directory so do this

sudo chmod -R 770 /mnt/ncdata

for your ZFS error have you find a solution ?

@Mageunic,

ZFS error is probaly still there, that happens after a reboot. So if you think the rights/users issue is okee now, i will reboot to see what happens with ZFS. As far as you know there are no connections between ZFS and Nextcloud if have to have remove? It is just a simple and “dumb” storage solution (like RAID) right?

@Operations
When you destroyed your ZFS Pool , have do this command before : sudo umount /path-of-your-ZFS-Pool ??

there is no connection between nextcloud and ZFS , nextcloud see your ZFS Pool like a directory where the data is stored.

@Mageunic,

Like i said earlier, i did this:

pvcreate /dev/sdd1
vgcreate vg-next-data /dev/sdd1
lvcreate -L 190G -n lv-next-data vg-next-data

mkfs.ext4 /dev/vg-next-data/lv-next-data
mkdir /mnt/ncdata_new
mount /dev/vg-next-data/lv-next-data /mnt/ncdata_new

sudo systemctl stop apache2
sudo systemctl stop postgresql
sudo rsync -avP /mnt/ncdata /mnt/ncdata_new/
umount /mnt/ncdata
umount /mnt/ncdata_new
mount /dev/vg-next-data/lv-next-data /mnt/ncdata

/mnt/ncdata was the zfs pool / on the pool. So i unmounted that, but that is probably not what you mean right? I could go back a snapshot to properly destroy the ZFS pool?