Currently in our code we check for disk space usage to stop doing something if the filesystem is above 95% in disk space usage. The way I'm checking for that is :
diskusage=$(df -P | grep "/dev/mtdblock\\|/video" | awk '{ print $5 }' | sed 's@%@@g')
The problem is we are trying to upgrade to a new hardware and the new df returns a different "main storage" path, stored on /dev/mmcblk0p2 instead of /dev/mtdblock
df
Filesystem 1K-blocks Used Available Use% Mounted on
udev 10240 4 10236 1% /dev
tmpfs 204848 236 204612 1% /run
/dev/mmcblk0p2 7268964 1289904 5609808 19% /
My question is, is there a way to rename the /dev/mmcblk0p2 to /dev/mtdblock? I'd like to have a consistent codebase without having 2 different code bases on each system so during updates it's less mind-boggling to manage.
I've attempted using e2label but that doesn't seem to actually change where the partition name under df. Any help would be greatly appreciated and please be as verbose as possible (backend code writer dabbing into sys-admin!)