0

After a failed upgrade from 14.04 to 16.04, I had to make a live usb hoping to make a copy of my files before installing 16.10 from scratch. The problem is that answers I have found on this site or other ones have not worked for me. I cannot copy/paste my files to the external drive because I do not have permissions. I can open my folders and my files, just not copy them over. I followed the instructions on nautilus here but the problem remains Any help will be very appreciated

Update: turming off the computer and back on again seems to have resolved the problem partially. It stills tells me about some files that I don't have permission to copy but most of them get copied over

Pulse
  • 101

1 Answers1

0

If you have a Microsoft file system (FAT32 or NTFS) in the external drive, the linux permissions will be set when it is mounted. So you need to mount it with read/write permissions. The following should work for FAT32 (and probably the same or something very similar for NTFS).

Unmount the partition on the external drive if mounted. (If you 'eject' it, you have to unplug and re-plug.)

sudo umount /dev/sdx1

Mount a FAT32 partition in a pendrive with read/write permissions for everybody:

(assumption: the pendrive is seen as /dev/sdx, replace x with the actual drive letter, for example b: /dev/sdx1 ---> /dev/sdb1)

sudo mkdir -p /mnt/sd1  # only if you want a new mountpoint
sudo umount /dev/sdx1   # only if already mounted (but with bad permissions)

sudo mount -o rw,users,umask=000 /dev/sdx1 /mnt/sd1  # mount

echo 'Hello World' > /mnt/sd1/hello.txt  # test writing
cat /mnt/sd1/hello.txt                   # test reading

Edit: Try to copy the 'stubborn' files with sudo permissions

sudo cp stubborn-file /directory-on-target-drive/

for example

sudo cp stubborn-file /mnt/sd1/backup-dir/

or

sudo cp -r stubborn-directory-tree /mnt/sd1/backup-dir/
sudodus
  • 46,324
  • 5
  • 88
  • 152
  • Thank you sudodus, unfortunately I get stuck with using sudo unmount: it does not find command sudo or unmount and when I try to install them I get 'E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?' When I answer 'yes', it writes a 'y' on every line without ending. I tried this http://askubuntu.com/questions/15433/unable-to-lock-the-administration-directory-var-lib-dpkg-is-another-process but I still cannot install sudo or mount or unmount – Pulse Jan 15 '17 at 21:46
  • You should not 'be root' in Ubuntu. You should use sudo from your regular user ID. And check carefully: the name of the command is umount with only one n. Please reboot and try again. The 'lock' problem could be that you have one tool open, when you try to use another tool for the same task, for example synaptic or ubuntu-software is running, and you try to use apt-get. – sudodus Jan 16 '17 at 05:43