<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

	<title>Comments on: Rebuilding Ubuntu Server 8.04 Help!!</title>
	<link>http://ask.metafilter.com/114457/Rebuilding-Ubuntu-Server-804-Help/</link>
	<description>Comments on Ask MetaFilter post Rebuilding Ubuntu Server 8.04 Help!!</description>
	<pubDate>Tue, 17 Feb 2009 11:47:28 -0800</pubDate>
	<lastBuildDate>Tue, 17 Feb 2009 11:47:28 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: Rebuilding Ubuntu Server 8.04 Help!!</title>
		<link>http://ask.metafilter.com/114457/Rebuilding-Ubuntu-Server-804-Help</link>	
		<description>I recently lost a raid array on a ubuntu 8.04 server forcing me to rebuild it from scratch and/or restore data from backup. (I have copies of /var, /etc, and /home) The problem is I can&apos;t seem to rebuild the server so that it works exactly the way it did before, this is killing me!!  (fyi... I inherited this system).  My specific problem seems to be with Samba.    I&apos;m looking for help in two different ways...  help 1) either figure out how to restore this system with what I&apos;ve got backed up.  Or fix samba so it works.  See details below: &lt;br /&gt;&lt;br /&gt; The previous system was Ubuntu 8.04.  I&apos;ve got good backups of /etc /var and /home. &lt;br&gt;
&lt;br&gt;
What I want to do is simply build a basic install of ubuntu server 8.04 and restore /etc and /var.  But this fails, because I am missing packages.  I don&apos;t know what packages need to be installed to make this system complete.  It seems like there should be something in my backup of /var/lib/apt should be able to tell me what packages are missing, need to installed, or reinstalled.&lt;br&gt;
&lt;br&gt;
If I can&apos;t restore the server with the strategy above, I guess I need to rebuild the thing from scratch... which is what I&apos;ve been doing and leads me to my next problem: Samba, LDAP, name resolution, and/or other unknown problems....&lt;br&gt;
&lt;br&gt;
Samba user authenticate to openldap directory on another network.  I&apos;ve got nss working.  I can do a #getent passwd and see ldap data.  I&apos;ve got my secrets.tdb setup and it seems like samba can query ldap.  But I&apos;m not sure all the naming services are working.  In my /var/log/samba/log.smbd I see some errors  &quot;warning: failed to create BUILTIN\Administrators group! Can Winbind allocate gids?&quot;. (smb.conf log level = 5)&lt;br&gt;
&lt;br&gt;
anyhow, I can post whatever log files or config files that might be helpful.  &lt;br&gt;
&lt;br&gt;
Another interesting clue to what might be wrong.... I have a win2k and wink3 server that both have shares with permissions for users from the domain that the failed Samba server was advertising.   On the windows servers I&apos;ve added the IP address of the WINS server on the network that the LDAP server is located... now the windows servers at least show user info in the permissions dialog box for the shares.  But folks still can not authenticate to these windows shares... access is denied because of invalid credentials (or something).&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Any ideas?&lt;br&gt;
&lt;br&gt;
TIA,&lt;br&gt;
Dave</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2009:site.114457</guid>
		<pubDate>Tue, 17 Feb 2009 11:40:27 -0800</pubDate>
		<dc:creator>purenitrous</dc:creator>
		
			<category>ubuntu</category>
		
			<category>804</category>
		
			<category>samba</category>
		
			<category>ldap</category>
		
			<category>nss</category>
		
			<category>pam</category>
		
			<category>system</category>
		
			<category>restore</category>
		
	</item> <item>
		<title>By: ijoyner</title>
		<link>http://ask.metafilter.com/114457/Rebuilding-Ubuntu-Server-804-Help#1643359</link>	
		<description>Did you CHMOD the files and folders after copying them over so that they could have the appropriate rights. I know that when I copied data from an old linux install I had to reset permissions for everything or I couldn&apos;t write to the folders. I&apos;m supposing you allowed the package manager to install samba for you.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2009:site.114457-1643359</guid>
		<pubDate>Tue, 17 Feb 2009 11:47:28 -0800</pubDate>
		<dc:creator>ijoyner</dc:creator>
	</item><item>
		<title>By: purenitrous</title>
		<link>http://ask.metafilter.com/114457/Rebuilding-Ubuntu-Server-804-Help#1643376</link>	
		<description>I&apos;ve been using rsyn -aHv to move files from the backup server to the new install.  I believe preserves permission, ownership, and hard links.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2009:site.114457-1643376</guid>
		<pubDate>Tue, 17 Feb 2009 12:10:11 -0800</pubDate>
		<dc:creator>purenitrous</dc:creator>
	</item><item>
		<title>By: purenitrous</title>
		<link>http://ask.metafilter.com/114457/Rebuilding-Ubuntu-Server-804-Help#1643378</link>	
		<description>Also, I did do a #apt-get install samba samba-doc smbldap-tools</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2009:site.114457-1643378</guid>
		<pubDate>Tue, 17 Feb 2009 12:11:31 -0800</pubDate>
		<dc:creator>purenitrous</dc:creator>
	</item><item>
		<title>By: purenitrous</title>
		<link>http://ask.metafilter.com/114457/Rebuilding-Ubuntu-Server-804-Help#1643420</link>	
		<description>uhh... that would have been #rsync -aHv&lt;br&gt;
