Ubuntu/Raspberry Pi: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
Line 149: Line 149:
  sudo systemctl status iwd.service
  sudo systemctl status iwd.service


|}
==Device Status==
{|
| valign="middle" |
<source lang="bash">
sudo nmcli dev
:'
DEVICE  TYPE      STATE        CONNECTION
wlan0  wifi      unavailable  --       
eth0    ethernet  unmanaged    --       
lo      loopback  unmanaged    -- 
'
ifconfig
</source>
| valign="middle" |
<source lang="bash">
lsblk
:'
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
loop0        7:0    0  48.9M  1 loop /snap/core18/2127
loop1        7:1    0  57.4M  1 loop /snap/core20/1171
loop2        7:2    0    62M  1 loop /snap/lxd/21032
loop3        7:3    0    49M  1 loop /snap/core18/2248
loop4        7:4    0  28.1M  1 loop /snap/snapd/12707
loop5        7:5    0  60.7M  1 loop /snap/lxd/21843
loop6        7:6    0  28.2M  1 loop /snap/snapd/13643
mmcblk0    179:0    0 119.3G  0 disk
├─mmcblk0p1 179:1    0  256M  0 part /boot/firmware
└─mmcblk0p2 179:2    0  119G  0 part /
'
</source>
|-
| valign="middle" colspan="2" |
----
|-
| valign="middle" |
| valign="middle" |
<source lang="bash">
df -h
:'
Filesystem      Size  Used Avail Use% Mounted on
udev            3.8G    0  3.8G  0% /dev
tmpfs          782M  4.0M  778M  1% /run
/dev/mmcblk0p2  118G  2.8G  110G  3% /
tmpfs          3.9G    0  3.9G  0% /dev/shm
tmpfs          5.0M    0  5.0M  0% /run/lock
tmpfs          3.9G    0  3.9G  0% /sys/fs/cgroup
/dev/loop0      49M  49M    0 100% /snap/core18/2127
/dev/loop1      58M  58M    0 100% /snap/core20/1171
/dev/loop3      49M  49M    0 100% /snap/core18/2248
/dev/loop2      62M  62M    0 100% /snap/lxd/21032
/dev/loop4      29M  29M    0 100% /snap/snapd/12707
/dev/loop5      61M  61M    0 100% /snap/lxd/21843
/dev/loop6      29M  29M    0 100% /snap/snapd/13643
/dev/mmcblk0p1  253M  120M  133M  48% /boot/firmware
tmpfs          782M    0  782M  0% /run/user/1000
'
</source>
|-
| valign="middle" colspan="2" |
----
|-
| valign="middle" |
| valign="middle" |
<source lang="bash">
sudo fdisk -l
:'
Disk /dev/loop0: 48.92 MiB, 51277824 bytes, 100152 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop1: 57.42 MiB, 60198912 bytes, 117576 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop2: 61.98 MiB, 64962560 bytes, 126880 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop3: 48.98 MiB, 51335168 bytes, 100264 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop4: 28.7 MiB, 29433856 bytes, 57488 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop5: 60.68 MiB, 63610880 bytes, 124240 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop6: 28.22 MiB, 29581312 bytes, 57776 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mmcblk0: 119.26 GiB, 128043712512 bytes, 250085376 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xf66f0719
Device        Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk0p1 *      2048    526335    524288  256M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      526336 250085342 249559007  119G 83 Linux
'
</source>
|-
| valign="middle" colspan="2" |
----
|-
| valign="middle" |
| valign="middle" |
<source lang="bash">
sudo fdisk /dev/mmcblk0 -l
:'
Disk /dev/mmcblk0: 119.26 GiB, 128043712512 bytes, 250085376 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xf66f0719
Device        Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk0p1 *      2048    526335    524288  256M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      526336 250085342 249559007  119G 83 Linux
'
</source>
|}
|}



Revision as of 11:43, 14 November 2021

Network Config:

ls -lah /Volumes/system-boot/|grep network-config
cat <<EOF > /Volumes/system-boot/network-config
version: 2
ethernets:
  eth0:
    dhcp4: true
    optional: true
wifis:
  wlan0:
    dhcp4: true
    optional: true
    access-points:
      "ChorkeOrg_2.4GHz":
        password: "sadaqah!"
      "ChorkeOrg":
        password: "sadaqah!"
EOF

User Data:

ls -lah /Volumes/system-boot/|grep user-data
cat <<EOF > /Volumes/system-boot/user-data
#cloud-config
system_info:
  default_user:
    name: pi
chpasswd:
  expire: true
  list:
  - pi:ubuntu
ssh_pwauth: true
runcmd:
- [ df, -h, / ]
- [ sh, -xc, "echo $(date) ': hello academian!'" ]
power_state:
  mode: reboot
EOF

ls -lah /Volumes/system-boot/{.fseventsd,.Spotlight-V100}
rm -rf /Volumes/system-boot/{.fseventsd,.Spotlight-V100}

