1827804 Members
2178 Online
109969 Solutions
New Discussion

Re: Samba question

 
James_173
Advisor

Samba question

Hi,

I have a HP E200 server running RH6.2 with samba-2.0.6-9 installed.Now I find the hard disk(system disk) has some bad blocks on it.I decide to change it with a new disk.I also want migrate the system to RH8.I install the RH8 on the new disk and copy the files(include smbpasswd,smbusers,smbconf,passwd,shallow,group,gshallow) to the appropriate location.I make sure that all the shared directorys have same path with the old one.After restart the smb service,I can visit it from a Win2k computer.But after I restart the computer I find some shared directorys's owner and group have been changed to number like 531,571.However the owner and group of that directorys are tom or mike in the old system.

Any ideas.

Regards,
James
9 REPLIES 9
John Poff
Honored Contributor

Re: Samba question

Hi,

Did you make the shared directories before you copied over your passwd file? If so, that might explain it. You should be able to just change the ownerships of the directories to the correct owner without any trouble.

What version of Samba are you running on the new box? You might also want to do a 'testparm' to make sure the newer version of Samba is happy with your current smb.conf file.

JP

Re: Samba question

As John said, this is not a major problem. His answer will fix it. My post is just an explanation of this.

The owner & group owner are set on the files & directories as what you currently see which is UID & GID. If you go to your old system and did a "grep 531 /etc/passwd" you would find the password entry for tom or mike. If you did a "grep 571 /etc/group" you would find the group entry for the group that these users belonged to. The "ls" command translates these numbers into the username/groupname of the correct owner if it can find it.

When you created these users in RH8, it created the users with new UID & GID is all.

If the new system had UID 531 mapped to someone else, then these files would have appeared to change ownership, and you would have the owner as fred, or bill now instead.

What you could do in the future when upgrading to 8.1 for instance is copy over the /etc/passwd, /etc/shadow, and /etc/group files to the new system. The format of these files has been static for as long as I have worked on *nix so you are fairly safe keeping your old ones.
James_173
Advisor

Re: Samba question

Hi,

Many thanks for your quick response.Firstly, I installed the RH8 on the new disk.Then I copied the /etc/passwd,/etc/group,/etc/shallow,/etc/gshallow,/etc/smbpasswd,/etc/smbusers,/etc/smbconf from RH6.2 to RH8.After that I made the same hierarchy file system with the old system(only the shared directories).And I run the testparm,everything is ok.Last I restart the smb service and I can visit the shared directories with some user on the W2k computer.
BTW there are more than 200 user are using this server.There are many shared directories being changed to number.It must cost me lots time to manual assign the owner and groups to those directories.I think there might has something I don't do to migrate system.Thanks again.

Regards,

James
Donald Kok
Respected Contributor

Re: Samba question

Hi James,

Do you see the numbers only on the win2k machine, or only on the linux-box. In the latter case, the problem has nothing to do with samba. In the first case, we have to check for samba-cobfiguration.

Donald
My systems are 100% Murphy Compliant. Guaranteed!!!
John Poff
Honored Contributor

Re: Samba question

Hi,

When you made the shared directory heirarchy on the new system, what method did you use? Did you use something like cpio to create an archive on the old system, or did you just do a bunch of mkdir's to create your heirarchy? Did you copy over the passwd,group, etc. files and then reboot, or did you make the heirarchy before rebooting?

Probably your best bet now is to just go ahead and find all the files and directories with no valid user assigned to them and fix them. Something like this:

find /lowest/dir/mount -nouser -print

will give you a list of the offending files and directories.

JP


Michael Steele_2
Honored Contributor

Re: Samba question

You've got duplicate UID's and GID's. Run "...pwck..., and ...grpck...".

http://ctdp.tripod.com/os/linux/commands/index.html

Run "...find -user uid..."

Support Fatherhood - Stop Family Law
Michael Steele_2
Honored Contributor

Re: Samba question

What I am suggesting is duplicate uid's in /etc/passwd and smbpasswd.
Support Fatherhood - Stop Family Law
James_173
Advisor

Re: Samba question

Hi,

Sorry for the late reply.I will try the suggestions provided by you.

Steele,

I can't visit that URL http://ctdp.tripod.com/os/linux/commands/index.html.

Regards,

James
Steven E. Protter
Exalted Contributor

Re: Samba question

I would boot the system with a Windows 98 cd, then fire up a product called ghost, with both disks connected to IDE connecgtors

It will let you do a complete disk copy, and I actually use it to create complete disaster recovery backups of my Linux systems.

In my disaster recovery tests, I was able to replicate entire systems disk to disk, put the new disk in as the boot disk and get the Linux server to boot, no issues at all.

I do the same thing to migrate Windows systems to faster hardware.

SEP

Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com