Unable to own previously saved /home files on new external USB drive
I have just had to reinstall my OS (Sabayon) onto a new and larger hard drive (dying old disk). I quickly saved all my old docs in /home on an external USB drive (formatted and then created an ext4 file system) before the swap and installation.
After getting the new disk running I connected the USB external disk. First I could not access the drive at all, but that seems to be fixed. Now I want to bring all my files back to my new /home folder but apparently they (especially the former MS Office .doc, .xls, etc files, not so much the OpenOffice files) are “read only” and I don't have permissions anymore. I am able to create directories on the external, and can move files back and forth, but don't seem to own many of them. Sabayon automatically mounted my external disk in /media/disk, rather than /mnt, so I've left that alone for now. After searching here and elsewhere for info, I tried a few things (below): For access I added a line to /etc/fstab: Code:
/dev/sdb1 /media/disk ext4 noauto,rw 0 0 in /media I: Code:
# chmod 775 disk Code:
media # ls -l Code:
# chown -R tonyawards disk no luck, so then I Code:
# chown g+rwxs disk It now reads: Code:
media # ls -l I'm not sure what the “total 4” refers to since there is only the one directory “disk” inside /media but I assume that's not part of this issue... Does adding umask=0 have anything to do with this, and if so where does that go? Hopefully this is all clear to someone – Linux is still pretty new to me. What am I missing/doing wrong? Please tell me that it's possible to change these files so I can “own” them again. Thank you all. Any other output you might need, please let me know. |
Hi Tonyawards:)
I'm not familiar with Sabyon but some ideas to try. In /etc/fstab you're showing a mount point of /media/disk but elsewhere you just show disk. Try changing the chown to point at /media/disk (make sure it exists before issuing the command). Thr -R option does recurse from the specified directory to the subdirectories. Try copying the files to their final destination and then performing the chown. Tom |
Hi
The "total 4" line gives the size in blocks of the files and directories listed. If you want a more friendly line add h to parameters for ls Code:
ls -lh |
Try -->
chown -R tonyawards /dev/sdb1 If your mount point is incorrect this will change it directly. You can also run mount and see where the drive is at. The re run the command.Example below-> Quote:
:twocents: |
jv2112, I ran mount and got what seems to me to be an odd result on the last line. It's sure not what you have in your various /media locations.
Code:
# mount tommyttt - my mount point is in /media/disk; I just grabbed part of my terminal output while I was in my /media directory. I re-did it to make sure (~# chown -R tonyawards /media/disk), but the file permssions are remaining read-only. When I bring a file over to my Desktop the permissions stay the same and it remains a read-only file. And martinbc, thanks for that clarification on the totals number. I just ran a ls -l in /dev to have a look, and without posting it all, some entries also seem strange: Code:
drwxr-xr-x 5 root root 100 Nov 3 18:47 disk Thanks everyone, for all the detailed suggestions so far, and for any others you may have... I'm still at a bit of a loss here. |
Code:
/dev/sdb1 on /media/disk type ext4 (rw,noexec,nosuid,nodev,user=spike) |
I am a little stumped. Did you SU/Sudo (I am not familiar w/ your distro) when you chmod ?
|
jv2112, yes I was in 'su' when I tried these changes, but still it was not working.
I had to rename each master directory in my /home file system on the external drive one by one, just slightly, in order to be able to chmod -R the permissions to 775 on all. I also had to remove any spaces from the directory names, which I have never have had to do before (dog food to dog_food etc). When they were finally done they would then copy over to my new installed hard drive and went into /home with no trouble. Now on the new installed drive, all directories are at 755 and files inside have remained at 775. This seems fine for now (I'm the only one with access to this box) until I am sure all is ok, then I'll reduce permissions just for safety's sake. JZL240I-U, thanks for the catch – I did change that entry from spike to tonyawards (older user) first, but it still did not allow me to do what I mentioned above. I wish I had a more elegant fix to report here, but this did at least work. So I'll mark this as solved, and thank you all for your time and input. |
All times are GMT -5. The time now is 06:08 PM. |