I was able to create a ext3 partition with out any problems using Gparted and now I am trying to send over a persistence.conf but it fails each time, here is what commands I am running:

 sudo mkdir /mnt/usb
 sudo mount /dev/sdb3 /mnt/usb
 sudo echo "/ union" >> /mnt/usb/persistence.conf
 bash: /mnt/usb/persistence.conf: Permission denied

Does anyone know how to fix this?

  • There is a post with detailed answer, explaining how to create Live USB with persistent partition. – clearkimura Aug 18 '15 at 18:06

sudo echo "something" > etc never works, better try this sudo sh -c "echo ....", the working command should be like this:

sudo sh -c "echo "/ union" > persistence.conf"

You should use the Bash shell in Sudo mode with -c option to execute the custom shell.

sudo bash -c "echo '/ union' > /mnt/persist/persistence.conf"

Also note that you should properly nest the double quotes.

Another example is:

sudo bash -c "cat /mnt/persist/persistence.conf"

Reference: What's the difference between 'sudo [command]' and 'sudo sh [command]?


This is a clean way of writing files with sudo.

echo "/ union" | sudo tee persistence.conf

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.