LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 06-04-2010, 09:47 AM   #1
willy_gn
LQ Newbie
 
Registered: Jun 2010
Posts: 9

Rep: Reputation: Disabled
change samba home directory


Hello,
In my haste to create a new Linux server for the purpose of backing up my users documents, emails, address books and favourites, I neglected to consider the size of the hard drive. I quickly realized that with 25 users, i would soon fill a 60GB drive. My first thought was to install a larger HDD, clone it, swap the 60GB drive out and all would be well. I purchased a 500GB IDE drive, installed it, cloned using the dd command but it would not boot completely. Searched many threads here and other sites, no luck. Next, re-installed the 60GB drive, deleted and re-partitioned the 500GB drive, mounted the second drive (btw, still a bit baffled with the mount process), copied the user folders and associated backed-up data onto the larger drive but I'm not sure how to change the home directory that seems to be configured in Samba. In the Samba.conf file I changed the line in the [users] section from: path = /home to path = /mnt/sync_data/home. I presume this is not enough or incorrect.
any thoughts are greatly appreciated. Thank you in advance.

willy_gn
 
Old 06-04-2010, 10:02 AM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
You should just need to change the directories in smb.conf and restart Samba.

What happens now, do you get an error? Is the drive setup to mount at boot in fstab?
 
Old 06-04-2010, 02:02 PM   #3
willy_gn
LQ Newbie
 
Registered: Jun 2010
Posts: 9

Original Poster
Rep: Reputation: Disabled
Hello MS3FGX, thanks for answering

not sure what fstab is but navigated to it and there is no entry for my second hdd, not sure how to add it, hopefully there is a way for the OS to recognize the drive. I mounted it but can't map to it from a Windows PC on the network. As stated above, I originally built the system with a 60GB drive, added the 500GB drive, tried to re-map this drive from a PC on the network but it still connects to the folder (directory) on the original 60GB drive. No error messages but when I write a test .txt file to the mapped drive, it shows up in the 60GB drive.
 
Old 06-04-2010, 02:41 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 15,266

Rep: Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624
Basically samba will automatically create home shares on the fly using a users home directory i.e. /home/username. Your /home is still on the / partition which is your 60GB drive.

If a different directory is desired you will need to add a path to the [homes] section like:
path = /some/path/%S
This will create shares based on user names

However, you might want to consider moving /home to the 500GB partition.

Here are a couple of examples on moving /home.
http://embraceubuntu.com/2006/01/29/...own-partition/
http://www.go2linux.org/how-to-move-...ther-partition
 
Old 06-04-2010, 03:12 PM   #5
willy_gn
LQ Newbie
 
Registered: Jun 2010
Posts: 9

Original Poster
Rep: Reputation: Disabled
thank you again for your reply,
as I get deeper into this I realize that guessing won't work for long. The articles mentioned above are a bit mysterious and it's difficult to guess the next step when the previous one results in an error, ie: mv /home /home.bak
results in the message "mv: cannot move '/home' to '/home.bak': Device or resource is busy
(getting a headache banging into so many brick walls)
hmm....
 
Old 06-04-2010, 04:46 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 15,266

Rep: Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624
How are the 500GB and 60GB drive partitioned now?

Lets do this: (you need to be root)
1. create a directory to use as a mount point for your 500GB drive
mkdir /mnt/newhome (you can replace /mnt/newhome with anything desired but be sure to use the actual created directory in the following steps).

2. mount the drive
mount -t ext3 /dev/sdax /mnt/newhome (replace ext3 with the actual file system and /dev/sdax with the actual device ID of your 500GB drive)
executing the mount command without any options shows all mounted filesystems. Your 500GB drive should now be mounted.

3.copy old home to new home
cp -a -v -u /home/* /mnt/newhome/
check the copy - there should be the same number of files and bytes in /home and in /mnt/newhome.

4. Add line to fstab. There are several different methods of specifying the drive/partition.
/dev/sdax /home ext3 defaults 0 2 (again replace /dev/sdax with the actual device ID and ext3 with the actual filesystem type)

If you reboot the computer now you should be using the new /home partition. However all the old home stuff will still exist on the / partition but will be hidden by the new drive.

5. Once you are satisfied that your new home is ok you can delete the old stuff.
rm -r /home

If you rebooted before deleting you can go back to the old home by commenting out the new drive and then mounting the new drive manually.

Last edited by michaelk; 06-04-2010 at 04:48 PM.
 
  


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
How change a userīs home directory? Roxxor2 Linux - Newbie 3 08-29-2009 07:32 AM
Maildrop : unable to change to home directory eliufoo Linux - Server 9 07-25-2008 06:25 AM
Active Directory User Cannot Write to Samba Home Directory jonwatson Linux - Networking 2 12-19-2006 01:40 PM
Change HOME directory? bhuwan Linux - Newbie 7 01-30-2006 10:19 AM
how to change a user's Home directory n1wil Linux - General 8 08-24-2002 04:22 PM


All times are GMT -5. The time now is 05:22 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