LinuxQuestions.org
Visit Jeremy's Blog.
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 02-18-2010, 02:20 AM   #1
samira.m
LQ Newbie
 
Registered: Feb 2010
Location: Iran-Tehran
Posts: 1

Rep: Reputation: 0
Problem! When I try to mount a new hard drive to home?


Hello Dear Friends

I mounted a new hard drive to my cluster because I don't have any space
in my home directory.I partitioned the new hard disk in two partitioned
/dev/sdb1
/dev/sdb2

I use these command to mount the partitions that I created:

mount /dev/sdb1 /mnt/disk
cp -vax /home/* /mnt/disk
umount /dev/sdb1

and then I change /etv/fstab by this command
cat >> /etc/fstab << HERE
/dev/hdb1 /home ext3 defaults,errors=remount-rw 0 1
HERE

mount -a

After all, I check my user's permissions and I tried to ssh from
one user to one of my server and one of the cluster's nodes but when
I ssh to each of them via one user I go to bash mode. I could solve
this
problem by using usermod command by this way:

usermod -d /home/username username

after that I can ssh to my server via users but my users didn't have
permission to write on their own directories, in addition when I ssh
to the other nodes I still had the bash mode problem I got these
message:

Could not chdir to home directory /home/test10: No such file or
directory
-bash: /home/test10/.ncbirc: No such file or directory
mkdir: cannot create directory `/home/test10': No such file or
directory
-bash-3.2$
If you can please guide me to solve this problem.

With Kind Regards
Samira
 
Old 02-18-2010, 03:02 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,720

Rep: Reputation: 1704Reputation: 1704Reputation: 1704Reputation: 1704Reputation: 1704Reputation: 1704Reputation: 1704Reputation: 1704Reputation: 1704Reputation: 1704Reputation: 1704
I guess the 'cp -vax' destroyed all the file ownerships. You probably need to 'chown -R' for each users home dir.

I don't know what is causing the no such file or directory errors for /home/test10. Is it really there?

Also did you delete or move the old /home out of the way before mounting /dev/hdb1 there?

Evo2.

Last edited by evo2; 02-18-2010 at 03:03 AM. Reason: Typo
 
Old 02-18-2010, 03:55 AM   #3
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by evo2 View Post
I guess the 'cp -vax' destroyed all the file ownerships. You probably need to 'chown -R' for each users home dir.
The problem is not cp, check -a in the man page. The ownerships and permissions should be fine as long as the destination fs supports these attributes.

Code:
mount /dev/sdb1 /mnt/disk
cp -vax /home/* /mnt/disk
umount /dev/sdb1

and then I change /etv/fstab by this command
cat >> /etc/fstab << HERE
/dev/hdb1 /home ext3 defaults,errors=remount-rw 0 1
HERE
I guess "hdb1" there is a typo because previously you used "sdb1".


Quote:
Originally Posted by samira.m View Post
After all, I check my user's permissions and I tried to ssh from
one user to one of my server and one of the cluster's nodes but when
I ssh to each of them via one user I go to bash mode. I could solve
this
problem by using usermod command by this way:

usermod -d /home/username username

after that I can ssh to my server via users but my users didn't have
permission to write on their own directories, in addition when I ssh
to the other nodes I still had the bash mode problem I got these
message:

Could not chdir to home directory /home/test10: No such file or
directory
-bash: /home/test10/.ncbirc: No such file or directory
mkdir: cannot create directory `/home/test10': No such file or
directory
-bash-3.2$
If you can please guide me to solve this problem.

With Kind Regards
Samira
I am having some trouble understanding what do you mean by "bash mode". Ssh is a remote logger that supports ssl encryption, it is supposed to open a shell remotely (either bash or whatever you have configured for a particular user). So, if it opens a shell then it's working correctly. I am not sure what did you expect from ssh.

About the permissions problem, I am more concerned about the permissions of /home itself. So, please, attach the output of this command *after* making sure that home has been mounted with the new partition.

Code:
ls -ld /home
You probably want at least r-x for all the users on that directory. Something like

Code:
chmod 755 /home
 
  


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
Re: Hard Drive Mount Problem pikecoguy Linux - Newbie 5 10-01-2008 11:15 AM
Problem mounting a drive via mount point under home CelticBlues Linux - Newbie 8 06-18-2008 11:30 AM
/home is limited to mb when a 80 GB hard drive is partioned as /home tmick Fedora 3 11-14-2006 04:46 AM
Crashed hard drive and mount problem J0ma Linux - Newbie 2 09-11-2006 02:23 PM
mount new hard drive as /home filpee Debian 3 02-27-2005 01:24 AM

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

All times are GMT -5. The time now is 04:13 AM.

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
Open Source Consulting | Domain Registration