[arm-allstar] Utilizing full SD card --was: Persistent logging

David McGough kb4fxc at inttek.net
Fri Mar 17 20:14:09 EDT 2023


Hi Mark,

There are several ways to fully utilize the entire SD card, when you've 
got a card that is larger than 4GB---which pretty includes all available 
cards these days.

The 2 primary main methods I use to access all the SD card space are:

1) Expand the root filesystem, so that it spans the whole card.  This
isn't hard to do, but can't be performed on the SD card while linux is
running from the same SD card (at least with how HamVoIP is setup
currently) ....So, you've got to use another system and SD card adapter
(like a USB SD card reader / writer).  Once the expansion operation is
complete, then you can again boot from the newly updated card.  Since
these update steps vary and can be dangerous (meaning loosing the SD card
contents), depending on what type of host system you're using, I won't
describe them now and will move on to the second method.

2) Simply create a new partition on the SD card, utilizing the unused
space, format and mount it and it's ready to go.  These steps are easily
completed on a running installation, no need for a card reader/writer,
etc.

Here are the steps to create a new "/usr1" filesystem on a booted HamVoIP 
RPi node:

### First, create the new partition.  This will be setup as primary 
### partition 3 on the SD card:


echo -e 'n\np\n\n\n\nw\n' | fdisk /dev/mmcblk0

partprobe


### Verify that the new partition is present, it should be listed as 
### /dev/mmcblk0p3:


echo -e 'p\nq\n' | fdisk /dev/mmcblk0


### Assuming the mmcblk0p3 exists in the above output, format the new 
### partition:


mkfs.ext4 -m 1 /dev/mmcblk0p3


### Create the mount point directory (/usr1 in this example):


mkdir /usr1


### Add the new filesystem info to the /etc/fstab file:


echo -e '\n/dev/mmcblk0p3  /usr1 ext4 defaults 0 0\n' >> /etc/fstab


### Now, mount the new filesystem.  Note that it will automatically mount 
### on rebooting:

mount -a

### Look at all the filesystem space used.  The new /usr1 should now show 
### up as almost empty:

df -h


.....That's it!  


73, David K4FXC



On Thu, 16 Mar 2023, Mark VE3JMR via ARM-allstar wrote:

> 
> Hi David;
> 
> In fact my node software is executing from a 32G card. How do I utilize 
> the unused space? I would like to use as much of the card as possible.
> 
> Also, your earlier explanation that Hamvoip was engineered to minimize 
> reads/writes from/to the card: If Hamvoip is only using approx 4Gigs 
> space, is the unused space used to move files around the entire card to 
> give equal usage or is it entirely dead and unused?
> 
> Thanks so much.
> 
> 73 75 de VE3JMR | VE3MR
> Mark
> Port Colborne, Ontario, CANADA
> https://www.qrz.com/db/VE3JMR
> Allstar# 531320 [1] | Echolink# 736666 | VE3JMR-L [2]
> 
> Date: Thu, 16 Mar 2023 05:37:01 -0400 (EDT)
> 
> Hi Mark,
> 
> The reported Supermon filesystem usage is normal.  The reason why that
> number jumped from 2%-4% to 56% is that in the original configuration, 
> the
> /var/log filesystem was an empty RAMdrive (tmpfs), so almost no usage.
> Now, after making the change in /etc/fstab and rebooting, the /var/log
> *FOLDER* is part of the SD card root filesystem, which is 56% full.
> 
> Note that HamVoIP, by default, only uses 4GB of the available SD card
> space.  If you've got a 32GB card, about 26GB (or so) is still free and
> not part of any used filesystem--it's spare, unused space.  You can
> utilize this extra space, of course, if needed.
> 
> 73, David K4FXC
> 



More information about the ARM-allstar mailing list