Fedora/Raspberry Pi: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 56: | Line 56: | ||
init 6 | init 6 | ||
</source> | </source> | ||
==System Update== | |||
<source lang="bash" highlight="2-7"> | |||
sudo su | |||
cat << EOF >> /etc/dnf/dnf.conf | |||
fastestmirror=True | |||
max_parallel_downloads=10 | |||
defaultyes=True | |||
EOF | |||
dnf update | |||
</source> | |||
==DNF Repository== | |||
{| | |||
| valign="top" | | |||
'''Free/Community:''' | |||
<source lang="bash"> | |||
sudo dnf install\ | |||
https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release\ | |||
-$(rpm -E %fedora).noarch.rpm | |||
</source> | |||
| valign="top" | | |||
'''Non-Free/Commercial:''' | |||
<source lang="bash"> | |||
sudo dnf install\ | |||
https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree\ | |||
-release-$(rpm -E %fedora).noarch.rpm | |||
</source> | |||
|} | |||
==Expand Volume== | |||
{| | |||
| valign="top" | | |||
<source lang="bash" highlight="12,26,27,31,35-39,44,46-48,52,65"> | |||
sudo fdisk /dev/mmcblk0 | |||
:<<EOF | |||
Welcome to fdisk (util-linux 2.37.2). | |||
Changes will remain in memory only, until you decide to write them. | |||
Be careful before using the write command. | |||
This disk is currently in use - repartitioning is probably a bad idea. | |||
It's recommended to umount all file systems, and swapoff all swap | |||
partitions on this disk. | |||
Command (m for help): p | |||
Disk /dev/mmcblk0: 29.81 GiB, 32010928128 bytes, 62521344 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: 0x8f4e3975 | |||
Device Boot Start End Sectors Size Id Type | |||
/dev/mmcblk0p1 * 2048 1230847 1228800 600M 6 FAT16 | |||
/dev/mmcblk0p2 1230848 3327999 2097152 1G 83 Linux | |||
/dev/mmcblk0p3 3328000 14680063 11352064 5.4G 8e Linux LVM | |||
Command (m for help): d | |||
Partition number (1-3, default 3): 3 | |||
Partition 3 has been deleted. | |||
Command (m for help): n | |||
Partition type | |||
p primary (2 primary, 0 extended, 2 free) | |||
e extended (container for logical partitions) | |||
Select (default p): p | |||
Partition number (3,4, default 3): 3 | |||
First sector (3328000-62521343, default 3328000): | |||
Last sector, +/-sectors or +/-size{K,M,G,T,P} (3328000-62521343, | |||
default 62521343): | |||
Created a new partition 3 of type 'Linux' and of size 28.2 GiB. | |||
Partition #3 contains a LVM2_member signature. | |||
Do you want to remove the signature? [Y]es/[N]o: N | |||
Command (m for help): t | |||
Partition number (1-3, default 3): 3 | |||
Hex code or alias (type L to list all): 8e | |||
Changed type of partition 'Linux' to 'Linux LVM'. | |||
Command (m for help): p | |||
Disk /dev/mmcblk0: 29.81 GiB, 32010928128 bytes, 62521344 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: 0x8f4e3975 | |||
Device Boot Start End Sectors Size Id Type | |||
/dev/mmcblk0p1 * 2048 1230847 1228800 600M 6 FAT16 | |||
/dev/mmcblk0p2 1230848 3327999 2097152 1G 83 Linux | |||
/dev/mmcblk0p3 3328000 62521343 59193344 28.2G 8e Linux LVM | |||
Command (m for help): w | |||
The partition table has been altered. | |||
Syncing disks. | |||
EOF | |||
</source> | |||
| valign="top" | | |||
<source lang="bash" highlight="7,8,34,35,50-53"> | |||
lsblk | |||
:' | |||
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS | |||
mmcblk0 179:0 0 29.8G 0 disk | |||
├─mmcblk0p1 179:1 0 600M 0 part /boot/efi | |||
├─mmcblk0p2 179:2 0 1G 0 part /boot | |||
└─mmcblk0p3 179:3 0 28.2G 0 part | |||
└─fedora_fedora-root 253:0 0 5.4G 0 lvm / | |||
zram0 252:0 0 7.6G 0 disk [SWAP] | |||
' | |||
sudo umount /dev/mmcblk0p3 | |||
sudo pvresize /dev/mmcblk0p3 | |||
sudo pvs | |||
sudo lvresize -l +100%FREE /dev/fedora_fedora/root | |||
sudo xfs_growfs /dev/fedora_fedora/root | |||
sudo lvs | |||
lsblk | |||
:' | |||
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS | |||
mmcblk0 179:0 0 29.8G 0 disk | |||
├─mmcblk0p1 179:1 0 600M 0 part /boot/efi | |||
├─mmcblk0p2 179:2 0 1G 0 part /boot | |||
└─mmcblk0p3 179:3 0 28.2G 0 part | |||
└─fedora_fedora-root 253:0 0 28.2G 0 lvm / | |||
zram0 252:0 0 7.6G 0 disk [SWAP] | |||
' | |||
sudo fdisk -l | |||
:' | |||
Disk /dev/mmcblk0: 29.81 GiB, 32010928128 bytes, 62521344 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: 0x8f4e3975 | |||
Device Boot Start End Sectors Size Id Type | |||
/dev/mmcblk0p1 * 2048 1230847 1228800 600M 6 FAT16 | |||
/dev/mmcblk0p2 1230848 3327999 2097152 1G 83 Linux | |||
/dev/mmcblk0p3 3328000 62521343 59193344 28.2G 8e Linux LVM | |||
Disk /dev/mapper/fedora_fedora-root: 28.22 GiB, 30303846400 bytes, | |||
59187200 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/zram0: 7.64 GiB, 8205107200 bytes, 2003200 sectors | |||
Units: sectors of 1 * 4096 = 4096 bytes | |||
Sector size (logical/physical): 4096 bytes / 4096 bytes | |||
I/O size (minimum/optimal): 4096 bytes / 4096 bytes | |||
' | |||
</source> | |||
|} | |||
==Server Config== | |||
{| | |||
| valign="top" | | |||
sudo dnf install postgresql-server | |||
sudo dnf install mariadb-server | |||
sudo dnf install httpd | |||
| valign="top" | | |||
sudo systemctl enable httpd.service | |||
sudo systemctl start httpd.service | |||
ls -lah /usr/lib/systemd/system/ | |||
| valign="top" | | |||
sudo firewall-cmd --permanent --add-service=http | |||
sudo setsebool -P httpd_can_network_connect on | |||
sudo firewall-cmd --add-service=http | |||
|} | |||
==Device Status== | ==Device Status== | ||
Line 238: | Line 436: | ||
' | ' | ||
</source> | </source> | ||
|} | |} | ||
Revision as of 04:01, 9 November 2021
================================================================================ ================================================================================ 1) [x] Language Settings 2) [x] Time Settings (English (United States)) (US/Eastern timezone) 3) [ ] Network configuration 4) [x] Root password (Not Connected) (Disabled. Set password to enable root account.) 5) [ ] User creation (No user will be created) Please make a selection from the above ['c' to continue, 'q' to quite, 'r' to refresh]: we needs to set root password & user creation before move forward. We can skip other settings for future or can be done on the fly. | |
| |
sudo timedatectl set-timezone 'Asia/Kuala_Lumpur' sudo hostnamectl set-hostname fedora sudo timedatectl set-ntp true |
sudo nmcli dev wifi rescan sudo nmcli dev wifi sudo nmcli dev |
| |
sudo nmcli dev wifi con 'ChorkeOrg_2.4GHz' password 'sadaqah!' sudo nmcli dev wifi con 'ChorkeOrg' password 'sadaqah!' https://10.19.83.111:9090/ |
Disable Overscan
sudo su
cat << EOF >> /boot/efi/config.txt
disable_overscan=1
EOF
cat /boot/efi/config.txt
init 6
System Update
sudo su
cat << EOF >> /etc/dnf/dnf.conf
fastestmirror=True
max_parallel_downloads=10
defaultyes=True
EOF
dnf update
DNF Repository
Free/Community: sudo dnf install\
https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release\
-$(rpm -E %fedora).noarch.rpm
|
Non-Free/Commercial: sudo dnf install\
https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree\
-release-$(rpm -E %fedora).noarch.rpm
|
Expand Volume
sudo fdisk /dev/mmcblk0
:<<EOF
Welcome to fdisk (util-linux 2.37.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
This disk is currently in use - repartitioning is probably a bad idea.
It's recommended to umount all file systems, and swapoff all swap
partitions on this disk.
Command (m for help): p
Disk /dev/mmcblk0: 29.81 GiB, 32010928128 bytes, 62521344 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: 0x8f4e3975
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 2048 1230847 1228800 600M 6 FAT16
/dev/mmcblk0p2 1230848 3327999 2097152 1G 83 Linux
/dev/mmcblk0p3 3328000 14680063 11352064 5.4G 8e Linux LVM
Command (m for help): d
Partition number (1-3, default 3): 3
Partition 3 has been deleted.
Command (m for help): n
Partition type
p primary (2 primary, 0 extended, 2 free)
e extended (container for logical partitions)
Select (default p): p
Partition number (3,4, default 3): 3
First sector (3328000-62521343, default 3328000):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (3328000-62521343,
default 62521343):
Created a new partition 3 of type 'Linux' and of size 28.2 GiB.
Partition #3 contains a LVM2_member signature.
Do you want to remove the signature? [Y]es/[N]o: N
Command (m for help): t
Partition number (1-3, default 3): 3
Hex code or alias (type L to list all): 8e
Changed type of partition 'Linux' to 'Linux LVM'.
Command (m for help): p
Disk /dev/mmcblk0: 29.81 GiB, 32010928128 bytes, 62521344 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: 0x8f4e3975
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 2048 1230847 1228800 600M 6 FAT16
/dev/mmcblk0p2 1230848 3327999 2097152 1G 83 Linux
/dev/mmcblk0p3 3328000 62521343 59193344 28.2G 8e Linux LVM
Command (m for help): w
The partition table has been altered.
Syncing disks.
EOF
|
lsblk
:'
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
mmcblk0 179:0 0 29.8G 0 disk
├─mmcblk0p1 179:1 0 600M 0 part /boot/efi
├─mmcblk0p2 179:2 0 1G 0 part /boot
└─mmcblk0p3 179:3 0 28.2G 0 part
└─fedora_fedora-root 253:0 0 5.4G 0 lvm /
zram0 252:0 0 7.6G 0 disk [SWAP]
'
sudo umount /dev/mmcblk0p3
sudo pvresize /dev/mmcblk0p3
sudo pvs
sudo lvresize -l +100%FREE /dev/fedora_fedora/root
sudo xfs_growfs /dev/fedora_fedora/root
sudo lvs
lsblk
:'
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
mmcblk0 179:0 0 29.8G 0 disk
├─mmcblk0p1 179:1 0 600M 0 part /boot/efi
├─mmcblk0p2 179:2 0 1G 0 part /boot
└─mmcblk0p3 179:3 0 28.2G 0 part
└─fedora_fedora-root 253:0 0 28.2G 0 lvm /
zram0 252:0 0 7.6G 0 disk [SWAP]
'
sudo fdisk -l
:'
Disk /dev/mmcblk0: 29.81 GiB, 32010928128 bytes, 62521344 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: 0x8f4e3975
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 2048 1230847 1228800 600M 6 FAT16
/dev/mmcblk0p2 1230848 3327999 2097152 1G 83 Linux
/dev/mmcblk0p3 3328000 62521343 59193344 28.2G 8e Linux LVM
Disk /dev/mapper/fedora_fedora-root: 28.22 GiB, 30303846400 bytes,
59187200 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/zram0: 7.64 GiB, 8205107200 bytes, 2003200 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
'
|
Server Config
sudo dnf install postgresql-server sudo dnf install mariadb-server sudo dnf install httpd |
sudo systemctl enable httpd.service sudo systemctl start httpd.service ls -lah /usr/lib/systemd/system/ |
sudo firewall-cmd --permanent --add-service=http sudo setsebool -P httpd_can_network_connect on sudo firewall-cmd --add-service=http |
Device Status
sudo nmcli dev
:'
DEVICE TYPE STATE CONNECTION
wlan0 wifi connected ChorkeOrg_2.4GHz
p2p-dev-wlan0 wifi-p2p disconnected --
eth0 ethernet unavailable --
lo loopback unmanaged --
'
ifconfig
|
lsblk
:'
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
mmcblk0 179:0 0 29.8G 0 disk
├─mmcblk0p1 179:1 0 600M 0 part /boot/efi
├─mmcblk0p2 179:2 0 1G 0 part /boot
└─mmcblk0p3 179:3 0 5.4G 0 part
└─fedora_fedora-root 253:0 0 5.4G 0 lvm /
zram0 252:0 0 7.6G 0 disk [SWAP]
'
|
| |
sudo pvdisplay
:'
--- Physical volume ---
PV Name /dev/mmcblk0p3
VG Name fedora_fedora
PV Size 5.41 GiB / not usable 3.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 1385
Free PE 0
Allocated PE 1385
PV UUID QSZIHQ-zti6-8zM2-gCrb-XXWT-LFVT-csiI54
'
|
df -h
:'
Filesystem Size Used Avail Use% Mounted on
devtmpfs 3.8G 0 3.8G 0% /dev
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 1.6G 9.2M 1.6G 1% /run
/dev/mapper/fedora_fedora-root 5.5G 2.4G 3.1G 44% /
tmpfs 3.9G 32K 3.9G 1% /tmp
/dev/mmcblk0p2 1014M 154M 861M 16% /boot
/dev/mmcblk0p1 599M 31M 569M 6% /boot/efi
tmpfs 783M 0 783M 0% /run/user/1000
'
|
| |
sudo vgdisplay
:'
--- Volume group ---
VG Name fedora_fedora
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 2
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 1
Act PV 1
VG Size 5.41 GiB
PE Size 4.00 MiB
Total PE 1385
Alloc PE / Size 1385 / 5.41 GiB
Free PE / Size 0 / 0
VG UUID fr0O3c-g90f-jeh0-9fjv-q63b-VCGi-wH8yIn
'
|
sudo fdisk -l
:'
Disk /dev/mmcblk0: 29.81 GiB, 32010928128 bytes, 62521344 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: 0x8f4e3975
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 2048 1230847 1228800 600M 6 FAT16
/dev/mmcblk0p2 1230848 3327999 2097152 1G 83 Linux
/dev/mmcblk0p3 3328000 14680063 11352064 5.4G 8e Linux LVM
Disk /dev/mapper/fedora_fedora-root: 5.41 GiB, 5809111040 bytes, 11345920 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/zram0: 7.64 GiB, 8205107200 bytes, 2003200 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
'
|
| |
sudo lvdisplay
:'
--- Logical volume ---
LV Path /dev/fedora_fedora/root
LV Name root
VG Name fedora_fedora
LV UUID NbFPQx-F1x7-XW8d-2Ghe-K8Bv-Q3e7-S6SIo7
LV Write Access read/write
LV Creation host, time fedora, 2021-10-26 13:39:46 +0800
LV Status available
# open 1
LV Size 5.41 GiB
Current LE 1385
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
'
|
sudo fdisk /dev/mmcblk0 -l
:'
Disk /dev/mmcblk0: 29.81 GiB, 32010928128 bytes, 62521344 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: 0x8f4e3975
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 2048 1230847 1228800 600M 6 FAT16
/dev/mmcblk0p2 1230848 3327999 2097152 1G 83 Linux
/dev/mmcblk0p3 3328000 14680063 11352064 5.4G 8e Linux LVM
'
|
References
| ||