Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Well I don't know exactly which files I've accidentally deleted. I was running a livecd and mounted the ubuntu system in a file called mp. When I was done accessing the content of the hard drive, I stupidly thought I'd close it using rm mp. I had forgotten the correct way was using umount. It took me a second or maybe two to realize my error (perhaps the time it took me was the time for me to understand that this command was taking too long to return), and I then urgently pressed ctrl c.
If rm works in a deterministic and sorted way, maybe there's a way to know where it started and where it stopped (since I obviously haven't made any modifications to the system ever since). /home/me doesn't seem affected.
The results of the ls's you asked are:
root@bt:~# ls /mnt/ubuntu/
bin dev initrd.img lost+found opt sbin sys var
boot etc initrd.img.old media proc selinux tmp vmlinuz
cdrom home lib mnt root srv usr vmlinuz.old
root@bt:~# ls /mnt/ubuntu/bin/
bash dumpkeys mountpoint sh
bunzip2 echo mt sh.distrib
busybox ed mt-gnu sleep
bzcat egrep mv static-sh
bzcmp false nano stty
bzdiff fgconsole nc su
bzegrep fgrep nc.openbsd sync
bzexe fuser nc.traditional tailf
bzfgrep fusermount netcat tar
bzgrep grep netstat tempfile
bzip2 gunzip nisdomainname touch
bzip2recover gzexe ntfs-3g true
bzless gzip ntfs-3g.probe ulockmgr_server
bzmore hostname ntfs-3g.secaudit umount
cat ip ntfs-3g.usermap uname
chgrp kbd_mode open uncompress
chmod kill openvt unicode_start
chown less pidof vdir
chvt lessecho ping which
cp lessfile ping6 ypdomainname
cpio lesskey plymouth zcat
dash lesspipe ps zcmp
date ln pwd zdiff
dbus-cleanup-sockets loadkeys rbash zegrep
dbus-daemon login readlink zfgrep
dbus-uuidgen ls rm zforce
dd lsmod rmdir zgrep
df mkdir rnano zless
dir mknod run-parts zmore
dmesg mktemp sed znew
dnsdomainname more setfont
domainname mount setupcon
I think after one day of trials to repair your system you should consider a complete new install. I think you don't have enough experience to repair the system. Do you have a separate partition for your /home directory? do you have packages installed which are not from the repository? would it be much efford for you to configure your system after a reinstallation?
Think about this questions, a complete new install is done within 10 Minutes plus the time for the configuration.
I don't have a separate partition for the /home directory. From what I could explore after the incident, I have no reason to believe that any personal file was deleted (the /rm really just lasted a second or two, and it's a slow computer). I don't quite remember if I have packages that are not from the main repository, but I do remember spending a lot of time installing and configuring some of them. So yes, it would be a huge effort to reconfigure my system.
On the other hand, I hope that professionals like you will be able to help me to repair the system and at least boot from it.
The question about the separate /home partition was because if you do a complete new install, you'll have to save your personal data anywhere outside the partition since it will be reformatted.
One thing you can do is to perform an installation to the same partition where you Linux resides now but without formatting the partition. I don't have any experience with the Ubuntu-installer, so I don't know if this will be possible (it surely is possible, but you'll have to find your way around it).
If you do a reinstallation in the same partition without reformatting you'll have a similar situation as was described above when you wanted to do a chroot into your system and then use apt-get. The things which are there are overwritten with the same data and the things which you have deleted will be newly installed.
One other thing you could try is to do a chroot, but without the "/bin/bash" command at the end of the chroot commandline. Maybe that works.
hm, good thing /home isn't named /a_home
but moving it to separate partition is easy, just copy it..
I am not sure, but maybe simply copying some commands (from LiveCD or similar) to damaged /bin/ would work.
I once managed to run few simple binaries/commands from Debian in DamnSmallLinux and they run great (as long as they were 32bit, of course).
Forgive me but I still don't understand why sudo chroot /mnt/ubuntu/ /bin/bash returns:
chroot: cannot run command `/bin/bash': No such file or directory
There is a /bin/bash directory in the live cd, and "bash" is autocompleted. So how come I receive this error, and how come this chroot command doesn't work ? Maybe if we fixed that we could fix the whole issue ?
I don't also understand this issue, your output of ls /mnt/ubuntu/bin showed that bash is there. You could mount your partition (as above to /mnt/ubuntu) and then change into the directory /mnt/ubuntu/bin and then execute
which is the same bash-shell which doesn't work when you want to chroot. Maybe you get some errormessages which point you to the real problem.