-   Linux - Newbie (
-   -   Mount, READ and WRITE reiserfs and ext3 partitions (

smiley_lauf 04-02-2006 11:01 PM

Here is the next error:


$ sudo chown -Rc $(grep smiley /etc/passwd | cut -d: -f1) /media/hda6/home/smiley
chown: missing operand after `/media/hda6/home/smiley'
Try `chown --help' for more information.

gilead 04-02-2006 11:45 PM

That's because the grep is not returning anything from /etc/passwd. Sorry, I should have left a fallback choice. The following changes the ownership to root if smiley isn't found:

ZUSER=$(grep -E '^smiley' /etc/passwd | cut -d: -f1); sudo chown -Rc ${ZUSER:=root} /media/hda6/home/smiley

smiley_lauf 04-03-2006 12:44 AM


.....<whole lot of output with similar text>...
changed ownership of `/media/hda6/home/smiley' to root

Was this supposed to do this? I still can't get to write to the /home/smiley folder? or am I still very impatient? is there another step?


gilead 04-03-2006 06:07 AM

What it did was change the ownership to root because the smiley user does not exist in /etc/passwd - most likely the spelling is wrong. Once you have the same spelling for smiley as is used in /etc/passwd the command will change the ownership of the files under /media/hda6/home/smiley to smiley.

smiley_lauf 04-03-2006 09:00 AM

Ok, I have tried
$sudo chown -R smiley:users /media/hda6

and I am getting the same invalid user error.

ALSO, note, that I tried logging into the partition hda6 (ubuntu breezy) with username 'smiley', and I was told that the /.<filename> have chnaged permission to root and I can't save sessions; will aloow me to log in for 10secs; and then logged me out.

Am I royally screewed now? or can we revert to the previous permissions to allow smiley access to the drive? Alternatively, I may have to create a NEW user for that Breezy partition???

Please help.

gilead 04-03-2006 02:30 PM

Please read what I posted earlier, you will not be able to chown to smiley until that user exists and has an entry in /etc/passwd. If that user should already exist then the spelling is wrong or chown would not give the invalid user error. Once the correct spelling is used, the chown command will work.

Is this a multi-boot system and hda6 contains the home partition for another distro? If so, you're not screwed - just boot that distro, login as root and chown back to whichever user should own the files. Is that the distro where the smiley user exists? If so, user accounts are not automatically created for the other distros and this may explain why you're getting the invalid user error for smiley - have you created the user smiley in the distro where your running the chown command?

smiley_lauf 04-03-2006 04:11 PM


This is very helpful. Yes, I have created a suer by the name "smiley" and I am sure there is no spelling error. Smiley is a user on the hda6 Ubuntu Breezy, so yes, it is another distro. I will follow your instructions to reset the o/p back to smiley.


All times are GMT -5. The time now is 01:28 AM.