[Lubuntu] Not able to access disks from Lubuntu CD

Avi Greenbury lists at avi.co
Tue Nov 1 14:15:47 UTC 2011


Ari Torhamo wrote:
> 2011/10/30 Avi Greenbury <lists at avi.co>
> 
> > Ari Torhamo wrote:
> >
> > > Hello,
> > >
> > > An upgrade to Ubuntu 11.04 (and fresh installation too) from 10.10
> > > failed, and I decided to try Lubuntu instead. When I try to access
> > > the disks from the Lubuntu live-CD (to do some back-ups), I get an
> > > error message "Not authorized" (this seems to be an eternal
> > > problem in Linux). I tried "sudo chown...", but without success.
> > > I'd like to know which command to use to be able to access the
> > > disks (hard drives and USB stick). Thanks very much.
> > >
> >
> > I guess you're trying to get at the disks from the old Ubuntu
> > install that broke?
> >
> > Yes.
> 
> 
> > The 'not authorised' bit would be because the livecd user you're
> > logged in as on the live cd isn't the same user as you were on the
> > installed system.
> >
> > That's what I guessed. I think it is terrible usability.

I'm not sure what you expect it to do instead here. Let everyone edit
any file?


> I have faced the same situation several times, and it's always
> annoying, as there doesn't seem to be any simple, repeatable way to
> get out of it.

There is: deduce what user you currently are, and grant this user
rights to do what you want to do to the files. Chowning files, or
chmodding them, will generally get you something workable, but perhaps
with unintended consequences. Making yourself root and using tools
which preserve permissions and timestamps are more likely to do what
you want.


> > What was the chown command that you ran, and did it itself produce
> > any errors?
>
> No errors. The command was "sudo chown -R
> user:user /path/to/the/folder

Well, that should have worked, assuming the first 'user' is substitued
for the correct user, the second for the correct group and
'/path/to/the/folder' is the path to the right directory. There's not a
lot I can really help with when we're this far removed from what was
actually run.

> > Generally, when you're taking backups, the solution to the
> > access problem is to run the backup as root, rather than chown the
> > files
> 
> Thanks for the suggestion, I'll try to remember it the next time
> (although it doesn't sound something one should have to do on a user
> friendly distro). 

I still don't understand. What *should* happen here? You've got into
this situation through the OS breaking, at that point expectation of
not needing to understand what's going on needs to (and tends to
naturally) end, really, and normally this is where the 'person who knows
computers' is invoked.

> Does this mean, that the backups that one has made with a regular
> backup program are not usable when a reinstall is being done? 

No. Regular backup programs will preserve permissions, because that's
what backups do.
But if you change the ownership (as with chown) or the permissions
(with chmod) of files in order to take a backup, then your backup will
obviously contain those changed permissions.

? In a wider context, why not make the permissions settable (is that a
> word?) from the file manager, as they already are in a crippled way
> (I know, it's a featrue request (bug report) that doesn't help me
> now).

They are. You can set them through the file properties dialogue when
you right-click on a file or directory.

> > - presumably you'd prefer to take the backup of the files
> > preserving their permissions.
> 
> I don't quite follow. Doesn't this conflict with your suggestion to
> take the backups as root? (Perhaps I don't understand, what
> "preserving their permissions" mean or how do I do that).

No? By 'preserving their permissions' I mean preserving the permissions
set on the files. If a file is set such that user1 has full rights,
group2 can read it but not write to it and everybody else can't even
read it, then you'd expect that, following a restore-from-backup, these
permissions remain.

Generally, you'd rather not need to modify these permissions in order
to take the backup. You, then, take advantage of the fact that root is
always able to do anything to a file, irrespective of the permissions
bits, and so run your backups and restores as root (via sudo).

-- 
Avi




More information about the ubuntu-users mailing list