LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 01-22-2008, 08:23 PM   #1
linuxlimbo
Member
 
Registered: Dec 2004
Posts: 43

Rep: Reputation: 15
how to backup SAMBA files


I am running SUSE 10.2 and have my machine functioning as a Domain Controller. Is there a way to backup the Samba domain info so that if I do a reinstall of Linux, I don't have to play games with the two Windows machines that are joined to the domain. ( ie, remove them from the domain and rejoin them within Windows.) The last time I did this, I had trouble with the profiles on the Windows machines once I rejoined them. It seems like there must be some directories that contain all of the machine and user info that I could backup and then restore later.
 
Old 01-22-2008, 08:30 PM   #2
rabbit2345
Member
 
Registered: Apr 2007
Location: 中国上海
Distribution: Lubuntu 16.04 LTS
Posts: 372

Rep: Reputation: 40
copy all of the /etc/samba files and that should save your configuration. Most of your configuration files are in the /etc directory

you can use the command:

cp /etc/samba/* /<path to backup site>/
 
Old 01-22-2008, 09:53 PM   #3
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,138

Rep: Reputation: 168Reputation: 168
Also, to get sub-directories you could use:
Code:
 cp -av /etc/samba /path/to/backup
Or you could tar/compress the data with:
Code:
tar -cjvf /path/to/backup/samba.tar.bz2 -C /etc samba
 
Old 07-15-2008, 01:28 PM   #4
furb-dizzle
LQ Newbie
 
Registered: Jul 2008
Posts: 2

Rep: Reputation: 0
Not just configuration, more help, please... :-)

Limbo: I am looking for the same thing.

Obviously the config files for samba are needed, then you also need the /etc/passwd, /etc/shadow, and /etc/group files so that the unix users exist after recovery.

However, the samba *.tdb files (the database of users/sids/blah blah blah) are also needed. I believe those are in /var/lib/samba for many distributions, and we have done these too.

If that worked, I'd be happy to report, but it doesn't; we just did a server replacement because our server died (a RAM issue that exposed itself during a distribution upgrade - not nice). So we recovered all of the configuration files, and the database files, but still had to rejoin all of the workstations to the new server with the same existing domain. I tried adding the machine accounts to the server (smbpasswd -m machinename$) but that still didn't work. I even had to add all of the users to the samba server using pdbedit -a -u user. The user and machine accounts were in unix, because I had the /etc/passwd, group, and shadow files transferred, but they were not in the pdbedit -L list. So, I think we need an alternate backup utility but I have scoured the Internet and have come up short. I saw a reference to a tdbbackup utility, but need to search further.

If I come up with something, I'll let you know, and if you could do the same it would be much appreciated. This is an issue that has plagued us several times as we have had offices with 20 workstations and had to rejoin them all. Sometimes, we've had to build all of the employees' profiles from scratch because their sids were screwed up. That makes for a long weekend, and there's just got to be a better way!

Thanks in advance,

Furb-dizzle
 
Old 10-17-2009, 03:18 PM   #5
AndreAPL
LQ Newbie
 
Registered: Sep 2005
Location: Portugal
Distribution: OpenSuSE 11.1 AMD64
Posts: 8

Rep: Reputation: 0
Quote:
Originally Posted by furb-dizzle View Post
Limbo: I am looking for the same thing.

Obviously the config files for samba are needed, then you also need the /etc/passwd, /etc/shadow, and /etc/group files so that the unix users exist after recovery.

However, the samba *.tdb files (the database of users/sids/blah blah blah) are also needed. I believe those are in /var/lib/samba for many distributions, and we have done these too.

If that worked, I'd be happy to report, but it doesn't; we just did a server replacement because our server died (a RAM issue that exposed itself during a distribution upgrade - not nice). So we recovered all of the configuration files, and the database files, but still had to rejoin all of the workstations to the new server with the same existing domain. I tried adding the machine accounts to the server (smbpasswd -m machinename$) but that still didn't work. I even had to add all of the users to the samba server using pdbedit -a -u user. The user and machine accounts were in unix, because I had the /etc/passwd, group, and shadow files transferred, but they were not in the pdbedit -L list. So, I think we need an alternate backup utility but I have scoured the Internet and have come up short. I saw a reference to a tdbbackup utility, but need to search further.

If I come up with something, I'll let you know, and if you could do the same it would be much appreciated. This is an issue that has plagued us several times as we have had offices with 20 workstations and had to rejoin them all. Sometimes, we've had to build all of the employees' profiles from scratch because their sids were screwed up. That makes for a long weekend, and there's just got to be a better way!

Thanks in advance,

Furb-dizzle
Sorry the digging.
Any news?
 
Old 10-19-2009, 12:08 PM   #6
furb-dizzle
LQ Newbie
 
Registered: Jul 2008
Posts: 2

Rep: Reputation: 0
Quote:
Originally Posted by AndreAPL View Post
Sorry the digging.
Any news?
I sort of gave up after searching for a bit. I think it has to do with the SID of the server, but I'm not sure. If you could change the new server's SID to be the same as the old one, and copy all of the database configuration files over, it seems like you could do it. I am not sure; it doesn't come up all that often for us, so I just do it by hand. It is a drag, though when it happens.
 
  


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
text files and their automatic backup files AGazzaz Linux - General 1 07-01-2006 07:38 AM
Samba and XP Backup edanono Linux - Networking 1 12-30-2005 08:15 AM
Samba backup technochef Linux - Networking 4 09-09-2004 06:49 PM
Red Hat with samba, which files to backup??? Evan P. Linux - General 2 11-07-2003 07:23 AM
Using NT Backup on samba shares RobLea Linux - Software 1 10-08-2003 10:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

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