Accidental deletion of /lib directory in Fedora 15
Clash Royale CLAN TAG#URR8PPP
I accidentally deleted the /lib directory on my Fedora 15 machine and I'm not sure how to go about fixing this. Any help in figuring out how to restore the directory along with symbolic links would be greatly appreciated.
linux fedora directory symlink rm
add a comment |
I accidentally deleted the /lib directory on my Fedora 15 machine and I'm not sure how to go about fixing this. Any help in figuring out how to restore the directory along with symbolic links would be greatly appreciated.
linux fedora directory symlink rm
1
This is probably non-trivial. It would be easier to back up your data files and reinstall. The only other option is to reinstall the packages which have files in /lib, which is likely to be painful and difficult. Doesyum
still work, for example?
– Faheem Mitha
Dec 9 '11 at 8:14
add a comment |
I accidentally deleted the /lib directory on my Fedora 15 machine and I'm not sure how to go about fixing this. Any help in figuring out how to restore the directory along with symbolic links would be greatly appreciated.
linux fedora directory symlink rm
I accidentally deleted the /lib directory on my Fedora 15 machine and I'm not sure how to go about fixing this. Any help in figuring out how to restore the directory along with symbolic links would be greatly appreciated.
linux fedora directory symlink rm
linux fedora directory symlink rm
asked Dec 9 '11 at 3:41
THE DOCTORTHE DOCTOR
146124
146124
1
This is probably non-trivial. It would be easier to back up your data files and reinstall. The only other option is to reinstall the packages which have files in /lib, which is likely to be painful and difficult. Doesyum
still work, for example?
– Faheem Mitha
Dec 9 '11 at 8:14
add a comment |
1
This is probably non-trivial. It would be easier to back up your data files and reinstall. The only other option is to reinstall the packages which have files in /lib, which is likely to be painful and difficult. Doesyum
still work, for example?
– Faheem Mitha
Dec 9 '11 at 8:14
1
1
This is probably non-trivial. It would be easier to back up your data files and reinstall. The only other option is to reinstall the packages which have files in /lib, which is likely to be painful and difficult. Does
yum
still work, for example?– Faheem Mitha
Dec 9 '11 at 8:14
This is probably non-trivial. It would be easier to back up your data files and reinstall. The only other option is to reinstall the packages which have files in /lib, which is likely to be painful and difficult. Does
yum
still work, for example?– Faheem Mitha
Dec 9 '11 at 8:14
add a comment |
4 Answers
4
active
oldest
votes
/lib is a system directory, will contain the necessary library files installed during installation and later from any additional package installations using rpm or tarballs.
Do you have any backups for the host, Is it on a RAID or LVM partition? For that, the procedure will be different. However /lib is a system directory and its availability in sane mode is essential for the functional running of the host.
I would be keen to suggest to look for a live-cd and boot the system using cd and get into rescue mode. Also, find if there is any machine on the same network with fedora 15 same image installation earlier. If not, setup a machine with fedora 15 same machine seperately. Lets call it a remote machine for sake of the explanation. This remote machine you can use to copy /lib entire structure with symlinks and all exactly using rsync later. Make sure you install the rsync package. Also, make sure you have ssh installed and running on the remote machine with root login allowed.
Note: If you do not have another machine then only alternative is to reinstall the OS with the option of without overwriting any of the Linux installed data. That way, you will ensure that all the local data on the machine post its previous installation is safe and untouched. And do not recreate any partitions. If you do have another machine then proceed next, because this could get your system recovered and make it up and running more earlier.
Once you are done booting off the cd and rescue mode on the local machine, setup the networking and get to know the ipaddresses of the to-rescue machine and from where /lib can be copied.
Identify the /lib partition on the local hard disk. Is it a seperate partition or was mounted from /. Usually it is a directory structure under /, not a seperate partition. If it is directly under / of the root partition of the local disk, make sure you mount root the partition under say /mnt/localroot. Under /mnt/localroot/lib you will find your corrupted /lib tree structure. However, you make sure that you are not using /mnt/localroot but only /mnt/localroot/lib/ only. Be careful with trailing slashes and path.
mkdir /mnt/localroot
mount /dev/sda1 /mnt/localroot
ls -ld /mnt/localroot/lib
From the shell prompt, locate the rsync binary and start pulling the /lib contents from the remote machine to the local mounted lib directory at /mnt/localroot/lib/.
/usr/bin/rsync --delete -avz -e /usr/bin/ssh <remote-machine-ip-address>:/lib/ /mnt/localroot/lib/
Once the sync is complete, run the same rsync command again. After that, restart the system, take out the boot cd and then try booting from grub in normal mode and identify the logs that every service got started properly with out any errors.
add a comment |
If you have another system with a similar Fedora 15 setup, you can boot your system from a livecd, and sync the contents from the other system to repopulate your /lib directory (rsync -avH will do it). Some of your commands may not work then you need to install those packages again.
@THE DOCTOR: I was going to suggest a similar approach. Actually, if you know the list of packages on your system, you can just do a Fedora installation with the same list of packages. This won't work well unless you have a pretty good idea of the list of packages available though. Plus you could use one of the other system directories to make sure that your list of packages matches closely with the original, by doing a binary recursive diff. Perhaps/usr/lib
?
– Faheem Mitha
Dec 9 '11 at 16:48
add a comment |
I would suggest that recovery of the /lib
is the easy angle to take in that case.
so first of all you must stop using the fedora in question, and run on it a live CD with some recovery program like here (it is a good guide), and recover to a separate HD (since you don't want to destroy the potential of the recovery), then after you have the results from one program and is satisfy you copy it back to the fedora in question, if not try another program.
Probably you wouldn't be able to recover every lib file in the directory, but you can install it afterwards.
In case you can't recover, backup any system files that you have changed to your like, and install the Fedora box again with the "Upgrade" option at the installation stage, that would install only the removed files that associate with your base system.
add a comment |
Other answers have explained how to recover your system by rebooting into a live CD/USB. You won't be able to shut down your system cleanly, so press Alt+SysRq+S then Alt+SysRq+U Alt+SysRq+B to unmount filesystems cleanly then directly reboot. There's a small chance that you don't need even that, but that depends on what you have available.
First, you need to be able to execute some process as root. That means having a root shell running, or having a root account with a statically linked shell and a way to log on the console or over ssh. What you can do then will depend on the statically linked tools you have at your disposal. If you have a statically linked mount
(e.g. in sash or from Busybox), you can mount a USB stick or NFS filesystem that contains a copy of lib
from another version of Fedora. If you still happen to have the rpm packages available, reinstall the ones that provide libraries, starting with libc; as far as I know Fedora's rpm
binary is statically linked.
See also Moved bin and other folders! How to get them back?, a different situation but with enough in common that the answers might provide helpful complements.
Magic SysRq key is off in most systems these days.
– Chris Warrick
Jun 8 '13 at 9:32
@Kwpolska Not in my experience, no. Ubuntu enables it by default (some functions are disabled, but not S/U/B), which alone accounts for a lot of systems. Which distribution turns it off?
– Gilles
Jun 8 '13 at 9:47
Arch Linux does, AFAIK.
– Chris Warrick
Jun 8 '13 at 17:38
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f26382%2faccidental-deletion-of-lib-directory-in-fedora-15%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
/lib is a system directory, will contain the necessary library files installed during installation and later from any additional package installations using rpm or tarballs.
Do you have any backups for the host, Is it on a RAID or LVM partition? For that, the procedure will be different. However /lib is a system directory and its availability in sane mode is essential for the functional running of the host.
I would be keen to suggest to look for a live-cd and boot the system using cd and get into rescue mode. Also, find if there is any machine on the same network with fedora 15 same image installation earlier. If not, setup a machine with fedora 15 same machine seperately. Lets call it a remote machine for sake of the explanation. This remote machine you can use to copy /lib entire structure with symlinks and all exactly using rsync later. Make sure you install the rsync package. Also, make sure you have ssh installed and running on the remote machine with root login allowed.
Note: If you do not have another machine then only alternative is to reinstall the OS with the option of without overwriting any of the Linux installed data. That way, you will ensure that all the local data on the machine post its previous installation is safe and untouched. And do not recreate any partitions. If you do have another machine then proceed next, because this could get your system recovered and make it up and running more earlier.
Once you are done booting off the cd and rescue mode on the local machine, setup the networking and get to know the ipaddresses of the to-rescue machine and from where /lib can be copied.
Identify the /lib partition on the local hard disk. Is it a seperate partition or was mounted from /. Usually it is a directory structure under /, not a seperate partition. If it is directly under / of the root partition of the local disk, make sure you mount root the partition under say /mnt/localroot. Under /mnt/localroot/lib you will find your corrupted /lib tree structure. However, you make sure that you are not using /mnt/localroot but only /mnt/localroot/lib/ only. Be careful with trailing slashes and path.
mkdir /mnt/localroot
mount /dev/sda1 /mnt/localroot
ls -ld /mnt/localroot/lib
From the shell prompt, locate the rsync binary and start pulling the /lib contents from the remote machine to the local mounted lib directory at /mnt/localroot/lib/.
/usr/bin/rsync --delete -avz -e /usr/bin/ssh <remote-machine-ip-address>:/lib/ /mnt/localroot/lib/
Once the sync is complete, run the same rsync command again. After that, restart the system, take out the boot cd and then try booting from grub in normal mode and identify the logs that every service got started properly with out any errors.
add a comment |
/lib is a system directory, will contain the necessary library files installed during installation and later from any additional package installations using rpm or tarballs.
Do you have any backups for the host, Is it on a RAID or LVM partition? For that, the procedure will be different. However /lib is a system directory and its availability in sane mode is essential for the functional running of the host.
I would be keen to suggest to look for a live-cd and boot the system using cd and get into rescue mode. Also, find if there is any machine on the same network with fedora 15 same image installation earlier. If not, setup a machine with fedora 15 same machine seperately. Lets call it a remote machine for sake of the explanation. This remote machine you can use to copy /lib entire structure with symlinks and all exactly using rsync later. Make sure you install the rsync package. Also, make sure you have ssh installed and running on the remote machine with root login allowed.
Note: If you do not have another machine then only alternative is to reinstall the OS with the option of without overwriting any of the Linux installed data. That way, you will ensure that all the local data on the machine post its previous installation is safe and untouched. And do not recreate any partitions. If you do have another machine then proceed next, because this could get your system recovered and make it up and running more earlier.
Once you are done booting off the cd and rescue mode on the local machine, setup the networking and get to know the ipaddresses of the to-rescue machine and from where /lib can be copied.
Identify the /lib partition on the local hard disk. Is it a seperate partition or was mounted from /. Usually it is a directory structure under /, not a seperate partition. If it is directly under / of the root partition of the local disk, make sure you mount root the partition under say /mnt/localroot. Under /mnt/localroot/lib you will find your corrupted /lib tree structure. However, you make sure that you are not using /mnt/localroot but only /mnt/localroot/lib/ only. Be careful with trailing slashes and path.
mkdir /mnt/localroot
mount /dev/sda1 /mnt/localroot
ls -ld /mnt/localroot/lib
From the shell prompt, locate the rsync binary and start pulling the /lib contents from the remote machine to the local mounted lib directory at /mnt/localroot/lib/.
/usr/bin/rsync --delete -avz -e /usr/bin/ssh <remote-machine-ip-address>:/lib/ /mnt/localroot/lib/
Once the sync is complete, run the same rsync command again. After that, restart the system, take out the boot cd and then try booting from grub in normal mode and identify the logs that every service got started properly with out any errors.
add a comment |
/lib is a system directory, will contain the necessary library files installed during installation and later from any additional package installations using rpm or tarballs.
Do you have any backups for the host, Is it on a RAID or LVM partition? For that, the procedure will be different. However /lib is a system directory and its availability in sane mode is essential for the functional running of the host.
I would be keen to suggest to look for a live-cd and boot the system using cd and get into rescue mode. Also, find if there is any machine on the same network with fedora 15 same image installation earlier. If not, setup a machine with fedora 15 same machine seperately. Lets call it a remote machine for sake of the explanation. This remote machine you can use to copy /lib entire structure with symlinks and all exactly using rsync later. Make sure you install the rsync package. Also, make sure you have ssh installed and running on the remote machine with root login allowed.
Note: If you do not have another machine then only alternative is to reinstall the OS with the option of without overwriting any of the Linux installed data. That way, you will ensure that all the local data on the machine post its previous installation is safe and untouched. And do not recreate any partitions. If you do have another machine then proceed next, because this could get your system recovered and make it up and running more earlier.
Once you are done booting off the cd and rescue mode on the local machine, setup the networking and get to know the ipaddresses of the to-rescue machine and from where /lib can be copied.
Identify the /lib partition on the local hard disk. Is it a seperate partition or was mounted from /. Usually it is a directory structure under /, not a seperate partition. If it is directly under / of the root partition of the local disk, make sure you mount root the partition under say /mnt/localroot. Under /mnt/localroot/lib you will find your corrupted /lib tree structure. However, you make sure that you are not using /mnt/localroot but only /mnt/localroot/lib/ only. Be careful with trailing slashes and path.
mkdir /mnt/localroot
mount /dev/sda1 /mnt/localroot
ls -ld /mnt/localroot/lib
From the shell prompt, locate the rsync binary and start pulling the /lib contents from the remote machine to the local mounted lib directory at /mnt/localroot/lib/.
/usr/bin/rsync --delete -avz -e /usr/bin/ssh <remote-machine-ip-address>:/lib/ /mnt/localroot/lib/
Once the sync is complete, run the same rsync command again. After that, restart the system, take out the boot cd and then try booting from grub in normal mode and identify the logs that every service got started properly with out any errors.
/lib is a system directory, will contain the necessary library files installed during installation and later from any additional package installations using rpm or tarballs.
Do you have any backups for the host, Is it on a RAID or LVM partition? For that, the procedure will be different. However /lib is a system directory and its availability in sane mode is essential for the functional running of the host.
I would be keen to suggest to look for a live-cd and boot the system using cd and get into rescue mode. Also, find if there is any machine on the same network with fedora 15 same image installation earlier. If not, setup a machine with fedora 15 same machine seperately. Lets call it a remote machine for sake of the explanation. This remote machine you can use to copy /lib entire structure with symlinks and all exactly using rsync later. Make sure you install the rsync package. Also, make sure you have ssh installed and running on the remote machine with root login allowed.
Note: If you do not have another machine then only alternative is to reinstall the OS with the option of without overwriting any of the Linux installed data. That way, you will ensure that all the local data on the machine post its previous installation is safe and untouched. And do not recreate any partitions. If you do have another machine then proceed next, because this could get your system recovered and make it up and running more earlier.
Once you are done booting off the cd and rescue mode on the local machine, setup the networking and get to know the ipaddresses of the to-rescue machine and from where /lib can be copied.
Identify the /lib partition on the local hard disk. Is it a seperate partition or was mounted from /. Usually it is a directory structure under /, not a seperate partition. If it is directly under / of the root partition of the local disk, make sure you mount root the partition under say /mnt/localroot. Under /mnt/localroot/lib you will find your corrupted /lib tree structure. However, you make sure that you are not using /mnt/localroot but only /mnt/localroot/lib/ only. Be careful with trailing slashes and path.
mkdir /mnt/localroot
mount /dev/sda1 /mnt/localroot
ls -ld /mnt/localroot/lib
From the shell prompt, locate the rsync binary and start pulling the /lib contents from the remote machine to the local mounted lib directory at /mnt/localroot/lib/.
/usr/bin/rsync --delete -avz -e /usr/bin/ssh <remote-machine-ip-address>:/lib/ /mnt/localroot/lib/
Once the sync is complete, run the same rsync command again. After that, restart the system, take out the boot cd and then try booting from grub in normal mode and identify the logs that every service got started properly with out any errors.
answered Dec 9 '11 at 9:39
Nikhil MulleyNikhil Mulley
6,3472245
6,3472245
add a comment |
add a comment |
If you have another system with a similar Fedora 15 setup, you can boot your system from a livecd, and sync the contents from the other system to repopulate your /lib directory (rsync -avH will do it). Some of your commands may not work then you need to install those packages again.
@THE DOCTOR: I was going to suggest a similar approach. Actually, if you know the list of packages on your system, you can just do a Fedora installation with the same list of packages. This won't work well unless you have a pretty good idea of the list of packages available though. Plus you could use one of the other system directories to make sure that your list of packages matches closely with the original, by doing a binary recursive diff. Perhaps/usr/lib
?
– Faheem Mitha
Dec 9 '11 at 16:48
add a comment |
If you have another system with a similar Fedora 15 setup, you can boot your system from a livecd, and sync the contents from the other system to repopulate your /lib directory (rsync -avH will do it). Some of your commands may not work then you need to install those packages again.
@THE DOCTOR: I was going to suggest a similar approach. Actually, if you know the list of packages on your system, you can just do a Fedora installation with the same list of packages. This won't work well unless you have a pretty good idea of the list of packages available though. Plus you could use one of the other system directories to make sure that your list of packages matches closely with the original, by doing a binary recursive diff. Perhaps/usr/lib
?
– Faheem Mitha
Dec 9 '11 at 16:48
add a comment |
If you have another system with a similar Fedora 15 setup, you can boot your system from a livecd, and sync the contents from the other system to repopulate your /lib directory (rsync -avH will do it). Some of your commands may not work then you need to install those packages again.
If you have another system with a similar Fedora 15 setup, you can boot your system from a livecd, and sync the contents from the other system to repopulate your /lib directory (rsync -avH will do it). Some of your commands may not work then you need to install those packages again.
edited Dec 9 '11 at 9:59
answered Dec 9 '11 at 9:04
Sachin DivekarSachin Divekar
3,89811719
3,89811719
@THE DOCTOR: I was going to suggest a similar approach. Actually, if you know the list of packages on your system, you can just do a Fedora installation with the same list of packages. This won't work well unless you have a pretty good idea of the list of packages available though. Plus you could use one of the other system directories to make sure that your list of packages matches closely with the original, by doing a binary recursive diff. Perhaps/usr/lib
?
– Faheem Mitha
Dec 9 '11 at 16:48
add a comment |
@THE DOCTOR: I was going to suggest a similar approach. Actually, if you know the list of packages on your system, you can just do a Fedora installation with the same list of packages. This won't work well unless you have a pretty good idea of the list of packages available though. Plus you could use one of the other system directories to make sure that your list of packages matches closely with the original, by doing a binary recursive diff. Perhaps/usr/lib
?
– Faheem Mitha
Dec 9 '11 at 16:48
@THE DOCTOR: I was going to suggest a similar approach. Actually, if you know the list of packages on your system, you can just do a Fedora installation with the same list of packages. This won't work well unless you have a pretty good idea of the list of packages available though. Plus you could use one of the other system directories to make sure that your list of packages matches closely with the original, by doing a binary recursive diff. Perhaps
/usr/lib
?– Faheem Mitha
Dec 9 '11 at 16:48
@THE DOCTOR: I was going to suggest a similar approach. Actually, if you know the list of packages on your system, you can just do a Fedora installation with the same list of packages. This won't work well unless you have a pretty good idea of the list of packages available though. Plus you could use one of the other system directories to make sure that your list of packages matches closely with the original, by doing a binary recursive diff. Perhaps
/usr/lib
?– Faheem Mitha
Dec 9 '11 at 16:48
add a comment |
I would suggest that recovery of the /lib
is the easy angle to take in that case.
so first of all you must stop using the fedora in question, and run on it a live CD with some recovery program like here (it is a good guide), and recover to a separate HD (since you don't want to destroy the potential of the recovery), then after you have the results from one program and is satisfy you copy it back to the fedora in question, if not try another program.
Probably you wouldn't be able to recover every lib file in the directory, but you can install it afterwards.
In case you can't recover, backup any system files that you have changed to your like, and install the Fedora box again with the "Upgrade" option at the installation stage, that would install only the removed files that associate with your base system.
add a comment |
I would suggest that recovery of the /lib
is the easy angle to take in that case.
so first of all you must stop using the fedora in question, and run on it a live CD with some recovery program like here (it is a good guide), and recover to a separate HD (since you don't want to destroy the potential of the recovery), then after you have the results from one program and is satisfy you copy it back to the fedora in question, if not try another program.
Probably you wouldn't be able to recover every lib file in the directory, but you can install it afterwards.
In case you can't recover, backup any system files that you have changed to your like, and install the Fedora box again with the "Upgrade" option at the installation stage, that would install only the removed files that associate with your base system.
add a comment |
I would suggest that recovery of the /lib
is the easy angle to take in that case.
so first of all you must stop using the fedora in question, and run on it a live CD with some recovery program like here (it is a good guide), and recover to a separate HD (since you don't want to destroy the potential of the recovery), then after you have the results from one program and is satisfy you copy it back to the fedora in question, if not try another program.
Probably you wouldn't be able to recover every lib file in the directory, but you can install it afterwards.
In case you can't recover, backup any system files that you have changed to your like, and install the Fedora box again with the "Upgrade" option at the installation stage, that would install only the removed files that associate with your base system.
I would suggest that recovery of the /lib
is the easy angle to take in that case.
so first of all you must stop using the fedora in question, and run on it a live CD with some recovery program like here (it is a good guide), and recover to a separate HD (since you don't want to destroy the potential of the recovery), then after you have the results from one program and is satisfy you copy it back to the fedora in question, if not try another program.
Probably you wouldn't be able to recover every lib file in the directory, but you can install it afterwards.
In case you can't recover, backup any system files that you have changed to your like, and install the Fedora box again with the "Upgrade" option at the installation stage, that would install only the removed files that associate with your base system.
answered Dec 9 '11 at 12:17
Hanan N.Hanan N.
3,67632028
3,67632028
add a comment |
add a comment |
Other answers have explained how to recover your system by rebooting into a live CD/USB. You won't be able to shut down your system cleanly, so press Alt+SysRq+S then Alt+SysRq+U Alt+SysRq+B to unmount filesystems cleanly then directly reboot. There's a small chance that you don't need even that, but that depends on what you have available.
First, you need to be able to execute some process as root. That means having a root shell running, or having a root account with a statically linked shell and a way to log on the console or over ssh. What you can do then will depend on the statically linked tools you have at your disposal. If you have a statically linked mount
(e.g. in sash or from Busybox), you can mount a USB stick or NFS filesystem that contains a copy of lib
from another version of Fedora. If you still happen to have the rpm packages available, reinstall the ones that provide libraries, starting with libc; as far as I know Fedora's rpm
binary is statically linked.
See also Moved bin and other folders! How to get them back?, a different situation but with enough in common that the answers might provide helpful complements.
Magic SysRq key is off in most systems these days.
– Chris Warrick
Jun 8 '13 at 9:32
@Kwpolska Not in my experience, no. Ubuntu enables it by default (some functions are disabled, but not S/U/B), which alone accounts for a lot of systems. Which distribution turns it off?
– Gilles
Jun 8 '13 at 9:47
Arch Linux does, AFAIK.
– Chris Warrick
Jun 8 '13 at 17:38
add a comment |
Other answers have explained how to recover your system by rebooting into a live CD/USB. You won't be able to shut down your system cleanly, so press Alt+SysRq+S then Alt+SysRq+U Alt+SysRq+B to unmount filesystems cleanly then directly reboot. There's a small chance that you don't need even that, but that depends on what you have available.
First, you need to be able to execute some process as root. That means having a root shell running, or having a root account with a statically linked shell and a way to log on the console or over ssh. What you can do then will depend on the statically linked tools you have at your disposal. If you have a statically linked mount
(e.g. in sash or from Busybox), you can mount a USB stick or NFS filesystem that contains a copy of lib
from another version of Fedora. If you still happen to have the rpm packages available, reinstall the ones that provide libraries, starting with libc; as far as I know Fedora's rpm
binary is statically linked.
See also Moved bin and other folders! How to get them back?, a different situation but with enough in common that the answers might provide helpful complements.
Magic SysRq key is off in most systems these days.
– Chris Warrick
Jun 8 '13 at 9:32
@Kwpolska Not in my experience, no. Ubuntu enables it by default (some functions are disabled, but not S/U/B), which alone accounts for a lot of systems. Which distribution turns it off?
– Gilles
Jun 8 '13 at 9:47
Arch Linux does, AFAIK.
– Chris Warrick
Jun 8 '13 at 17:38
add a comment |
Other answers have explained how to recover your system by rebooting into a live CD/USB. You won't be able to shut down your system cleanly, so press Alt+SysRq+S then Alt+SysRq+U Alt+SysRq+B to unmount filesystems cleanly then directly reboot. There's a small chance that you don't need even that, but that depends on what you have available.
First, you need to be able to execute some process as root. That means having a root shell running, or having a root account with a statically linked shell and a way to log on the console or over ssh. What you can do then will depend on the statically linked tools you have at your disposal. If you have a statically linked mount
(e.g. in sash or from Busybox), you can mount a USB stick or NFS filesystem that contains a copy of lib
from another version of Fedora. If you still happen to have the rpm packages available, reinstall the ones that provide libraries, starting with libc; as far as I know Fedora's rpm
binary is statically linked.
See also Moved bin and other folders! How to get them back?, a different situation but with enough in common that the answers might provide helpful complements.
Other answers have explained how to recover your system by rebooting into a live CD/USB. You won't be able to shut down your system cleanly, so press Alt+SysRq+S then Alt+SysRq+U Alt+SysRq+B to unmount filesystems cleanly then directly reboot. There's a small chance that you don't need even that, but that depends on what you have available.
First, you need to be able to execute some process as root. That means having a root shell running, or having a root account with a statically linked shell and a way to log on the console or over ssh. What you can do then will depend on the statically linked tools you have at your disposal. If you have a statically linked mount
(e.g. in sash or from Busybox), you can mount a USB stick or NFS filesystem that contains a copy of lib
from another version of Fedora. If you still happen to have the rpm packages available, reinstall the ones that provide libraries, starting with libc; as far as I know Fedora's rpm
binary is statically linked.
See also Moved bin and other folders! How to get them back?, a different situation but with enough in common that the answers might provide helpful complements.
edited Apr 13 '17 at 12:36
Community♦
1
1
answered Dec 10 '11 at 1:43
GillesGilles
534k12810791596
534k12810791596
Magic SysRq key is off in most systems these days.
– Chris Warrick
Jun 8 '13 at 9:32
@Kwpolska Not in my experience, no. Ubuntu enables it by default (some functions are disabled, but not S/U/B), which alone accounts for a lot of systems. Which distribution turns it off?
– Gilles
Jun 8 '13 at 9:47
Arch Linux does, AFAIK.
– Chris Warrick
Jun 8 '13 at 17:38
add a comment |
Magic SysRq key is off in most systems these days.
– Chris Warrick
Jun 8 '13 at 9:32
@Kwpolska Not in my experience, no. Ubuntu enables it by default (some functions are disabled, but not S/U/B), which alone accounts for a lot of systems. Which distribution turns it off?
– Gilles
Jun 8 '13 at 9:47
Arch Linux does, AFAIK.
– Chris Warrick
Jun 8 '13 at 17:38
Magic SysRq key is off in most systems these days.
– Chris Warrick
Jun 8 '13 at 9:32
Magic SysRq key is off in most systems these days.
– Chris Warrick
Jun 8 '13 at 9:32
@Kwpolska Not in my experience, no. Ubuntu enables it by default (some functions are disabled, but not S/U/B), which alone accounts for a lot of systems. Which distribution turns it off?
– Gilles
Jun 8 '13 at 9:47
@Kwpolska Not in my experience, no. Ubuntu enables it by default (some functions are disabled, but not S/U/B), which alone accounts for a lot of systems. Which distribution turns it off?
– Gilles
Jun 8 '13 at 9:47
Arch Linux does, AFAIK.
– Chris Warrick
Jun 8 '13 at 17:38
Arch Linux does, AFAIK.
– Chris Warrick
Jun 8 '13 at 17:38
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f26382%2faccidental-deletion-of-lib-directory-in-fedora-15%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
This is probably non-trivial. It would be easier to back up your data files and reinstall. The only other option is to reinstall the packages which have files in /lib, which is likely to be painful and difficult. Does
yum
still work, for example?– Faheem Mitha
Dec 9 '11 at 8:14