(sorry for the typo)</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2009:site.114457-1643420</guid>
		<pubDate>Tue, 17 Feb 2009 12:44:59 -0800</pubDate>
		<dc:creator>purenitrous</dc:creator>
	</item><item>
		<title>By: purenitrous</title>
		<link>http://ask.metafilter.com/114457/Rebuilding-Ubuntu-Server-804-Help#1643425</link>	
		<description>also did  a #apt-get install auth-client-config libpam-ldap libnss-ldap</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2009:site.114457-1643425</guid>
		<pubDate>Tue, 17 Feb 2009 12:50:48 -0800</pubDate>
		<dc:creator>purenitrous</dc:creator>
	</item><item>
		<title>By: Tobu</title>
		<link>http://ask.metafilter.com/114457/Rebuilding-Ubuntu-Server-804-Help#1643495</link>	
		<description>The package preseeds (used to generate some default config files, most of which are in /etc and you will overwrite later anyway) are in &lt;code&gt;$OLDROOT/var/cache/debconf&lt;/code&gt;.&lt;br&gt;
&lt;br&gt;
Restore them:&lt;br&gt;
&lt;code&gt;&lt;br&gt;
sudo sh -c &apos;chroot $OLDROOT debconf-get-selections | debconf-set-selections&apos;&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
Restore the package repository indexes:&lt;br&gt;
&lt;code&gt;&lt;br&gt;
sudo sh -c &apos;chroot $OLDROOT aptitude-create-state-bundle /tmp/apt-state; aptitude-run-state-bundle $OLDROOT/tmp/apt-state&apos;&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
Restore the package selections (/var/lib/dpkg/status and /var/backups/dpkg.status.0) and enforce them:&lt;br&gt;
&lt;code&gt;&lt;br&gt;
sudo sh -c &apos;dpkg --clear-selections; chroot $OLDROOT dpkg --get-selections | dpkg --set-selections; aptitude install&apos;&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Overwrite /etc, /var, etc (you may need to pass --delete to rsync, but be careful if the backups omitted some subfolders):&lt;br&gt;
&lt;code&gt;&lt;br&gt;
sudo rsync -avH {$OLDROOT,}/etc&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
(these commands may need tweaking, the chroot stuff may need to be done some other way if you don&apos;t have enough stuff in $OLDROOT)</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2009:site.114457-1643495</guid>
		<pubDate>Tue, 17 Feb 2009 13:49:05 -0800</pubDate>
		<dc:creator>Tobu</dc:creator>
	</item><item>
		<title>By: gjc</title>
		<link>http://ask.metafilter.com/114457/Rebuilding-Ubuntu-Server-804-Help#1643730</link>	
		<description>can you get to the old /etc/samba/smb.conf and see what it says?</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2009:site.114457-1643730</guid>
		<pubDate>Tue, 17 Feb 2009 16:37:27 -0800</pubDate>
		<dc:creator>gjc</dc:creator>
	</item><item>
		<title>By: gjc</title>
		<link>http://ask.metafilter.com/114457/Rebuilding-Ubuntu-Server-804-Help#1643731</link>	
		<description>And how did the raid fail?</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2009:site.114457-1643731</guid>
		<pubDate>Tue, 17 Feb 2009 16:37:59 -0800</pubDate>
		<dc:creator>gjc</dc:creator>
	</item><item>
		<title>By: purenitrous</title>
		<link>http://ask.metafilter.com/114457/Rebuilding-Ubuntu-Server-804-Help#1644636</link>	
		<description>I lost two drives on the raid during a reboot.  Bad luck I guess.&lt;br&gt;
&lt;br&gt;
Tobu&apos;s advice pointed me in the right direction.  (THANK YOU!!!)  I ended up calling an experienced sysadmin/friend here in my area to help me walk through the process.  Here&apos;s what we did:&lt;br&gt;
1) fresh install of Ubuntu 8.04&lt;br&gt;
2) copied backup versions of /var and /etc to /home/tmp/ (I used /home because it had the largest free space based on my partitioning scheme for the new drives).  And of course also restored /home back to its original location.&lt;br&gt;
3)friend used some perl/regular expression voodoo to compare packages between fresh install and what was backed up... I&apos;ll try and recreate the exact syntax... not sure this will be totally accurate.&lt;br&gt;
&lt;br&gt;
#apt-get update&lt;br&gt;
#apt-get upgrade&lt;br&gt;
#reboot&lt;br&gt;
#ls /home/tmp/var/lib/dpkg/install | perl -pe &apos;s/\.[^.]+$/\n/&apos; | sort -u &amp;gt;/home/tmp/list.orig&lt;br&gt;
#ls /var/lib/dpkg/install | perl -pe &apos;s/\.[^.]+$/\n/&apos; | sort -u &amp;gt;/home/tmp/list.new&lt;br&gt;
#cd /home/tmp&lt;br&gt;
#diff list.orig list.new | grep &apos;&lt;&gt;pkglist&lt;br&gt;
#!!NOTE!! I bleive we then edited pkglist removing any kernel related packages that would have been updates when we did the #apt-get upgrade&lt;br&gt;
#apt-get install `cat pkglist`&lt;br&gt;
#reboot&lt;br&gt;
&lt;br&gt;
Tried to figure out what the differences were in /home/tmp/var and /var as well as /home/tmp/etc/ /etc/ and copy important changes back into /var and /etc.&lt;br&gt;
&lt;br&gt;
#diff -r /home/tmp/etc /etc &amp;gt;etc-diffs&lt;br&gt;
#diff -r /home/tmp/var /var &amp;gt;var-diffs&lt;br&gt;
&lt;br&gt;
then sitting in /home/tmp/etc executed the following copy commands:&lt;br&gt;
&lt;br&gt;
cp /etc/ldap.conf /etc/ldap.conf.bak&lt;br&gt;
cp ldap.conf /etc/ldap.conf&lt;br&gt;
cp aliases aliases.bak&lt;br&gt;
cp /etc/exports /etc/exports.bak&lt;br&gt;
cp exports /etc/exports&lt;br&gt;
cp /etc/group /etc/group.bak&lt;br&gt;
cp group /etc/group&lt;br&gt;
cp /etc/gshadow /etc/gshadow.bak&lt;br&gt;
cp gshadow /etc/gshadow&lt;br&gt;
less /etc/init.d/dhcp3-server &lt;br&gt;
cp ldap.secret /etc/ldap.secret &lt;br&gt;
cp /etc/nsswitch.conf /etc/nsswitch.conf.bak&lt;br&gt;
cp nsswitch.conf /etc/nsswitch.conf&lt;br&gt;
cp /etc/ntp.conf /etc/ntp.conf.bak&lt;br&gt;
cp ntp.conf /etc/ntp.conf&lt;br&gt;
cp /etc/pam.d/samba /etc/pam.d.bak&lt;br&gt;
cp pam.d/samba /etc/pam.d/samba &lt;br&gt;
cp /etc/syslog.conf /etc/syslog.conf.bak&lt;br&gt;
cp syslog.conf /etc/syslog.conf&lt;br&gt;
less /etc/samba/dhcp.conf &lt;br&gt;
rm /etc/samba/dhcp.conf&lt;br&gt;
cp samba/lmhosts /etc/samba&lt;br&gt;
cp /etc/samba/smb.conf /etc/samba/smb.conf.bak&lt;br&gt;
cp samba/smb.conf /etc/samba/smb.conf&lt;br&gt;
cd /home/tmp/etc/dhcp3/&lt;br&gt;
cp /etc/dhcp3/dhcpd.conf /etc/dhcp3/dhcpd.conf.bak&lt;br&gt;
cp dhcpd.conf /etc/dhcp3/dhcpd.conf&lt;br&gt;
&lt;br&gt;
For Samba I needed to recreate the secrets.tdb file using the following command&lt;br&gt;
#smbpasswd -w [passwd]&lt;br&gt;
&lt;br&gt;
We ended up not really copying anything into /var.  I did need to recreate a folder /var/log/samba3 for my samba logging.&lt;br&gt;
&lt;br&gt;
The system is now more or less functional however I&apos;m still having weird WINS problems.  This server is unable to register with our primary Samba/WINS server on another network... and is causing some naming and authentication problems on this network.&lt;br&gt;
&lt;br&gt;
Whew!  Thanks again for your help.&lt;/&gt;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2009:site.114457-1644636</guid>
		<pubDate>Wed, 18 Feb 2009 12:25:23 -0800</pubDate>
		<dc:creator>purenitrous</dc:creator>
	</item>
	</channel>
</rss>
