2

I have an embedded device running BusyBox, there are a number of directories mounted with overlayfs with work and data directories mounted on separate UBI partitions using the following style of command.

The main root filesystem is a squashfs read only image that's been updated with a newer version. I need to delete the changes that have been made to certain files so that the changes to squashfs take place. How can I do that?

mount -t overlay etc_overlay -o lowerdir=/etc,upperdir=/mnt/config/.data,workdir=/mnt/config/.work /etc
3

The folders in /mnt/config/.data and /mnt/config/.work contain your changes. You can move them out of the way to create new ones. Unmount the overlay and remount it with a clean upper dir:

umount /etc
mv /mnt/config/.data /mnt/config/.data.old
mv /mnt/config/.work /mnt/config/.work.old
mkdir /mnt/config/.data
mkdir /mnt/config/.work
mount -t overlay etc_overlay -o lowerdir=/etc,upperdir=/mnt/config/.data,workdir=/mnt/config/.work /etc

All of your changes to the old overlay will be found in /mnt/config/.data.old if you need them. /mnt/config/.work.old should be empty aside from the work folder if unmounted properly.

  • Thanks, I thought it would be something like this but wasn't sure. Tried it and it does exactly what I want it to. – RobbG Sep 7 '16 at 7:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.