Change owner of folder on read-only drive in Ubuntu

1

My IMac died (power supply issue, out of warranty) and I removed the HDD so I could recover some files. I'm trying to copy files from my Desktop folder on the Mac HDD using Ubuntu 10.04 (running from the CD-ROM), but I get access denied errors when I try to cd or ls into the directory because I'm not the owner.

I tried running chown -R Desktop but I get an error saying that the file system is read-only.

Is there some way I can make the drive read/write or access the files without changing the owner?

Thanks!

Kyle Trauberman

Posted 2010-08-13T04:01:56.787

Reputation: 184

Answers

2

The write support for some foreign filesystems in Linux is buggy so turned off by default. This may be why your Mac filesystem was mounted read-only.

If this is a one-off data recovery, just do it as root.


For some filesystems, you can specify that everything should be world-readable, or that every file should be owned by a particular user. First determine the volume and mount point of the Mac filesystem with the command df . in the Desktop directory; this displays something like

/dev/sdb4   123456  78901  23456  42%   /media/disk1

Make sure no process is using the Mac filesystem (this includes any shell that has its working directory on it), and run

umount /media/disk1
mount -o umask=022 /dev/sdb4 /media/disk1

umask=022 means that everyone can read everything. You could also use uid=ktrauberman (replace ktrauberman by your user name) so that every file is owned by you.

Gilles 'SO- stop being evil'

Posted 2010-08-13T04:01:56.787

Reputation: 58 319

How do I switch to the root user while running from the live CD? I tried running the commands using sudo, but I encountered the same errors. – Kyle Trauberman – 2010-08-13T15:48:34.493

@ktrauberman: Do you mean that sudo ls /media/disk1/path/to/Desktop fails? If so, could you add to your question the output of sudo ls -ld /media/disk1 /media/disk1/path /media/disk1/path/to /media/disk/path/to/Desktop (substitute the names as appropriate of course)? And please also copy-paste the error messages. – Gilles 'SO- stop being evil' – 2010-08-13T16:11:45.503

Hmm. Now that I think about it, I don't think I tried sudo with ls or cd. I will try this tonight and get back to you. – Kyle Trauberman – 2010-08-13T17:23:46.323

Yep, that was it. I was able to sudo ls into the locked directory and then sudo cp the files out of it. Thanks! – Kyle Trauberman – 2010-08-14T01:45:11.240

0

Try unmounting the filesystem and then remounting it from the command line with the -w option

something like

mount -w /dev/sbd4 /mnt/macdrive

bryan

Posted 2010-08-13T04:01:56.787

Reputation: 7 848