LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 10-17-2021, 07:23 PM   #1
polarbear20000
Member
 
Registered: Oct 2006
Location: Crestview, FL
Distribution: Slackware 13, Debian 8.1
Posts: 105
Blog Entries: 1

Rep: Reputation: 17
Question Mounting issue with HDD under Raspbian 10 (RPI os?)


OK, I've been fighting this for a time and my mind is burnt.

I have a Raspberry Pi 3B+ in my RPi stable that I've decided to use in an Internet Radio receiver project. The installation of the OS is no problem - I've done it before.

My problem comes when I try to mount a notebook HDD. The RPi sees the swap space that I set up, no problem. I've partitioned into a 2 gig unused, a 4 gig for swap, and the rest ~690 gig for data.

I am aware that a HDD is slower than the SD card, but I wanted to try it and see. My thoughts are to use it to hold a good chunk of my music library on those occasions I don't have a network connection to my media server.

/dev/sda1 - unused
/dev/sda2 - swap
/dev/sda3 - data

I've set up a mount point in fstab, as follows:
UUID=9a8108b5-56fb-41c6-b315-eaa0975341ef /mnt/jukebox ext4 rw,relatime,nofail,user 0 2

I'm a little rusty on setting mountpoints, so I could have something wrong there.

When I try manually mounting the drive's /sda3 partition, I get this error:
> sudo mount /dev/sda3 /mnt/jukebox
column: /dev/sda3: Permission denied

and later after chown'ing /mnt/jukebox to me:
column: Invalid or incomplete multibyte or wide character

Isn't column a command having to do with how data is displayed onscreen??

I have checked power to the drive and it's good to go, especially with accepting the swap partition.

Flash drives usually mount right up, but don't have the capacity I desire.

Any ideas? I debated posting this to the Debian forums instead but wellllll, it's a Raspberry Pi and wanted to try here first without crossposts.

Thanks in advance.
 
Old 10-17-2021, 08:34 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,760

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
Quote:
Isn't column a command having to do with how data is displayed onscreen??
Yes it is...

Check the output of the command
type mount
 
Old 10-18-2021, 09:04 AM   #3
polarbear20000
Member
 
Registered: Oct 2006
Location: Crestview, FL
Distribution: Slackware 13, Debian 8.1
Posts: 105

Original Poster
Blog Entries: 1

Rep: Reputation: 17
mount by itself (this morning and on first boot) gives me:

Code:
/dev/mmcblk0p2  on  /                                type  ext4        (rw,noatime)
devtmpfs        on  /dev                             type  devtmpfs    (rw,relatime,size=439400k,nr_inodes=109850,mode=755)
sysfs           on  /sys                             type  sysfs       (rw,nosuid,nodev,noexec,relatime)
proc            on  /proc                            type  proc        (rw,relatime)
securityfs      on  /sys/kernel/security             type  securityfs  (rw,nosuid,nodev,noexec,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)
cgroup2         on  /sys/fs/cgroup/unified           type  cgroup2     (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup          on  /sys/fs/cgroup/systemd           type  cgroup      (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
none            on  /sys/fs/bpf                      type  bpf         (rw,nosuid,nodev,noexec,relatime,mode=700)
cgroup          on  /sys/fs/cgroup/blkio             type  cgroup      (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup          on  /sys/fs/cgroup/cpu,cpuacct       type  cgroup      (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup          on  /sys/fs/cgroup/cpuset            type  cgroup      (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup          on  /sys/fs/cgroup/net_cls,net_prio  type  cgroup      (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
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)
cgroup          on  /sys/fs/cgroup/pids              type  cgroup      (rw,nosuid,nodev,noexec,relatime,pids)
cgroup          on  /sys/fs/cgroup/perf_event        type  cgroup      (rw,nosuid,nodev,noexec,relatime,perf_event)
systemd-1       on  /proc/sys/fs/binfmt_misc         type  autofs      (rw,relatime,fd=28,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)
tmpfs           on  /run/user/1001                   type  tmpfs       (rw,nosuid,nodev,relatime,size=94536k,mode=700,uid=1001,gid=1001)
 
Old 10-18-2021, 09:21 AM   #4
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,333
Blog Entries: 3

Rep: Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730Reputation: 3730
Do you have anything in /etc/fstab for sda3 or /mnt/jukebox?

If so, I would remove it. If not, then go to the next step anyway:

Then add a UUID entry there in fstab instead of referring to the partition by device name.

Code:
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /mnt/jukebox ext4 auto,nofail,rw,user,noatime  0 0
Supposedly nofail has to come after auto in that sequence. See "man fstab"
 
Old 10-18-2021, 12:21 PM   #5
polarbear20000
Member
 
Registered: Oct 2006
Location: Crestview, FL
Distribution: Slackware 13, Debian 8.1
Posts: 105

Original Poster
Blog Entries: 1

Rep: Reputation: 17
Quote:
Originally Posted by Turbocapitalist View Post
Do you have anything in /etc/fstab for sda3 or /mnt/jukebox?

If so, I would remove it. If not, then go to the next step anyway:

Then add a UUID entry there in fstab instead of referring to the partition by device name.

Code:
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /mnt/jukebox ext4 auto,nofail,rw,user,noatime  0 0
Supposedly nofail has to come after auto in that sequence. See "man fstab"
Thank you for your help and suggestions!

I figured out part of the problem. I've used UUID now in the file, but I'm getting ahead of myself. I restarted from scratch, as I hadn't done anything major to break anything (yet.) I rewrote the SD card and went through all the the setup that I do with every RPi. I have a 'cheat sheet' of things gathered from the Net that I put together with steps of things to do on a new install and one of those things is a fairly sizable alias commands. I believe my mistake isn't so much the aliases as it's the 'exec bash' that I did instead of 'sudo nano ~/.bash_aliases.' Lazy typist, I know. As far as I know, there's no real limit on size of aliases - not that I would remember all of them after a long, long day.

I deviated from my list and was able to mount the drive using 'sudo mount /dev/sda3 /mnt/jukebox' with no issues. I think I'll try a very minimal set of aliases this time and see if that was the issue.

I also have not added the root user this time.

Here is my cheat sheet if you're interested.

Code:
---------------------------------------------------------
 -  Joe's preferred setups for a Raspberry Pi (07/2020) -
---------------------------------------------------------

PuTTY is the current program that I'm testing for use while making SSH connections to a Raspberry Pi.
https://www.putty.org/

Using KiTTY
 
 <snippety-snip-snip hostnames, passwords and other stuff>

====================
--- RPi Configuration ---
====================

	> su root (not necessary, run as user 'pi' for now)
	> sudo raspi-config

Change these options:
   Locale
   Keyboard Layout
   Timezone 

Enable SSH

Create user 'joe' and add to sudoer

	> sudo adduser joe
	> sudo adduser joe sudo
	
Update system software

	> sudo apt-get update
	> sudo apt-get upgrade -y
    > sudo apt autoremove   (if necessary)


=====================
--- Change to user 'joe' ---
=====================

	> su joe

===================
--- Change Password ---
===================

	> sudo passwd joe
	--- This is for changing passwords if messed up.

==================
--- Get IP Address ---
==================

	> hostname -s
	---- This returns the RPi hostname (e.g. 'ipradio' or 'gnat' or 'elements' and so forth)
	> hostname -I (Capital 'Eye')
	---- This returns the dotted-quad IP address (e.g. xxx.yyy.z.www)
	
==================
--- Check hosts file ---
==================

	> sudo nano /etc/hosts
    --> get the IP addresses for all Joe's other computers to put here.
	
=====================
--- Change hostname ---
=====================

	> sudo nano /etc/hostname

--- Change the hostname
	> sudo /etc/init.d/hostname.sh
    ( currently 'elements' as of 10/7/2020, and 'weather-pi' as of 7/28/2021 for weather station RPi)
	
	or, use the 'hostname' command - see above
	
=======================
-- Finding attached drives --
=======================

	> sudo fdisk -l
	
============================
-- Mounting Flash Drive at Boot --
============================

ID Devices Unique ID 
	> ls -l /dev/disk/by-uuid/
    ( 7EE3-5C62 --> sda1
	 (A287-5D20 -> ../../sdb1)

	
Create a Mount Point
-- "USER" is 'joe' and the mountpoint can change

	> sudo mkdir /media/usb
	> sudo chown -R USER:USER /media/usb (replace USER with joe or whatever user like below)
	> sudo chown -R joe:joe /media/usb

Manually Mount The Drive

	> sudo mount /dev/sda1 /media/usb -o uid=pi,gid=pi
	> sudo mount /dev/sda3 /media/depot uid=joe,gid=joe
sudo mount /dev/sda2 /mnt/jukebox uid=joe,gid=joe

Un-mounting The Drive
--- You don’t need to manually un-mount if you shutdown your Pi but if you need to remove the drive at any other time you should un-mount it first. Only the user that mounted the drive can un-mount it.
	> umount /media/usb

--- If you used the fstab file to auto-mount it you will need to use :
	> sudo umount /media/usb

--- If you are paying attention you will notice the command is “umount” NOT “unmount”!

Auto Mount
	> sudo nano /etc/fstab
	
--- add the following line at the end :

	> UUID=WHATEVER /media/usb vfat auto,nofail,noatime,users,rw,uid=pi,gid=pi 0 0
	> UUID=7EE3-5C62 /media/usb vfat auto,nofail,noatime,users,rw,uid=pi,gid=pi 0 0

--- The “nofail” option allows the boot process to proceed if the drive is not plugged in. The “noatime” option stops the file access time being updated every time a file is read from the USB stick. This helps improve performance.

--- Mount
    > sudo mount -a

 Reboot

	> sudo reboot

===================
-- Adding HDD Swap  --
===================

] Section under contruction [

===================
-- Adding FTP Server  --
===================

sudo apt install vsftpd openssl-blacklist
sudo nano /etc/vsftpd.conf
sudo /etc/init.d/vsftpd restart

=================================
-- Adding Homegrown  SSH Certificate  --
=================================

In progress

===========
-- Aliases:  --
===========

	For this section, be user 'joe' and copy everything into bash_aliases. Use the source command at the end of this section to load it for use.

	> sudo nano ~/.bash_aliases

<snip>

# Joe's preferred custom Bash aliases
alias amend="sudo apt update && sudo apt upgrade -y"
alias adjourn="sudo apt update && sudo apt upgrade -y && sudo shutdown now -h"
alias reload="source ~/.bashrc && echo Bash config reloaded"
alias ll="ls -l"
alias la="ls -la"
alias ls='ls -AlhF --color=auto' | more
alias l.='ls -d .* --color=auto'
ls -la | more

# Power
alias poweroff="systemctl poweroff"
alias reboot="systemctl reboot"

#Sudo thingy
alias sudo='sudo '

# Common typing errors
alias cd..='cd ..'
alias cd~='cd ..'

# Make some of the file manipulation programs verbose
alias mv="mv -v"
alias rm="rm -vi"
alias cp="cp -v"

# Directory
alias mkdir="mkdir -pv"

# wget
alias wget="wget -c"

# Prints disk usage in human readable form
alias d="du -sh"
alias df="df -Tha --total"
alias du="du -ach | sort -h"
alias free="free -mt"

# Clear the screen of your clutter
alias c="clear"
alias cl="clear;ls;pwd"

# GREP Notifications
alias grep="grep --color -n"
alias grepp="grep -P --color"

## Colorize the grep command output for ease of use (good for log files)##
# alias grep='grep --color=auto'
# alias egrep='egrep --color=auto'
# alias fgrep='fgrep --color=auto'

# Edit shortcuts for config files
alias sshconfig="${EDITOR:-nano} ~/.ssh/config"
alias doalias="sudo nano ~/.bash_aliases"
alias bashrc="${EDITOR:-nano} +120 ~/.bashrc && source ~/.bashrc && echo Bash config edited and reloaded."

# SSH helper
alias sshclear="rm ~/.ssh/multiplex/* -f && echo SSH connection cache cleared;"
alias sshlist="echo Currently open ssh connections && echo && l ~/.ssh/multiplex/"

# untar command I can never remember
alias untar='tar -xvf'

# General
alias top="htop"
alias mount='mount |column -t'
alias now='date +"%T"'
alias nowtime=now
alias nowdate='date +"%d-%m-%Y"'

# Stop ping after sending count ECHO_REQUEST packets #
alias ping='ping -c 5'
# Do not wait interval 1 second, go fast #
alias fastping='ping -c 100 -s 2'

# do not delete / or prompt if deleting more than 3 files at a time #
alias rm='rm -I --preserve-root'
 
# confirmation #
alias mv='mv -i'
alias cp='cp -i'
alias ln='ln -i'
 
# Parenting changing perms on / #
alias chown='chown --preserve-root'
alias chmod='chmod --preserve-root'
alias chgrp='chgrp --preserve-root'

# Web server things, might not use
# also pass it via sudo so whoever is admin can reload it without calling you #
alias nginxreload='sudo /usr/local/nginx/sbin/nginx -s reload'
alias nginxtest='sudo /usr/local/nginx/sbin/nginx -t'
alias lightyload='sudo /etc/init.d/lighttpd reload'
alias lightytest='sudo /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -t'
alias httpdreload='sudo /usr/sbin/apachectl -k graceful'
alias httpdtest='sudo /usr/sbin/apachectl -t && /usr/sbin/apachectl -t -D DUMP_VHOSTS'

## pass options to free ##
alias meminfo='free -m -l -t'
 
## get top process eating memory
alias psmem='ps auxf | sort -nr -k 4'
alias psmem10='ps auxf | sort -nr -k 4 | head -10'
 
## get top process eating cpu ##
alias pscpu='ps auxf | sort -nr -k 3'
alias pscpu10='ps auxf | sort -nr -k 3 | head -10'
 
## Get server cpu info ##
alias cpuinfo='lscpu'

# make executable
alias ax="chmod a+x"

# quick off (in progress)
# alias fuckoff="sudo shutdown now -h"

#WeeWX stuff
alias wxgo="sudo /etc/init.d/weewx start"
alias wxstop="sudo /etc/init.d/weewx stop"
alias wxre="sudo /etc/init.d/weewx restart"

</snip>
.........................................................

	> source ~/.bashrc
		or
	> exec bash (I think this causes problems with column and mounting)
	
	
URLs
https://www.cyberciti.biz/tips/bash-aliases-mac-centos-linux-unix.html


===============================
--- Command Line package search ---
===============================

The apt-cache search command will return all packages that have name in the package name or description:

 > apt-cache search name
Once you have a package name, you can get more detailed information on the package using the apt-cache show and apt-cache showpkg commands.

> apt-cache show package_name
> apt-cache showpkg package_name

portabase


====================
--- RPi update string --- 
====================

	> sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get dist-upgrade && sudo rpi-update

==============
--- Bluetooth ---
==============

	> sudo apt install bluetooth pi-bluetooth bluez blueman

1. To load the Bluetooth command-line tool, you need to enter the following command on your Raspberry Pi.

	> bluetoothctl

2. Now that we are in the Bluetooth command-line tool, we need to go ahead and turn the agent on. Switching the agent on will allow us to search for and pair with other Bluetooth devices. You can do this by using the command below.

	> agent on

3. The next step is to tell the Bluetooth device on our Raspberry Pi to scan for other devices. By scanning for devices, we can retrieve their MAC address and begin the process of pairing that device with the Raspberry Pi. 
To start the scan process, all you need to do is enter the following command.

	> scan on

From this command, you should start seeing a result like what we have below.

	[bluetooth]# scan on
	Discovery started
	[CHG] Controller DC:A6:32:05:7F:06 Discovering: yes
	[NEW] Device 51:B8:16:6A:6F:C6 51-B8-16-6A-6F-C6
	[NEW] Device 40:23:43:3F:4E:58 BRAVIA 4K UR2

The two columns you will probably want to pay attention to the most are the third and fourth columns. The third column specifies the MAC address of the device that triggered the event. This address is what you will use if you want to pair the device. The fourth column is the descriptor. For a newly found device, this is typically the device name.

4. Once you have found the MAC address of the device you want to connect to, you can now proceed to pair your Raspberry Pi with it. To get Bluetooth to pair the device to your Raspberry Pi, you need to make use of the following command.

	> pair [XX:XX:XX:XX:XX:XX]

5. When you first pair a device, you will be immediately connected to it. However, once you have gone out of range of the Raspberry Pi’s Bluetooth, you will need to re-connect the device by using the following command.

	> connect [XX:XX:XX:XX:XX:XX]

6. If you don’t want to have to re-pair your device, then you can make use of the trust command. This command works just like the other two commands and requires the MAC address of the Bluetooth device that you want to trust.

	> trust [XX:XX:XX:XX:XX:XX]

You can only trust a Bluetooth device on your Raspberry Pi after you have completed the initial pairing. Hopefully, at this point, you will now have Bluetooth up and running without any issue. 


============================================
---  10 Commands for Raspberry Pi Hardware Info  ---
============================================

On a Windows PC or Mac you can easily find hardware information by looking in System Information or About This Mac. To find out about your Raspberry Pi’s hardware, enter the following:

	> cat /proc/cpuinfo

Discover information about the Raspberry Pi's CPU
This will output information about the device’s processor. For instance, where you see “BCM2708”, this indicates that Broadcom manufactured the chip. Run these proc directory commands to uncover other hardware information.

	> cat /proc/meminfo 							-		displays details about the Raspberry Pi’s memory.
	> cat /proc/partitions 							-		reveals the size and number of partitions on your SD card or HDD.
	> cat /proc/version 								-		shows you which version of the Pi you are using.

Check the current Linux versions
Use these commands to assess what your Raspberry Pi might be capable of. It doesn’t end there. Find further information using the vcgencmd series of commands:

	> vcgencmd get_mem arm && vcgencmd get_mem gpu 		-		will reveal the memory split between the CPU and GPU, which can be adjusted in the config screen.
	> vcgencmd measure_temp 					-		reveals the CPU temperature (vital if you’re concerned about airflow).
	> free -o -h 											-		will display the available system memory.
	> top d1 													-		checks the load on your CPU, displaying details for all cores.
	> df -h 													-		is a great way to quickly check the free disk space on your Raspberry Pi.

How much free space does your Raspberry Pi's SD card have?
	> uptime 												-		is a simple command that displays the Raspberry Pi’s load average.


3 Commands to Check Connected Devices
Just as you can list the contents of a directory with a single command, Linux lets you list devices connected to your computer.

	> ls /dev/sda* 										-		displays a list of partitions on the SD card. For a Raspberry Pi with a HDD attached, substitute sda* with hda*.
	> lsusb 													-		displays all attached USB devices. This is crucial for connecting a hard disk drive or other USB hardware that requires configuration.

Use lsusb to learn about USB devices connected to the Raspberry Pi
If the item is listed here, you should be able to set it up.

	> lsblk 													-		is another list command you can use. This displays information about all attached block devices (storage that reads and writes in blocks).

Raspberry Pi Networking Commands
Check below some of the most common networking commands for Raspberry Pi board.

	> ping 													-		(ping raspberrypistarterkits.com) – to check the communication settings with other host. You can also use the IP address of the host rather than its name.
	> whois abc.com 									-		check the whois information for the domain abc.com.
	> hostname 											-		to check the current hostname.
	> wget https://xyz.com/fileaddress 		-		download the file from the web
	> ifconfig 												-		to show the configuration details of the network.

===============
  --- SSH Stuff ---
===============

Now that we've created a new user and deleted the default user, we want to ensure that only those computers with a certain keyfile can SSH into your Rpi. This prevents certain types of brute-force attacks from gaining access to your Rpi. Now, I am not sure how to create keys on Windows or OS X systems--the following commands are to be performed from a GNU/Linux terminal. If you aren't running a GNU/Linux distro on your client computer (i.e. the computer from which you are SSH'ing into your Rpi; i.e. not your Rpi), you might have to Google "how to create RSA key Windows" or something like that. Sorry that I can't help you with that! If your client computer is running GNU/Linux, then enter the following command (from your client computer):

	> ssh-keygen -t rsa
Save the file wherever you want. I saved it in the default location. Enter a strong passphrase, and re-enter it. Do not forget this passphrase!

Copy the newly-generated RSA key to your Rpi by entering the following command:

	> ssh-copy-id USERNAME@RPI-ADDRESS
E.g.:

ssh-copy-id conrad@192.168.0.13
Enter the passphrase, and if everything went well, you will see a message saying something about having successfully copied the key to your Rpi.

Now let's test out whether it asks us for the key or our username's password when we SSH into the Rpi! Close your SSH session, if one is open, and try to SSH in again. If it asks you for your passphrase instead of your password, success! Give yourself a pat on the back!

From now on, in order to log in to your Rpi, you will need the RSA keyfile that you generated. It is located wherever you told your computer to save it in step 5 above. (By default [in a GNU/Linux system], it is stored in a folder called ".ssh" in your user directory [e.g. /home/username/.ssh/].) Do not lose this keyfile (or the passphrase)! You will need a copy of this file on every computer from which you intend to SSH into your Rpi!

=============
--- skel Stuff ---
=============

Skel
The /etc/skel is used as a template directory (skeleton)
Each time you create a new user on your system, the files in /etc/skel will be copied to the new home directory (/home/pat for example)

pi@pizero:~ $ ls -latr /etc/skel
 total 20
 -rw-r--r--   1 root root  675 May 15  2017 .profile
 -rw-r--r--   1 root root  220 May 15  2017 .bash_logout
 -rw-r--r--   1 root root 3523 Nov 13  2018 .bashrc
 drwxr-xr-x   2 root root 4096 Nov 13  2018 .
 drwxr-xr-x 106 root root 4096 Dec 12 12:25 ..
You can add new files here if you want to set each new user with custom files you create








>> Stuff to review

==============
--- RuneAudio ---
==============

https://www.instructables.com/id/Raspberry-Pi-as-Hi-Fi-player-with-RuneAudio/

=====================
--- Headless RPi Setup ---
=====================

If you were not setting up a headless Raspberry Pi, you can just pop the card in, connect your Pi to a monitor, keyboard, power source and pointing device and boot it up. However, that's not our goal here.

7. Write an empty text file named "ssh" (no file extension) to the root of the directory of the card. When it sees the "ssh" on its first boot-up, Raspberry Pi OS will automatically enable SSH (Secure Socket Shell), which will allow you to remotely access the Pi command line from your PC.

8. Configure a network connection for your Raspberry Pi.

Though you've enabled SSH, which will let you log in and issue terminal commands, you still need a way to actually reach your Pi. You can connect via Wi-Fi / Ethernet, direct Ethernet connection or direct USB connection (Pi Zero only). Here are instructions for each.

Headless Wi-Fi / Ethernet
To setup a Wi-Fi connection on your headless Raspberry Pi, create a text file called wpa_supplicant.conf, and place it in the root directory of the microSD card. You will need the following text in the file.

country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
scan_ssid=1
ssid="your_wifi_ssid"
psk="your_wifi_password"
}

Change the country to "GB" for the UK or to another country code for a different country, and enter your actual SSID and password. Upon boot up, Raspberry Pi OS will log you into that network. However, if you're on a public Wi-Fi network that requires you to click "Ok" on a splash page before you get Internet, this method won't work.

Prefer to use Ethernet? If you plug your Raspberry Pi directly to a wired network, you should be able to access it by its name (raspberrypi or raspberrypi.local) without changing any other files.


=================
--- WeeWX Setup --- 
=================
 python-cheetah-doc python3-markdown python3-memcache python-configobj-doc
  sqlite ftp httpd

WeeWX Debian (Python install below)

http://weewx.com/

This is a guide to installing WeeWX from a DEB package on Debian-based systems, including Ubuntu, Mint, and Raspbian.

Configure apt
Tell apt where to find the WeeWX releases. This only has to be done once - the first time you install WeeWX.

Tell your system to trust weewx.com:
wget -qO - http://weewx.com/keys.html | sudo apt-key add -
For Debian10 and later, use python3:
wget -qO - http://weewx.com/apt/weewx-python3.list | sudo tee /etc/apt/sources.list.d/weewx.list
For Debian9 and earlier, use python2:
wget -qO - http://weewx.com/apt/weewx-python2.list | sudo tee /etc/apt/sources.list.d/weewx.list
Install
Use apt-get to install WeeWX. The installer will prompt for a location, latitude/longitude, altitude, station type, and parameters specific to your station hardware.

sudo apt-get update
sudo apt-get install weewx
When you are done, WeeWX will be running in the background as a daemon.

Status
To make sure things are running properly look in the system log for messages from WeeWX.

sudo tail -f /var/log/syslog
Verify
After about 5 minutes, open the station web page in a web browser. You should see your station information and data. If your hardware supports hardware archiving, then how long you wait will depend on the archive interval set in your hardware.

file:///var/www/html/weewx/index.html
Customize
To enable uploads such as Weather Underground or to customize reports, modify the configuration file /etc/weewx/weewx.conf. See the User Guide and Customization Guide for details.

WeeWX must be restarted for configuration file changes to take effect.

Start/Stop
To start/stop WeeWX:

sudo /etc/init.d/weewx start
sudo /etc/init.d/weewx stop
Uninstall
To uninstall WeeWX but retain configuration files and data:

sudo apt-get remove weewx
To uninstall WeeWX, removing configuration files but retaining data:

sudo apt-get purge weewx
To remove data:

sudo rm -r /var/lib/weewx
sudo rm -r /var/www/html/weewx
Layout
The installation will result in the following layout:

executable:	/usr/bin/weewxd
configuration file:	/etc/weewx/weewx.conf
skins and templates:	/etc/weewx/skins
sqlite databases:	/var/lib/weewx/
generated web pages and images:	/var/www/html/weewx/
documentation:	/usr/share/doc/weewx/
examples:	/usr/share/doc/weewx/examples/
utilities:	/usr/bin/wee_*


Python install

1. Install prerequisites
First, install the prerequisites appropriate for your operating system.

Debian 10 (Buster)
Raspbian 10

Prerequisites for Debian 10 (Buster), Raspbian 10, Ubuntu 18.04-19.10

sudo apt update

# Required
sudo apt install python3-configobj
sudo apt install python3-pil
sudo apt install python3-serial
sudo apt install python3-usb
sudo apt install python3-pip

Suggested with python3-pip:
 python-crypto-doc python-cryptography-doc python3-cryptography-vectors
  python-dbus-doc python3-dbus-dbg gnome-keyring libkf5wallet-bin
  gir1.2-gnomekeyring-1.0 python-secretstorage-doc python-setuptools-doc


# This works for most installations...
sudo apt install python3-cheetah
# ... if not, try this:
sudo pip3 install Cheetah3

# Optional: for extended almanac information
sudo apt install python3-ephem

# Required if you are using MySQL (MariaDB):
sudo apt install mariadb-client
sudo apt install python3-mysqldb
2. Download
Download the source archive weewx-X.Y.Z.tar.gz from weewx.com/downloads.
wget http://weewx.com/downloads/weewx-4.5.1.tar.gz

3. Install WeeWX
After installing the prerequisites, you can install WeeWX itself.

Expand the source archive:

tar xvfz weewx-X.Y.Z.tar.gz (In this case, 4.5.1 but this changes as updates happen)

 -- If you don't change XYZ, this what you get.
tar (child): weewx-X.Y.Z.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now


tar xvfz weewx-4.5.1.tar.gz
Change directory into the expanded archive:

cd weewx-X.Y.Z
To specify an install location different from the default /home/weewx, modify the parameter home in the setup.cfg file. Mac users will want to change it to /Users/Shared/weewx.

Then build and install. Python 2 users: substitute python2 for python3.

python3 ./setup.py build
sudo python3 ./setup.py install

4. Run
Run the main program directly:

cd /home/weewx
sudo ./bin/weewxd
Or as a daemon automatically when the computer starts:

Debian Debian logo Ubuntu logo Mint logoRedhat Redhat logo Centos logo Fedora logoSuSE SUSE logo
cd /home/weewx
sudo cp util/init.d/weewx.debian /etc/init.d/weewx
sudo chmod +x /etc/init.d/weewx
sudo update-rc.d weewx defaults 98
sudo /etc/init.d/weewx start

5. Status
Look in the system log for messages from WeeWX. For example, on Debian systems:

sudo tail -f /var/log/syslog

6. Verify
After about 5 minutes, open the station web page in a web browser. You should see your station information and data. If your hardware supports hardware archiving, then how long you wait will depend on the archive interval set in your hardware.

file:///home/weewx/public_html/index.html
Customize
To enable uploads such as Weather Underground or to customize reports, modify the configuration file /home/weewx/weewx.conf. See the User Guide and Customization Guide for details.

WeeWX must be restarted for configuration file changes to take effect.

Uninstall
To uninstall, simply delete the directory /home/weewx. This will delete WeeWX, configuration files, and data.

sudo rm -r /home/weewx
sudo rm /etc/init.d/weewx
Layout
The installation will place WeeWX in the /home/weewx directory with the following layout:

executable:	/home/weewx/bin/weewxd
configuration file:	/home/weewx/weewx.conf
skins and templates:	/home/weewx/skins/
sqlite databases:	/home/weewx/archive/
generated web pages and images:	/home/weewx/public_html/
documentation:	/home/weewx/docs/
examples:	/home/weewx/examples/
utilities:	/home/weewx/bin/

.................................................

#   This section is for information about the station.

[Station]
    
    # Description of the station location
    location = "Accio Weather"
    
    # Latitude in decimal degrees. Negative for southern hemisphere
    latitude = 30.768
    # Longitude in decimal degrees. Negative for western hemisphere.
    longitude = -86.585
    
    # Altitude of the station, with unit it is in. This is downloaded from
    # from the station if the hardware supports it.
    altitude = 164, foot
    
    # Set to type of station hardware. There must be a corresponding stanza
    # in this file with a 'driver' parameter indicating the driver to be used.
    station_type = AcuRite
    # Driver:       weewx.drivers.acurite
    
    # If you have a website, you may specify an URL
    station_url = https://www.wunderground.com/dashboard/pws/KFLCREST68
    
    # The start of the rain year (1=January; 10=October, etc.). This is
    # downloaded from the station if the hardware supports it.
    rain_year_start = 1
    
    # Start of week (0=Monday, 6=Sunday)
    week_start = 6
	
	
	==============
	--- fstab Notes ---
	==============
	
--- This fstab should be used for the netradio RPi, that uses flash drives and an attached hard drive. This section is uncomplete.
	
	proc            /proc           proc    defaults          0       0
PARTUUID=180fd719-01  /boot           vfat    defaults          0       2
PARTUUID=180fd719-02  /               ext4    defaults,noatime  0       1
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that
Also, I think I need to pare some of this down.

Last edited by polarbear20000; 10-18-2021 at 12:27 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Trying to mount USB drive of RPi A into RPi B suziecat Linux - Newbie 5 09-28-2021 08:23 AM
NFS server/client issue between desktop Debian and RPi raspbian server Thomas Korimort Linux - Networking 8 04-08-2020 02:19 AM
LXer: GNOME 3.33.2 Released, Krita 4.2 Debuts, RPi Camera Modules on RPi Zeros Power the Penguin Watch Project, Intrinsyc Switches Its Home LXer Syndicated Linux News 0 05-30-2019 06:23 AM
LXer: Mini-PC taps RPi Compute Module and supports RPi 2 LXer Syndicated Linux News 0 02-22-2015 03:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 11:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration