FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 09-07-2011, 07:33 PM
jacques
 
Default /usr broken, will the machine reboot ?

Hi,

by error most of the binaries in /usr are erased (killing rm :-(

The server is still up.
Most of the services are restarted either by copying (rsync)
the binaries from another squeeze server (both are running Squeeze)
or desinstalling/installing packages. (apt-* dpkg and suite are restored
and runing ok)


Now the the question is : will this machine *reboot* properly,
inclufing the network ?


Thanks, Jacques




--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4E67C6F6.6060504@lavignotte.org">http://lists.debian.org/4E67C6F6.6060504@lavignotte.org
 
Old 09-07-2011, 07:45 PM
Dan Ritter
 
Default /usr broken, will the machine reboot ?

On Wed, Sep 07, 2011 at 09:33:10PM +0200, jacques wrote:
> Hi,
>
> by error most of the binaries in /usr are erased (killing rm :-(
>
> The server is still up.
> Most of the services are restarted either by copying (rsync)
> the binaries from another squeeze server (both are running Squeeze)
> or desinstalling/installing packages. (apt-* dpkg and suite are
> restored and runing ok)
>
> Now the the question is : will this machine *reboot* properly,
> inclufing the network ?

If you got enough of the binaries restored, yes.

That said, yesterday was a good day to rethink your backup
procedures, eh?

-dsr-


--
http://tao.merseine.nu/~dsr/eula.html is hereby incorporated by reference.
You can't fight for freedom by taking away rights.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110907194506.GT2112@tao.merseine.nu">http://lists.debian.org/20110907194506.GT2112@tao.merseine.nu
 
Old 09-07-2011, 08:00 PM
Bob Proulx
 
Default /usr broken, will the machine reboot ?

jacques wrote:
> by error most of the binaries in /usr are erased (killing rm :-(

Everyone has made that mistake at some point. I know I have!

> The server is still up.

Good. You can probably do a lot of good recovery in that case. You
will find lots of stories of how people have recovered systems with
far less available.

> Most of the services are restarted either by copying (rsync)
> the binaries from another squeeze server (both are running Squeeze)
> or desinstalling/installing packages. (apt-* dpkg and suite are
> restored and runing ok)

That sounds like you have done a lot of good work and made good
progress down the recovery path.

> Now the the question is : will this machine *reboot* properly,
> inclufing the network ?

That depends upon how well you have recovered any missing components.
So the answer is that it depends. Maybe yes. Maybe no. Let me run
some more ideas by you and then you can decide.

The /var/backups/ contains a list of what was installed on the machine
previously. You can get a list of installed packages with:

$ grep-dctrl -s Package -n "install ok installed" /var/backups/dpkg.status.0
...dumps a list of previously installed packages...

$ grep-status -s Package -n "install ok installed"
...dumps the current list of packages installed now...

Putting that information to use you can see what was different between
the backup file and now.

$ grep-dctrl -s Package -n "install ok installed" /var/backups/dpkg.status.0 | sort > /tmp/list.prev

$ grep-status -s Package -n "install ok installed" | sort > /tmp/list.now

$ comm -3 /tmp/list.prev /tmp/list.now

But your problem isn't /var being removed it is /usr being removed.
In that case I would check the directories in /usr/share/doc. By
policy every package must have a directory there.

$ ls /usr/share/doc > /tmp/list.doc
$ comm -3 /tmp/list.now /tmp/list.doc

And then inspecting that list and making a decision about how to
repair. You may want to install more packages. There are a very few
directories in /usr/share/doc that are not the same name as packages.
I have two files and one directory on my machine that are obviously
okay and two directories that should have been removed but are lint
left behind. Something for me to clean. So don't expect that to be
100% but it should be very close to correct. Enough to cross-check
that you have reinstalled the right packages.

The 'debsums' program is useful for checking installed package
integrity. I would definitely run it to check the integrity of the
/usr directory.

By what you say I think you already know how to reinstall individual
packages. But I will say it here because that is how we all learn
these things. Since it is only files in /usr that were removed I
think reinstalling every package should be a good way to recover.

# apt-get install --reinstall PACKAGENAME

If you have a second machine running the same OS version then if the
list of installed packages are the same between the machines then you
should be able to recovery most of /usr from the good machine to the
problem one. Or at least compare files and file lists between them.
Run a find across both machines, sort them, and then compare the
lists.

find /usr -print | sort > /tmp/usr.file.list

I think with the above then you should be fine and the machine should
reboot okay.

For the very paranoid pedantic like me then I would set up a scratch
machine for testing purposes. Then install everything that should be
installed. Then remove /usr to recreate the failure. Then recover as
above and test that the test machine reboots. Learn of any problems
there first and then improve and repeat the recovery process until it
works. It would be quite a bit of work! But it all depends upon how
important this is to you and how much trouble it will be if it fails.

Good luck!
Bob
 
Old 09-09-2011, 07:45 PM
jacques
 
Default /usr broken, will the machine reboot ?

Le 07/09/2011 21:33, jacques a écrit :


Now the the question is : will this machine *reboot* properly,
inclufing the network ?


It did !

After reading


http://tldp.org/LDP/intro-linux/html/sect_03_01.html

%On a server, system data tends to be separate from user data. Programs
%that offer services are kept in a different place than the data
%handled by this service. Different partitions will be created on such
%systems:

%
% a partition with all data necessary to boot the machine
%
% a partition with configuration data and server programs
%
% one or more partitions containing the server data such as database
%tables, user mails, an ftp archive etc.

%
% a partition with user programs and applications
%
%one or more partitions for the user specific files
% (home directories)
%
% one or more swap partitions (virtual memory)LC_ALL=fr_FR.UTF-8


we were pretty confident.

Provided a Rescue disk we issue a 'three finger salute'.

It restarted well, we had to reconfigure some broken locales
(fr_FR.UTF-8) and reinstall *gpm* Mysql and bind9.


There is probably some attention to pay to periodics tasks in the next days.

Thanks all for your advices.

Jacques


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4E6A6CD8.6080102@lavignotte.org">http://lists.debian.org/4E6A6CD8.6080102@lavignotte.org
 
Old 09-10-2011, 12:25 PM
Mark Neidorff
 
Default /usr broken, will the machine reboot ?

On Wednesday 07 September 2011 3:33:10 pm jacques wrote:
> Hi,
>
> by error most of the binaries in /usr are erased (killing rm :-(
>
> The server is still up.
> Most of the services are restarted either by copying (rsync)
> the binaries from another squeeze server (both are running Squeeze)
> or desinstalling/installing packages. (apt-* dpkg and suite are restored
> and runing ok)
>
> Now the the question is : will this machine *reboot* properly,
> inclufing the network ?

I know that my suggestion does not answer your question, but:
Two suggestion:

1. alias "rm" to "rm -i" to add a
rm: remove regular file `filename' ?
to give the user a moment to think for each file.

2. mount /usr as read only

Neither suggestion is 100% foolproof, but they both will help.

Mark


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 201109100825.01109.mark@neidorff.com">http://lists.debian.org/201109100825.01109.mark@neidorff.com
 
Old 09-10-2011, 12:33 PM
jacques
 
Default /usr broken, will the machine reboot ?

Le 10/09/2011 14:25, Mark Neidorff a écrit :

On Wednesday 07 September 2011 3:33:10 pm jacques wrote:

Hi,


Hi Mark,


1. alias "rm" to "rm -i" to add a
rm: remove regular file `filename' ?
to give the user a moment to think for each file.


Done (1)




2. mount /usr as read only


What about updating software

3. Disconnect the keyboard

alternatively : Cut admin's both hands


Mark

Jacques



(1) In .bash_profile uncomment the if/fi statement

# include .bashrc if it exists

if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi


in .bashrc add a line :

# some more ls aliases
#alias ll='ls -l'
#alias la='ls -A'
#alias l='ls -CF'
alias rm='rm -i'





--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4E6B5925.7050600@lavignotte.org">http://lists.debian.org/4E6B5925.7050600@lavignotte.org
 
Old 09-10-2011, 04:16 PM
Ivan Shmakov
 
Default /usr broken, will the machine reboot ?

>>>>> jacques <jacques@lavignotte.org> writes:
>>>>> Le 10/09/2011 14:25, Mark Neidorff a écrit :

[…]

>> 2. mount /usr as read only

> What about updating software

# mount -o remount,rw /usr
# … upgrade…
…
# mount -o remount,ro /usr
#

[…]

--
FSF associate member #7257 Coming soon: Software Freedom Day
http://mail.sf-day.org/lists/listinfo/ planning-ru (ru), sfd-discuss (en)


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 86mxec2x0w.fsf@gray.siamics.net">http://lists.debian.org/86mxec2x0w.fsf@gray.siamics.net
 
Old 09-10-2011, 07:41 PM
Itay
 
Default /usr broken, will the machine reboot ?

On Sat, 10 Sep 2011, Ivan Shmakov wrote:


jacques <jacques@lavignotte.org> writes:
Le 10/09/2011 14:25, Mark Neidorff a écrit :



>> 2. mount /usr as read only

> What about updating software

# mount -o remount,rw /usr
# … upgrade…
…
# mount -o remount,ro /usr
#


Any special care in case that /usr/local is an independent file system
that is mounted separately?


Thanks,
Itay
 
Old 09-10-2011, 09:03 PM
Ivan Shmakov
 
Default /usr broken, will the machine reboot ?

>>>>> Itay <debian@itayf.fastmail.fm> writes:
>>>>> On Sat, 10 Sep 2011, Ivan Shmakov wrote:
>>>>> jacques <jacques@lavignotte.org> writes:
>>>>> Le 10/09/2011 14:25, Mark Neidorff a écrit :

>>>> 2. mount /usr as read only

>>> What about updating software

>> # mount -o remount,rw /usr
>> # … upgrade…
>> …
>> # mount -o remount,ro /usr
>> #

> Any special care in case that /usr/local is an independent file
> system that is mounted separately?

None that I can think of right now.

When performing maintenance of non-Debian software, /usr/local
is remounted read-write before and read-only after. For the
software coming from the Debian packages, the same is done
against /usr.

--
FSF associate member #7257 Coming soon: Software Freedom Day
http://mail.sf-day.org/lists/listinfo/ planning-ru (ru), sfd-discuss (en)


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 86fwk42jpf.fsf@gray.siamics.net">http://lists.debian.org/86fwk42jpf.fsf@gray.siamics.net
 
Old 09-13-2011, 07:52 PM
Martin Steigerwald
 
Default /usr broken, will the machine reboot ?

Am Samstag, 10. September 2011 schrieb jacques:
> Le 10/09/2011 14:25, Mark Neidorff a écrit :
> > On Wednesday 07 September 2011 3:33:10 pm jacques wrote:
> >> Hi,
>
> Hi Mark,

Hi Jacques,

> > 1. alias "rm" to "rm -i" to add a
> > rm: remove regular file `filename' ?
> > to give the user a moment to think for each file.
>
> Done (1)

My first post as german Debian user on international user mailing list...

When you find that rm -i goes on your nerves and you observe yourself using
rm -rf to avoid the countless questions, I suggest having a look at rm -I
or zsh .

Ciao,
--
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 201109132152.04354.Martin@lichtvoll.de">http://lists.debian.org/201109132152.04354.Martin@lichtvoll.de
 

Thread Tools




All times are GMT. The time now is 05:35 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org