How to set up nextcloud pi for external network

@nachoparker

Tried also turning off nc-automount before nc-format-USB but got this error

/dev/sda: 2 bytes were erased at offset 0x000001fe (dos): 55 aa

Welcome to fdisk (util-linux 2.29.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x86758692.

Command (m for help): Created a new DOS disklabel with disk identifier 0xee5d56eb.

Command (m for help): Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p): Partition number (1-4, default 1): First sector (2048-1953458175, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-1953458175, default 1953458175):
Created a new partition 1 of type ā€˜Linuxā€™ and of size 931.5 GiB.
Partition #1 contains a ext4 signature.

Command (m for help):

The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Device or resource busy

The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).

and did you update to the latest version?

sudo ncp-update
sudo reboot

If you run from the web you will see a green dot if it went ok.

This is a successful output

Launching nc-format-USB
/dev/sda: 2 bytes were erased at offset 0x000001fe (dos): 55 aa

Welcome to fdisk (util-linux 2.29.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xf0e7df70.

Command (m for help): Created a new DOS disklabel with disk identifier 0xd7c6eafc.

Command (m for help): Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): Partition number (1-4, default 1): First sector (2048-31266815, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-31266815, default 31266815):
Created a new partition 1 of type 'Linux' and of size 14.9 GiB.
Partition #1 contains a ext4 signature.

Command (m for help):
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

mke2fs 1.43.4 (31-Jan-2017)
/dev/sda1 contains a ext4 file system labelled 'myCloudDrive'
        last mounted on /media/myCloudDrive on Sat Sep  9 07:07:01 2017
Creating filesystem with 3908096 4k blocks and 977280 inodes
Filesystem UUID: 781eb11c-d043-49cc-830b-7cae73ac77ba
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208

Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done

updated ā€¦ rebootā€¦ and now format was successful finally :slight_smile:

nice!! good job!

I think you were on an older version, previous to the latest changes to automount :slight_smile:

so now i just run

nc-automount
and then
nc-datadir
and keep all default values in right?

@nachoparker

so i enabled nc-automount and when it run the nc-datadir then i get this error
/media/USBdrive/ncdata is not empty

yes, default values work fine

that means that you actually have used that directory before, you probably already run nc-datadir.

you can delete that folder before trying again, or you can use another name, like /media/USBdrive/ncdata1

can i delete it by some comand?

because i thought that the format will delete it

If it formatted it correctly (green ball in web) then thereā€™s nothing left in the drive.

Try pasting the following commands to clean up possible things that were left around when you were trying to make it work the first time.

sudo rm -rf /media/USBdrive/ncdata*
sudo umount /media/*
sudo rmdir /media/* &>/dev/null
sudo rm /media/* &>/dev/null
sudo reboot

After reboot, try again. Assuming you have nc-automount enabled, /media/USBdrive will be your USB drive and you can use the default /media/USBdrive for nc-datadir

how do I know that my usbdrive is called myCloudDrive?
Because thats deafulth in your comand but I have no idea what is the name of the drive

i also tried the comands above and the first one nothing happend but then the sudo umount /media/* came back as unknown comand

@nachoparker

now when i run the nc data dir i get error
"Error reading data directory. Is nextcloud running and configured?"

now i dont know ā€¦ is there a way how I can reset all the settings ā€¦ or i should just flash the sd card again

Thanx

how do I know that my usbdrive is called myCloudDrive?

If you donā€™t know the label of the drive, you can leave it as /media/USBdrive, which is the default.

It doesnā€™t find the datadir, makes sense. You can start over if you want, but it is probably easier to just run nc-init which will reset Nextcloud to defaults.

@nachoparker

nc -init is also not working ā€¦ i get
"nc: interval invalid: nit

How did you run it? from nextcloudpi-config?

I just run it with the latest image and it works. Here is the output

Launching nc-init
Setting up database...
Setting up Nextcloud...
Nextcloud is not installed - only a limited number of commands are available
Nextcloud was successfully installed
Set mode for background jobs to 'cron'
System config value mysql.utf8mb4 set to boolean true
System config value trusted_domains => 1 set to string 192.168.0.128
System config value mail_smtpmode set to string php
System config value mail_smtpauthtype set to string LOGIN
System config value mail_from_address set to string admin
System config value mail_domain set to string ownyourbits.com
System config value overwriteprotocol set to string https
Done. Press any key...

I donā€™t understand what is going on. Maybe you should start from zero. Remember to run nc-update before using the NCP web interface or nextcloudpi-config

@nachoparker

I am starting to loosing the believe that i can make it runningā€¦
flashed it againā€¦ plugged in and did just format to the usb drive then auto mount and then datadir
i did it all in tui and all went without errors

then i did reboot and got this error

@nachoparker

good thing is that the nc-init works :stuck_out_tongue_winking_eye:

so will start over