All manuals recommend to use fdisk to delete and repartition /dev/sda2
but as far as I know there are data in there - configuration files, packages, etc. So, may be I must use other, non-destructive tools?
I have a 160Gb HDD and just want 10Gb for OpenWRT and packages and 150Gb for file storage.
Also I still struggle to understand where all packages are installed - in root? Or in sda2?
If in root then what is the point of /sda2?
Many thanks! Another stupid question, if I may, sorry:
Do I understand correctly that if I have two partitions,like
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 512 33279 32768 16M 83 Linux
/dev/sda2 33792 246783 212992 104M 83 Linux
It mean that /dev/sda1 contains only bootloader and kernel and mounted as / (root)
while /dev/sda2 contains packages, settings and all user stuff and mounted as /overlay, yet in system I see it mounted to /etc, /tmp and other catalogs?
P.S. And if I want more space for packages I must increase size of /dev/sda2 instead of /dev/sda1?
Sure!
I have OpenWRT deployed on x86 platform, which is ASUS P5QPL-AM (with Integrated Atheros AR813x/AR815x/AR816x (L1E)) for which I had to download kmod-atl1e driver and discrete PCI-Ex1 D-Link Network Card which works just fine out-of the box and requires no further attention.
I have also some outdated like 20 y.o. Intel CPU which model I do not remember exactly and 4Gb DDR2.
I also have 250Gb Samsung SATA HDD to which I've deployed OpenWRT standard image openwrt-23.05.5-x86-64-generic-ext4-combined.img simply by writing it on disk by imageUSB programm (which can recognize disks connected to PC via SATA-to-USB adapter as big USB drives).
Now I am afraid that current partitons will be too small and I just want to setup it like: 01. 10Gb partition for OpenWRT (so that there were always free space for more packages) 02. 240Gb for all other stuff, like files, movies, etc. (I was going to share it via nfs or samba).
The problem is that now I do not undertstand which partirion of OpenWRT to resize - /dev/sda1 with help of this manual [OpenWrt Wiki] Expanding root partition and filesystem or /dev/sda2 where all configs and packages are supposed to be stored, if I am not mistaken.
UPD: Since /dev/sda1 is bootable partition and contains bootable staff, I believe that my choice is to expand /dev/sda2, so that it would looks like:
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 512 33279 32768 16M 83 Linux
/dev/sda2 33792 10Gb idk 10Gb 83 Linux
This is what I was going to do. To create sda3 then mount it to /mnt/storage for example and use for movies, files ,etc. But first I want to provide more than enough free space for /dev/sda1 and /dev/sda2 so that my OpenWRT installation would never face lack of free space. I just not sure how to do it properly. Must I increase size of /dev/sda1 (for it seems all packages installed in there) or I must increase /dev/sda2 (for it seems some storage for settings and some packages also).
I do not plan to install something enormous mostly mc, nfs, v2raya, samba, motion, lighttpd, python3 (and other staff to set up Telegram - bot) and I just want to be sure that I will not run out of space. Because on default setup I once saw in LuCi that 90% of space is occupy. I had to resize root partition by script to avoid lack of free space.
May be I can create partitions in advance, say, on Ubuntu-LiveUSB or Parted-LiveUSB and then deploy grub and other OpenWRT files accordingly to necessary partitions?
P.S. I do not plan any upgrades, because I will not change hardware. This OpenWRT device is planned to work as home-router
OK, I understand you. I should not change default partitioning, for it will cause trouble sooner or later.
I do not remember what I installed, but nothing special. it was Midnight Commander and Motion for sure. May be motion video files caused it, but I am not sure. May be some log-files
At least can I give more free space to "Storage" according to this picture
P.S. It would be godlike system if I could not only select packages, but also configure them. For example, I need ffmpeg with H.265 decoding support (so that I can use IP-Camera with H.265) in Motion with support of ffmpeg. I just check some checkboxes and I got it. I hope in future it will be so.
Thank you. As far as I understand OpenWRT upgrade wipes all storage device and repartition it anew?
In this case maybe I should use for movies, files, etc., separated disk, say, another hard drive for 250Gb?
I have 32GB emmc with my R5S. What I did is, I expanded my second partition from original ~100MB to about ~2GB to install extra packages etc. Then used from 5GB to 25GB as an ext4 file system and mounted at /opt. Note that I didn't create any partition for the /opt file system as a re-install would overwrite the partition table. You need to replace /dev/mmcblk1 with correct drive. I am sure there are ways to programmatically figure out the actual drive...
Thank you. I think I wrote wrong sentence. I mean not configuring, but recompiling with necessary settings. For example I want to recompile ffmpeg with support of H.265 Codec and also recompile Motion package with support of ffmpeg. I think your link about a bit different things.
I also found this [OpenWrt Wiki] Using the SDK does it mean that I can recompile motion and ffmpeg on my current working OpenWRT without recompiling whole system? It would be great!
You can cross compile on an x86_64. I know that's the platform you're using, but I want to clarify that OpenWrt isn't self hosting, so you cannot use the OpenWrt OS to do so.