LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-02-2006, 11:01 PM   #16
smiley_lauf
Member
 
Registered: Jan 2006
Location: NY
Distribution: Fedora 15 x64
Posts: 344

Original Poster
Rep: Reputation: 30

Here is the next error:


Code:
$ sudo chown -Rc $(grep smiley /etc/passwd | cut -d: -f1) /media/hda6/home/smiley
Password:
chown: missing operand after `/media/hda6/home/smiley'
Try `chown --help' for more information.
 
Old 04-02-2006, 11:45 PM   #17
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 165Reputation: 165
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:
Code:
ZUSER=$(grep -E '^smiley' /etc/passwd | cut -d: -f1); sudo chown -Rc ${ZUSER:=root} /media/hda6/home/smiley
 
Old 04-03-2006, 12:44 AM   #18
smiley_lauf
Member
 
Registered: Jan 2006
Location: NY
Distribution: Fedora 15 x64
Posts: 344

Original Poster
Rep: Reputation: 30
Code:
.....<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?

Thanks,
Smiley
 
Old 04-03-2006, 06:07 AM   #19
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 165Reputation: 165
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.
 
Old 04-03-2006, 09:00 AM   #20
smiley_lauf
Member
 
Registered: Jan 2006
Location: NY
Distribution: Fedora 15 x64
Posts: 344

Original Poster
Rep: Reputation: 30
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.
 
Old 04-03-2006, 02:30 PM   #21
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 165Reputation: 165
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?
 
Old 04-03-2006, 04:11 PM   #22
smiley_lauf
Member
 
Registered: Jan 2006
Location: NY
Distribution: Fedora 15 x64
Posts: 344

Original Poster
Rep: Reputation: 30
Steve

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.

Thanks,
smiley
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can Windows read ext3 partitions? mcah5 Linux - Newbie 15 02-07-2007 05:22 PM
ReiserFS and LILO read-write kule Slackware 3 07-12-2004 06:58 AM
Read/Write access ext3 partition st00 *BSD 5 06-28-2004 08:46 PM
Cant write or read ext3 partitions?!?!?! wasabi Linux - General 9 06-17-2004 07:07 AM
Trouble bootine SuSE 8.2 with ReiserFS in Read/Write mode alan8373 Linux - General 2 03-07-2004 12:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration