Problem after changing data directory

Hey guys,

i changed the data directory of my nextcloud to an external hdd.
now iam recieving the following error:

i already changed the permissions to 0770 with the following command: sudo chmod 770 /media/nextcloud

Do i have to do anything else or why are the rights not correct set?

regards
Florian Taut

Please make sure, that only the user, which runs Apache or Nginx is set as the owner/group of those files/folders, has access to those files/folder. This will either be apache:apache or www-data:www-data, depending on your OS.

0770 is only the permissions, but not the owner, as requested.

When i try to chown the named directory im recieving the following error:
chown: der Eigentümer von „/media/nextcloud/“ wird geändert: Die Operation ist n icht erlaubt

What could cause this error?

That depends… you should be able to do that as root. What are the results of these commands:

whoami
ls -l /media

What file system is used on the external drive? If it is FAT32/NTFS formatted, then this might help:

1 Like

It certainly sounds like a fat/ntfs type of issue. If this drive is to be permanently associated with the server consider formatting it with ext3 ext4 (or another Linux offering)

I formatted it to exfat storage before on my windows computer.

Should I use ext3 or ext4 instead?

Just use ext4.

1 Like

Now i have the problem that i dont know how to format it with my Windows host.

When i try to format it with my cloud host with the following command: mkfs.ext4 /dev/sda1

Im now recieving the following message:

Did you backup the /data folder before you formatted?

If so, put it back on the newly formatted disk, then:

sudo chown -R www-data:www-data /path/to/data
sudo chmod -R 0770 /path/to/data

Don’t forget to make sure the paths are still the same, otherwise you’ll also need to update your config.php file with the new path.

Also, if you don’t already, consider mounting the drive permanently in fstab under a path you specify. If it differs from currently you’ll need to update the config.php and database.

@JasonBayton probably you didn’t see my last post.

I can’t even write to the external device. I didn’t copy any data yet.

Oh right, sorry I glazed over a bit with the German :slight_smile:

No point trying to format it with Windows, on the linux box you can locate the disk with sudo fdisk -l then use parted to start completely fresh with the disk. /dev/sda1 is normally the OS drive/partition. Please be careful…

No its not my os drive.
Im running my nextcloud on an raspberry pi.

So i tried to create a new partition with parted mkpart primary ext4 8MiB 100%

Everyting runs through without errors but no partition is created…

Anybody has a hint for me what im doing wrong

can you post the contents of /etc/fstab ? And what OS are you running on the RPi?

@budy Nothing has been added to my fstab.

Im Running raspian jessie

Please type mount into the cli and post the output.