Page 1 of 1

Installation sudo chown -R pi:pi .

Posted: Monday 22 January 2024 10:10
by gerard1
ZigBeeForDomoticZ plugin installation
The installation is written for a Raspberry pi.
However I am using a Chinese NUC with Ubuntu.
The command sudo chown -R pi:pi . should be different when you have your a Ubuntu installation.
Could some one explain how to change this line for a Ubuntu installation.
Thanks,

Re: Installation sudo chown -R pi:pi .

Posted: Monday 22 January 2024 11:08
by lost
gerard1 wrote: Monday 22 January 2024 10:10 The command sudo chown -R pi:pi . should be different when you have your a Ubuntu installation.
Could some one explain how to change this line for a Ubuntu installation.
pi is raspberries default account user name (and group). Either change it for the account used for domoticz ('whoami' command will tell your current user name) installation or, from the right account/directory (take care -R is for recursive!), use:

Code: Select all

sudo chown -R $(whoami):$(whoami) .

Re: Installation sudo chown -R pi:pi .

Posted: Monday 22 January 2024 12:12
by HvdW
What is the . (dot) for?

Re: Installation sudo chown -R pi:pi .

Posted: Monday 22 January 2024 12:41
by Kedi
Current directory and the -R is everything below that.

Re: Installation sudo chown -R pi:pi .

Posted: Monday 22 January 2024 14:03
by lost
HvdW wrote: Monday 22 January 2024 12:12 What is the . (dot) for?
3 importants characteristics of unices file trees are:
-Being single rooted, thus no drive letters (firsts for floppies no more use) as windows (a:, b:, c: etc) used natively (if using cygwin, posix compatibility layer for windows that brings many Linux/Unix tools/shells etc, it brings some compatibility making a single root named /cygdrive, so c: becomes /cygdrive/c for instance).
-Current directory is .
-Parent directory is .. (exception for root directory or a mount point, where .. points to itself so same as .), that keeps the needed tree link, here are first 2 inodes of my system root:

Code: Select all

ls -ai / | head -n 2
      2 .
      2 ..
=> same inode = 2

For my current account home directory:

Code: Select all

ls -ai ~ | head -n 2
16384001 .
       2 ..
Different inodes nb for . and .. here, that's correct as it's not a root. But you can see parent .. is also inode 2: Same as / but why? Let's see /home under /home/MY_USERNAME:

Code: Select all

ls -ai /home | head -n 2
       2 .
       2 ..
Home is not my system root, but a mount point (so same situation, that's another FS so same inode allocation starting from it's own root) as I always use separate partition for /home when installing a Linux/Unix machine (better if full OS re-installation someday needed: I can completely screw / system partition and keep /home intact, not re-format done by installer).

File that declares mounts to be done at boot confirms (that's now UUID instead of /dev/sdX to identify partitions but there is still installer comments):

Code: Select all

grep /dev/sd /etc/fstab 
# / was on /dev/sda2 during installation
# /boot/efi was on /dev/sda1 during installation
# /home was on /dev/sda4 during installation

=> / is on second drive partition (1st is the mandatory one since UEFI replaced legacy BIOSes, as I show this from a Linux PC and not my PI) ; /home on 4th partition thus not directly inside / as it would be if followed Debian installer defaults.