ssh [email protected]
:<<EOF
The authenticity of host '10.19.83.111 (10.19.83.111)' can't be established.
ECDSA key fingerprint is SHA256:9Lgs5Xxsypm4s/3F87TU2EMh6vUz6pjAMaNHXUDImVs.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '10.19.83.111' (ECDSA) to the list of known hosts.
[email protected]'s password: 
You are required to change your password immediately (administrator enforced)
Welcome to Ubuntu 20.04.3 LTS (GNU/Linux 5.4.0-1042-raspi aarch64)

WARNING: Your password has expired.
You must change your password now and login again!
Changing password for pi.
Current password: 
New password: 
Retype new password: 
passwd: password updated successfully
Connection to 10.19.83.111 closed.
EOF

ssh [email protected]
:<<EOF
[email protected]'s password: 
Welcome to Ubuntu 20.04.3 LTS (GNU/Linux 5.4.0-1042-raspi aarch64)
EOF

Network Config

dpkg --list|grep network-manager
dpkg --list|grep wpasupplicant
dpkg --list|grep iw
apt -qq list network-manager
apt -qq list wpasupplicant
apt -qq list iwd
sudo apt install network-manager
sudo apt install wpasupplicant
sudo apt install iwd

sudo nmcli dev help
sudo nmcli con help
sudo nmcli help
sudo nmcli device wifi list
sudo nmcli device
sudo nmcli con
sudo nmcli dev wifi con 'ChorkeOrg_2.4GHz' password 'sadaqah!'
sudo nmcli dev wifi con 'ChorkeInc' password 'sadaqah!'
sudo nmcli dev wifi con 'ChorkeOrg' password 'sadaqah!'

sudo iw dev wlan0 scan|grep SSID
sudo nmcli dev wifi rescan
sudo nmcli dev wifi
nmcli radio all
sudo apt install net-tools
sudo systemctl status NetworkManager.service
sudo systemctl status wpa_supplicant.service
sudo systemctl status iwd.service

Device Status

sudo nmcli dev
:'
DEVICE  TYPE      STATE        CONNECTION 
wlan0   wifi      unavailable  --         
eth0    ethernet  unmanaged    --         
lo      loopback  unmanaged    --  
'

ifconfig
lsblk
:'
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0         7:0    0  48.9M  1 loop /snap/core18/2127
loop1         7:1    0  57.4M  1 loop /snap/core20/1171
loop2         7:2    0    62M  1 loop /snap/lxd/21032
loop3         7:3    0    49M  1 loop /snap/core18/2248
loop4         7:4    0  28.1M  1 loop /snap/snapd/12707
loop5         7:5    0  60.7M  1 loop /snap/lxd/21843
loop6         7:6    0  28.2M  1 loop /snap/snapd/13643
mmcblk0     179:0    0 119.3G  0 disk 
├─mmcblk0p1 179:1    0   256M  0 part /boot/firmware
└─mmcblk0p2 179:2    0   119G  0 part /
'


df -h
:'
Filesystem      Size  Used Avail Use% Mounted on
udev            3.8G     0  3.8G   0% /dev
tmpfs           782M  4.0M  778M   1% /run
/dev/mmcblk0p2  118G  2.8G  110G   3% /
tmpfs           3.9G     0  3.9G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/loop0       49M   49M     0 100% /snap/core18/2127
/dev/loop1       58M   58M     0 100% /snap/core20/1171
/dev/loop3       49M   49M     0 100% /snap/core18/2248
/dev/loop2       62M   62M     0 100% /snap/lxd/21032
/dev/loop4       29M   29M     0 100% /snap/snapd/12707
/dev/loop5       61M   61M     0 100% /snap/lxd/21843
/dev/loop6       29M   29M     0 100% /snap/snapd/13643
/dev/mmcblk0p1  253M  120M  133M  48% /boot/firmware
tmpfs           782M     0  782M   0% /run/user/1000

'


sudo fdisk -l
:'
Disk /dev/loop0: 48.92 MiB, 51277824 bytes, 100152 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop1: 57.42 MiB, 60198912 bytes, 117576 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop2: 61.98 MiB, 64962560 bytes, 126880 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop3: 48.98 MiB, 51335168 bytes, 100264 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop4: 28.7 MiB, 29433856 bytes, 57488 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop5: 60.68 MiB, 63610880 bytes, 124240 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop6: 28.22 MiB, 29581312 bytes, 57776 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mmcblk0: 119.26 GiB, 128043712512 bytes, 250085376 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xf66f0719

Device         Boot  Start       End   Sectors  Size Id Type
/dev/mmcblk0p1 *      2048    526335    524288  256M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      526336 250085342 249559007  119G 83 Linux
'


sudo fdisk /dev/mmcblk0 -l
:'
Disk /dev/mmcblk0: 119.26 GiB, 128043712512 bytes, 250085376 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xf66f0719

Device         Boot  Start       End   Sectors  Size Id Type
/dev/mmcblk0p1 *      2048    526335    524288  256M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      526336 250085342 249559007  119G 83 Linux
'

References