A stupid thing I've done...

gregorynou at altern.org gregorynou at altern.org
Mon Jan 24 10:02:24 PST 2005


> On Sun, Jan 23, 2005 at 12:37:04AM +0100, Gregory Nou typed:
>> Hi !
>> I've tried to chroot an user, so i create /home/this_user/usr and the
>> other needed directories, but later, I wanted to delete them (as root of
>> course) and i typed rm -r /usr instead of rm -r usr ...
>> It asked me if  i wanted to overwrite su, so i saw my mistake, and
>> cancelled, but i don't have adduser, man, ee and ... make anymore !
>> How can I repair that ? can i do something without reinstalling
>> everything ? (I need at least make... and I'm quite reluctant at
>> compiling /usr/src/usr.bin/make ... So i hope there is another way)
>
> Depending on the branch your system is on (I assume 5.x), you could
> download the latest release relative to your system, mount the cd and
> do:
>
> /rescue/cat /cdrom/base/base.?? | /rescue/tar --unlink -xpzf - -C / usr/
>
> This will reinstall everything under /usr and probably get you a workable
> system again.
>
> G'Luck,
> Ruben

Thx a lot !! that worked !
Actually, I had to do this (just in case somebody would have the same bad
idea I had and would read the posts in this list ;)) :
1. copy gzip from /rescue to /usr/bin (maybe not the good location, but I
could use it, so..)
2. mkdir /usr/tmp && cd /usr/tmp
3. /rescue/cat /cdrom/base/base.?? > usr.bak
4. /rescue/tar --unlink -xpzf usr.bak
And then, I just get what I needed, and had only to copy the missing file.
Being able to RTFM again is so great !
Thanks a lot for your tip.

-- 
Grégory



More information about the freebsd-questions mailing list