SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2013-02-04 21:58:47

typewriterjason
#! Junkie
Registered: 2011-08-28
Posts: 250

question - pooched my machine? (accidentally moved /usr to /lib)

Hey all,

So, I'm feeling sheepish. I was trying to move some files around as root, and basically accidentally moved /usr to /lib.

Now nothing works. When I reboot, I go straight to a command line, but I can't copy /usr back to it's place because I guess 'sudo' isn't visible... because it's in /usr, right?

So I don't have the permission to copy the folder because I can't use sudo. When I try to log in as root, the root password doesn't appear to match my user password. (Which I didn't know. Anyone have any info on that.)

Anyway. I'm trying to log in using a Lubuntu USB and see if I can copy the folders that way, but I'm not confident...

Help?


Fortune favors the bold.
#! WALDORF
Asus EEEPC 1001PXD | Lenovo ThinkPad t410

Offline

Help fund CrunchBang, donate to the project!

#2 2013-02-04 22:00:58

el_koraco
#!/loony/bun
From: inside Ed
Registered: 2011-07-25
Posts: 4,749

Re: question - pooched my machine? (accidentally moved /usr to /lib)

reinstall

Offline

#3 2013-02-04 22:08:17

typewriterjason
#! Junkie
Registered: 2011-08-28
Posts: 250

Re: question - pooched my machine? (accidentally moved /usr to /lib)

Can I find a way to do that without wiping out all my content and current settings?

Sorry for the newbie-questions, I'm a bit panicky.


Fortune favors the bold.
#! WALDORF
Asus EEEPC 1001PXD | Lenovo ThinkPad t410

Offline

#4 2013-02-04 22:36:48

dura
Bloated Gimp
From: interzone
Registered: 2012-09-15
Posts: 2,108

Re: question - pooched my machine? (accidentally moved /usr to /lib)

You can copy all your content to some external storage or to another partition via live usb. Doubt you have many extra settings that are worth saving.

Offline

#5 2013-02-04 22:49:31

el_koraco
#!/loony/bun
From: inside Ed
Registered: 2011-07-25
Posts: 4,749

Re: question - pooched my machine? (accidentally moved /usr to /lib)

Actually, you might just be in luck. Try to boot to single user mode (press e on the Grub screen, navigate to the line that starts with "kernel", add Single to that line and hit Control plus X). mv is in /bin, so you can try to use it. I'm guessing you moved usr to lib, so do

mv /lib/usr /

Hope and pray.

Offline

#6 2013-02-04 23:05:33

typewriterjason
#! Junkie
Registered: 2011-08-28
Posts: 250

Re: question - pooched my machine? (accidentally moved /usr to /lib)

I got it, actually through using a Lubuntu bootable USB I made for another machine recently.

I didn't have permission at first, but I was able to operate as 'root' in Lubuntu and copy it that way.

@el_koraco, that probably would have worked to! Good tip and something to keep in mind if I don't have live USB's handy.

Here's the other thing though; why isn't the root user password the same as the one I set up as the primary user of the machine?


Fortune favors the bold.
#! WALDORF
Asus EEEPC 1001PXD | Lenovo ThinkPad t410

Offline

#7 2013-02-05 05:50:13

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 13,956

Re: question - pooched my machine? (accidentally moved /usr to /lib)

^ In sudo systems like CrunchBang and Ubuntu, the root account is deactivated by default.  To activate it, run `sudo passwd`; you'll be asked for your user password (as usual when using sudo), then asked to enter a root password.

Offline

#8 2013-02-05 10:31:44

wuxmedia
wookiee madclaw
From: Back in Blighty
Registered: 2012-03-09
Posts: 1,478
Website

Re: question - pooched my machine? (accidentally moved /usr to /lib)

@typewriterjason; I bet you'll check your root commands now. glasses
i know i do after i mv 'ed my *entire* root filesystem to /usr/  roll
a good alias to have in roots .bash_aliases (or in .bashrc) is;

mv='mv -i'

gives you a second to work out if it's what you want to do.

Offline

#9 2013-02-05 17:49:25

typewriterjason
#! Junkie
Registered: 2011-08-28
Posts: 250

Re: question - pooched my machine? (accidentally moved /usr to /lib)

@pvsage, Would it make sense to give an option when installing the OS to link a particular user's password with the root password? My user password seems to work when I do SUDO, I guess because my user profile has superuser access. But when I can't access SUDO...

As my own foolishness has demonstrated, it might be worth making setting that password mandatory in the install?


Fortune favors the bold.
#! WALDORF
Asus EEEPC 1001PXD | Lenovo ThinkPad t410

Offline

#10 2013-02-05 19:31:05

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 13,956

Re: question - pooched my machine? (accidentally moved /usr to /lib)

typewriterjason wrote:

@pvsage, Would it make sense to give an option when installing the OS to link a particular user's password with the root password? My user password seems to work when I do SUDO, I guess because my user profile has superuser access. But when I can't access SUDO...

This is typically considered a bad idea in terms of security; some users consider sudo an equally bad idea, as it grants root rights/access with the sudoer's password.

As my own foolishness has demonstrated, it might be worth making setting that password mandatory in the install?

That is how things are done in a typical Debian install.  Aside from CrunchBang's Ubuntu roots, I have no idea why corenominal continues to opt for the sudo route.

Offline

#11 2013-02-06 07:41:28

wuxmedia
wookiee madclaw
From: Back in Blighty
Registered: 2012-03-09
Posts: 1,478
Website

Re: question - pooched my machine? (accidentally moved /usr to /lib)

^older post (using sudo) still work?

Offline

#12 2013-02-06 22:54:46

typewriterjason
#! Junkie
Registered: 2011-08-28
Posts: 250

Re: question - pooched my machine? (accidentally moved /usr to /lib)

@wuxmedia - I'm not sure what you mean. Sudo didn't work after I made the mistake; I think the sudo commands are probablly somewhere in the the /usr directories, which is what I copied in the first place.

Sudo works now, but I fixed it through using a USB-bootable Lubuntu usage to get access to the files.


Fortune favors the bold.
#! WALDORF
Asus EEEPC 1001PXD | Lenovo ThinkPad t410

Offline

#13 2013-02-06 23:23:25

wuxmedia
wookiee madclaw
From: Back in Blighty
Registered: 2012-03-09
Posts: 1,478
Website

Re: question - pooched my machine? (accidentally moved /usr to /lib)

to clarify.

pvsage wrote:

I have no idea why corenominal continues to opt for the sudo route.

maybe because older posts (using sudo) still work?

@typewriterjason glad it's all better now.

Offline

#14 2013-02-07 20:54:52

typewriterjason
#! Junkie
Registered: 2011-08-28
Posts: 250

Re: question - pooched my machine? (accidentally moved /usr to /lib)

sudo seems to be prevalent through most of Linux culture, at least in terms of what I've seen. There's a hundred ways to skin a cat, but if 70% are doing it one way, then you might as well keep them in mind...


Fortune favors the bold.
#! WALDORF
Asus EEEPC 1001PXD | Lenovo ThinkPad t410

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo