Koozali.org: home of the SME Server

Changing ownership of user files

Offline aussielids

  • 2
  • +0/-0
  • Linux and SME Newbie
Changing ownership of user files
« on: February 24, 2009, 04:17:13 PM »
Hi Guys, I was previously running ver 6.0.1, and decided to upgrade to 7.4 (finally). Previously I had two disks in RAID configuration, so I disconnected one of the drives, and then did a fresh install of 7.4 on the remaining drive. I then mounted the non upgraded drive with my files on it and copied them across. This is where I got stuck as I kept getting access denied when accessing the files from my windows PC. Using the "chown -Rv user:group *" command should have worked, but it didn't. But when I used midnight commander it was able to change the permissions successfully using the same user and group, but only on the directories and not the files. After a while I was able to work out that if I used "chown -Rv 644:group *" that the windows machine could read and write all the files and directories. I clearly have missed something, but don't know what. Could someone please help with what the command should have been? I was logged in as root.
Thanks
Dave
-- << I used to be indecisive, now I'm not sure! >> --

Offline David Harper

  • *
  • 653
  • +0/-0
  • Watch this space
    • Workgroup Technology Solutions
Re: Changing ownership of user files
« Reply #1 on: February 24, 2009, 04:28:22 PM »
Welcome to the forums :)

What does ls -l show for the affected files?

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Changing ownership of user files
« Reply #2 on: February 24, 2009, 06:49:55 PM »
Wouldn't a disconnect-upgrade-resync track have been easier? Or a restore from backup? I am not sure if the uids of users/groups are the same now compared to your SME 6 server. If you would have used one of the two suggestions SME Server would have handled this transparently for you AFAIK.

If you are to go that route keep in mind to remove all contribs before going that way.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline aussielids

  • 2
  • +0/-0
  • Linux and SME Newbie
Re: Changing ownership of user files
« Reply #3 on: February 24, 2009, 11:44:21 PM »
On the original 6.0.1 disk ls -l shows the user and group as olduser:oldgroup (they're the same??). When I copy the files they retain the same user:group (as expected). I then chown to the new username:newgroup, I can only read the directory, not the files. The username and groupname weren't the same.

I did the upgrade this way because I had quite a few contribs installed because I wanted to try them out, and to uninstall them would have taken more time (so I thought). Plus a fresh install was appealing.

Update: I just ran the command with "chown -Rv username:username *" and this works. I can read the directories and files in the windows pc. Now I'm confused, does SME allocate the same username to the group name for a reason? Would someone be kind enough to explain this a little? Or better still point me to where I can read how it works? Thanks.

-- << I used to be indecisive, now I'm not sure! >> --