Hello, I have been working on a RedHat machine that is a PDC for a Windows network running XP clients. The system has the following shares defined in /etc/samba/smb.conf: /home/netlogon /home/profiles /public (FYI /public is a symbolic link to /home/public) /home/share1 /home/share2 They are all on the /home partition which is on the main system drive, which is full. I have installed a second drive, made an ext2 file system, and mounted the drive as 1 large partition called /share. I then copied all the data from the /home partition to the /share drive via ( cp -R /home/* /share ). I then edited the paths for the shares listed above in /etc/samba/smb.conf, changing any references to /home to /share. I deleted the /public symbolic link, and changed the share path for that share to /share/public Restarting Samba resulted in the client machines (all running XP) logging in and receiving an error that their profiles could not be found. I quickly reverted everything back to the way it was to make sure all was well, which it was. I then tried just changing the location of the /public share, by changing the path in smb.conf from /public to /share/public, expecting that the users would be able to login, their home directories would be full, but the 'public' share would be on the new large drive at least. But doing just this also resulted in them receiving the error that their roaming profile could not be located. I had also tried not mounting the /home partition on the primary drive, and mounting the new drive ( /dev/sdb ) as /home expecting this would work and would result in me not needing to edit anything in /etc/samba/smb.conf - which was also wrong - I got the same results, profiles could not be found. So I reverted everything back to the old drive, but created a new share in smb.conf called 'new' and set its path to /share (the new drive) and this worked, it was happy to leave existing shares in the original location and have a new share in the new location. This at least gave the people a new spot to put their data, but was not what they were after. My questions are: 1) The first thing I noticed is that when I copied everything over from the old drive to the new, all the permissions, ownership & group information was lost. Everything was owned by root. Manually changing the permissions for the /share/profile folder to make them match the original made no difference. What did I do wrong ( cp -R /home/* /share ) that did not copy the permissions / ownership info over? 2) Why would changing the location of the 'public' share result in people not being able to login, when their profiles and the 'netlogon' share were still defined as being on the old drive? 3) Searching for smb.conf resulted in several copies of it floating around the place, most of them in folders that included 'example' in the path. Is it possible that Samba could be looking at multiple copies of this? Where is Samba told which smb.conf to look at? 4) If you can spot where I have errored, please point it out. If I can provide more info, please let me know, I've tried to be as precise as possible. Thanks in advance. Daniel
Jeff Umbach
2004-Dec-14 23:37 UTC
[Samba] Re: Problem moving Samba shares to newly installed drive
cp -R will not preserve the permissions, cp -Rp will. Daniel wrote:> Hello, > > I have been working on a RedHat machine that is a PDC for a Windows network > running XP clients. > > The system has the following shares defined in /etc/samba/smb.conf: > > /home/netlogon > /home/profiles > /public (FYI /public is a symbolic link to /home/public) > /home/share1 > /home/share2 > > They are all on the /home partition which is on the main system drive, which > is full. > > I have installed a second drive, made an ext2 file system, and mounted the > drive as 1 large partition called /share. > > I then copied all the data from the /home partition to the /share drive via > ( cp -R /home/* /share ). > > I then edited the paths for the shares listed above in /etc/samba/smb.conf, > changing any references to /home to /share. I deleted the /public symbolic > link, and changed the share path for that share to /share/public > > Restarting Samba resulted in the client machines (all running XP) logging in > and receiving an error that their profiles could not be found. > > I quickly reverted everything back to the way it was to make sure all was > well, which it was. > > I then tried just changing the location of the /public share, by changing > the path in smb.conf from /public to /share/public, expecting that the users > would be able to login, their home directories would be full, but the > 'public' share would be on the new large drive at least. > > But doing just this also resulted in them receiving the error that their > roaming profile could not be located. > > I had also tried not mounting the /home partition on the primary drive, and > mounting the new drive ( /dev/sdb ) as /home expecting this would work and > would result in me not needing to edit anything in /etc/samba/smb.conf - > which was also wrong - I got the same results, profiles could not be found. > > So I reverted everything back to the old drive, but created a new share in > smb.conf called 'new' and set its path to /share (the new drive) and this > worked, it was happy to leave existing shares in the original location and > have a new share in the new location. > > This at least gave the people a new spot to put their data, but was not what > they were after. > > > > My questions are: > > 1) The first thing I noticed is that when I copied everything over from the > old drive to the new, all the permissions, ownership & group information was > lost. Everything was owned by root. Manually changing the permissions for > the /share/profile folder to make them match the original made no > difference. What did I do wrong ( cp -R /home/* /share ) that did not copy > the permissions / ownership info over? > > 2) Why would changing the location of the 'public' share result in people > not being able to login, when their profiles and the 'netlogon' share were > still defined as being on the old drive? > > 3) Searching for smb.conf resulted in several copies of it floating around > the place, most of them in folders that included 'example' in the path. Is > it possible that Samba could be looking at multiple copies of this? Where > is Samba told which smb.conf to look at? > > 4) If you can spot where I have errored, please point it out. If I can > provide more info, please let me know, I've tried to be as precise as > possible. > > Thanks in advance. > > Daniel > >
Jim C.
2004-Dec-15 00:07 UTC
[Samba] Re: Problem moving Samba shares to newly installed drive
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Daniel wrote: | Hello, | | I have been working on a RedHat machine that is a PDC for a Windows network | running XP clients. | | The system has the following shares defined in /etc/samba/smb.conf: | | /home/netlogon | /home/profiles | /public (FYI /public is a symbolic link to /home/public) | /home/share1 | /home/share2 | | They are all on the /home partition which is on the main system drive, which | is full. | | I have installed a second drive, made an ext2 file system, and mounted the | drive as 1 large partition called /share. | | I then copied all the data from the /home partition to the /share drive via | ( cp -R /home/* /share ). Couple of points. 1. It sounds like maybe you are combining profiles and home directories. ~ I remember hearing that this is a bad idea for security reasons. I'm sorry, though. I can't remember the specifics. 2. Use -pR on your copy. Where p stands for preserve ownerships and permissions. Alternatively, think about using mv instead. If I am not mistaken, it doesn't mess with the perms. As for the rest, it is hard to tell. If you can get back to square 1 and start over, it would be best. This would include removing the extra smb.conf files to your root directory (i.e. someplace out of the way) at least. As far as I know, samba has one and only one configuration file although I think sub-configuration files *can* be specified within it. Still I'm pretty sure that if you had done this, you would know. Jim C. - -- - ----------------------------------------------------------------- | I can be reached on the following Instant Messenger services: | |---------------------------------------------------------------| | MSN: j_c_llings @ hotmail.com AIM: WyteLi0n ICQ: 123291844 | |---------------------------------------------------------------| | Y!: j_c_llings Jabber: jcllings @ njs.netlab.cz | - ----------------------------------------------------------------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD4DBQFBv3/o57L0B7uXm9oRAqDMAJ9P+WxhJ+rd00cYVaonGpLfP+MkLACYrr+j XVyAEHTivA+EbMtOZ2yF7w==jNUh -----END PGP SIGNATURE-----
Reasonably Related Threads
- how do I run something on a newly installed server, on it's 1st boot only?
- freenx not working with newly installed centos 6.4
- Newly installed version; can't run lm function
- smbd could not access share directory on drbd (8.3 on Centos 5 i386)
- msdfs not working on netbios aliases?