These are all shell commands. What does it have to do with your bootloader?
Nonetheless, why delete /home/partimag and then re-create it. Keep the /home/partimag directory and delete everything else under it.
rm -r /home/partimag
mkdir -p /home/partimag
# Use one command instead:
rm -r /home/partimag/* # This deletes everything under /home/partimag, but keeps /home/partimag
Or, combine the two mkdir commands into one command:
mkdir -p /home/partimag /tmp/local_dev