Community
OpenEnergyMonitor

OpenEnergyMonitor Community

Expand the filesystem or not?

Hi all, I’m in the process of migrating my old RPI1 with emoncms.org logging (RO SD card) to a spare RPI2 with local logging. the current system has been working great for 6 years now so I am worried aboud breaking it. I bought a 64GB MAX ENDURANCE sandisk SD CARD with the objective of increasing the life of the setup as long as I can…
now I have one doubt… should I expand the filesystem to use the whole 64GB or should I leave it like it is (will the rest of the card not wear out, maybe?)
In other words, for lifespan consideratons, is it better to expand or not?
A.

If you are using the emonSD image, it will set up 2 partitions, one specifically for data.

I can’t though remember if it expands to the full 64MB now - it was designed for 16MB cards.

[edit]

Don’t rush the first boot. Just let it do it’s stuff - make a cuppa. Better still, connect a monitor so you can see what is happening.

1 Like

Yes. Using a card which is much bigger than you need will extend its life considerably.

Ref:

2 Likes

Bill - I think maybe your answer doesn’t address the questions about “expanding the filesystem”. If andrearimo doesn’t expand the filesystem, won’t all the reads & writes will be concentrated on the usable 16 GB portion of the card? On the other hand, if the latest emonSD image automatically expands the file system to use the entire card, the issue may be moot. Last time I installed emonSD it was the “emonSD-24Jul20” image and I manually expanded the file system by running: sudo /opt/emoncms/modules/usefulscripts/sdpart/./sdpart_imagefile
(as borpin cautioned, you’ll need to be patient as the sdpart_imagefile script can take a while and it reboots once then shutdowns automatically)

1 Like

The way I read Bill’s answer, you’ve got the wrong end of the stick. Surely Bill is saying yes, it is better to expand and when the partition is expanded, then the wear levelling algorithms have more space over which to spread the wear out?

BTW, I’ve found that, if writing the SD card in a machine with GParted available, that gives you a very easy and safe way to expand the partition.

Indeed I am. :wink:

Aye, Spot on.

1 Like

I have just bought the same SD card as the poster here, I have flashed the image but its only using 16GB of the 64GB on the card.

Disk seems to have 4 parts (not 2 as mentioned above) Which partitions should be expanded to make best use of the card and to extend its life?

/
Used: 49.12% Total 4.06 GB Used 2 GB Free 1.87 GB Write Load 275.13 B/s (1 hours 30 mins)

/var/opt/emoncms
Used: 0.04% Total 9.84 GB Used 3.77 MB Free 9.34 GB Write Load
0 B/s (1 hours 30 mins)

/boot
Used: 21.16% Total 252.05 MB Used 53.32 MB Free 198.73 MB Write Load 0 B/s (1 hours 30 mins)

/var/log
Used: 6.66% Total 50 MB Used 3.33 MB Free 46.67 MB Write Load n/a

If you’re only going to run emonCMS (which is what Brian Orpin advises, and not install other applications as well), then you only need to extend the partition with the phpfina, phpfiwa and phptimeseries directories in it, which I think will be mmcblk0p3 (mounted as /var/opt/emoncms).

It’s those directories in which your data is stored.

[email protected]:~ $ lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
mmcblk0     179:0    0 29.7G  0 disk 
├─mmcblk0p1 179:1    0  256M  0 part /boot
├─mmcblk0p2 179:2    0    4G  0 part /
└─mmcblk0p3 179:3    0 25.5G  0 part /var/opt/emoncms

1 Like