Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Came home to find /bin and /etc missing
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Pandaman
n00b
n00b


Joined: 30 Jan 2012
Posts: 15

PostPosted: Thu Dec 13, 2012 1:06 am    Post subject: Came home to find /bin and /etc missing Reply with quote

Hello all! I have a bit of a strange situation. I recently upgraded my system and was finally getting around to reinstalling Gentoo. Everything was up and running smoothly, so I decided to move my data back onto my main disk. I started the transfer this morning. After starting the transfer with pcmanfm, I gave my PC a simple command I wanted it to execute when it finished (which would be in about 30-40 minutes). The exact command I used was 'sleep 60m;sync;umount /dev/sdd1 -l;poweroff'. Imagine my surprise when I came home and found that my pc hadn't shut off. I checked the terminal and saw that bash couldn't find /sbin/poweroff. It also could not execute the command ls. Among other things.

So I restarted, logged into Windows and fired up virtualbox. Low and behold, /bin and /etc was gone. With both of those missing (but none of my data), I decided to hose off the rest of the disk and start over. My question is simply: What could have possibly caused this? The only other thing I did was install KDE last night, which went off without a hitch (however I hadn't used it, I was still using openbox and lxterminal). Everything was working fine. It appeared that /dev/sdd1 was unmounted just fine too, and that disk only had data that I was transferring off of it. Root's Bash history was as expected, and it didn't appear that anyone had to tried to access my system, so I'm kind of puzzled as to how this could have possibly happened. I've never had anything like this happen before (at least, not happen as a direct result of my stupidity :P ). /dev/sdd1 was where I had installed Debian about a month ago, was using it up until now. It is no longer in use in my system.

Thanks for reading, have a great day!
Back to top
View user's profile Send private message
audiodef
Watchman
Watchman


Joined: 06 Jul 2005
Posts: 6639
Location: The soundosphere

PostPosted: Thu Dec 13, 2012 2:10 pm    Post subject: Reply with quote

I don't know why that happened, but if you set up a fresh install and want to move data to your install hd from another hd, I would just use cp, not sync.
_________________
decibel Linux: https://decibellinux.org
Github: https://github.com/Gentoo-Music-and-Audio-Technology
Facebook: https://www.facebook.com/decibellinux
Discord: https://discord.gg/73XV24dNPN
Back to top
View user's profile Send private message
LiamOS
n00b
n00b


Joined: 06 Jun 2012
Posts: 64
Location: Ireland

PostPosted: Thu Dec 13, 2012 4:50 pm    Post subject: Reply with quote

When you got home, had the command finished executing? Were there any error messages? Was it only /bin and /etc that were missing?
I'm not completely sure what sync does, having never used it(I'm a cp kinda guy), but it could have error'd out at some point(Possibly from trying to do something with /proc or devtmpfs?).


Needless to say, this is one of the funniest thread titles I've seen so far. :)
_________________
CFLAGS=" -O999999"
Back to top
View user's profile Send private message
BitJam
Advocate
Advocate


Joined: 12 Aug 2003
Posts: 2508
Location: Silver City, NM

PostPosted: Thu Dec 13, 2012 5:50 pm    Post subject: Reply with quote

I think the copy was done with pcmanfm. The sync command does not copy.

I imagine the problem is in pcmanfm and/or how you used it to do the copying. GUI tools are good for many things but system administration is not one of them. Unless pcmanfm keeps a detailed log of its actions then you have no way to know exactly what went wrong. You don't even know if it was a bug in pcmanfm or pilot error.

There are a number of standard command line tools for copying many files including rsync, tar, cpio, and the very simple "cp -a". As an added benefit, you don't need to guess how long the copying will take because the command finishes when the copying is done.
Back to top
View user's profile Send private message
Pandaman
n00b
n00b


Joined: 30 Jan 2012
Posts: 15

PostPosted: Thu Dec 13, 2012 8:20 pm    Post subject: Reply with quote

Yeah, I know I shouldn't have, it was just supposed to be a quick copy job :P /sbin was also gone. /usr however, was completely intact, as well as /var, /dev, /proc and other lesser directories. I've already just reinstalled my system so it's not really a big deal, I just couldn't figure out what and the hell could have possibly done that. The only thing that should have happened was pcmanfm should have copied my old home directory into /home/pandaman/old/*. It had not finished copying when I got home (was probably 95% there).
Back to top
View user's profile Send private message
BitJam
Advocate
Advocate


Joined: 12 Aug 2003
Posts: 2508
Location: Silver City, NM

PostPosted: Thu Dec 13, 2012 8:56 pm    Post subject: Reply with quote

Were you running pcmanfm as root or as a normal user? If you were running it as a normal user then the problem is probably elsewhere.

Maybe the problem was with "umount /dev/sdd1 -l". It is usually much safer to umount <mountpoint> instead of umount <device> because a little typo usually won't cause a big problem when you use mountpoints.

Also, lazy umounting is usually evil. It is certainly evil in your current case because you ***want*** to wait for the umount command to complete before running shutdown. Even better would have been:
Code:
umount <mountpoint> && poweroff
There is a time and a place for lazy umounting but this was neither the time nor the place.

Also, the umount options are supposed to come before the device or mountpoint. I don't know what happens when they are reversed.

If any log files are available then you might want to look there for suspicious activity during the time you were away. Is it possible someone else had access to the machine while you were gone?

Since /bin ending up missing and umount is in /bin, the umount command is almost certainly the culprit. It would be one heck of a coincidence for /bin to disappear between the time umount ran and poweroff was supposed to run although it is possible that /sbin was removed before /bin got removed.
Back to top
View user's profile Send private message
Pandaman
n00b
n00b


Joined: 30 Jan 2012
Posts: 15

PostPosted: Thu Dec 13, 2012 9:16 pm    Post subject: Reply with quote

BitJam wrote:
Were you running pcmanfm as root or as a normal user? If you were running it as a normal user then the problem is probably elsewhere.

Normal user.... I think.... >.>
BitJam wrote:
Since /bin ending up missing and umount is in /bin, the umount command is almost certainly the culprit. It would be one heck of a coincidence for /bin to disappear between the time umount ran and poweroff was supposed to run although it is possible that /sbin was removed before /bin got removed.

Gah, I suspect I made a dumb mistake there then. Noone had physical access to the machine. It is possible that someone connected remotely to the machine, but they would have to not only know my password but what port I was using for ssh (not 22).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum