0

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?

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

3 Answers3

4

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"
thanhvg
  • 41
0

This is a clean way of writing files with sudo.

echo "/ union" | sudo tee persistence.conf
Erik
  • 1
0

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]?

RSW
  • 101