特殊:Badtitle/NS100:LiveCdRecovery
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/LiveCdRecovery }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/af | • {{#if: UbuntuHelp:LiveCdRecovery|Afrikaans| [[::LiveCdRecovery/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/ar | • {{#if: UbuntuHelp:LiveCdRecovery|العربية| [[::LiveCdRecovery/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/az | • {{#if: UbuntuHelp:LiveCdRecovery|azərbaycanca| [[::LiveCdRecovery/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/bcc | • {{#if: UbuntuHelp:LiveCdRecovery|جهلسری بلوچی| [[::LiveCdRecovery/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/bg | • {{#if: UbuntuHelp:LiveCdRecovery|български| [[::LiveCdRecovery/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/br | • {{#if: UbuntuHelp:LiveCdRecovery|brezhoneg| [[::LiveCdRecovery/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/ca | • {{#if: UbuntuHelp:LiveCdRecovery|català| [[::LiveCdRecovery/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/cs | • {{#if: UbuntuHelp:LiveCdRecovery|čeština| [[::LiveCdRecovery/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/de | • {{#if: UbuntuHelp:LiveCdRecovery|Deutsch| [[::LiveCdRecovery/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/el | • {{#if: UbuntuHelp:LiveCdRecovery|Ελληνικά| [[::LiveCdRecovery/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/es | • {{#if: UbuntuHelp:LiveCdRecovery|español| [[::LiveCdRecovery/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/fa | • {{#if: UbuntuHelp:LiveCdRecovery|فارسی| [[::LiveCdRecovery/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/fi | • {{#if: UbuntuHelp:LiveCdRecovery|suomi| [[::LiveCdRecovery/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/fr | • {{#if: UbuntuHelp:LiveCdRecovery|français| [[::LiveCdRecovery/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/gu | • {{#if: UbuntuHelp:LiveCdRecovery|ગુજરાતી| [[::LiveCdRecovery/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/he | • {{#if: UbuntuHelp:LiveCdRecovery|עברית| [[::LiveCdRecovery/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/hu | • {{#if: UbuntuHelp:LiveCdRecovery|magyar| [[::LiveCdRecovery/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/id | • {{#if: UbuntuHelp:LiveCdRecovery|Bahasa Indonesia| [[::LiveCdRecovery/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/it | • {{#if: UbuntuHelp:LiveCdRecovery|italiano| [[::LiveCdRecovery/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/ja | • {{#if: UbuntuHelp:LiveCdRecovery|日本語| [[::LiveCdRecovery/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/ko | • {{#if: UbuntuHelp:LiveCdRecovery|한국어| [[::LiveCdRecovery/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/ksh | • {{#if: UbuntuHelp:LiveCdRecovery|Ripoarisch| [[::LiveCdRecovery/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/mr | • {{#if: UbuntuHelp:LiveCdRecovery|मराठी| [[::LiveCdRecovery/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/ms | • {{#if: UbuntuHelp:LiveCdRecovery|Bahasa Melayu| [[::LiveCdRecovery/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/nl | • {{#if: UbuntuHelp:LiveCdRecovery|Nederlands| [[::LiveCdRecovery/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/no | • {{#if: UbuntuHelp:LiveCdRecovery|norsk| [[::LiveCdRecovery/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/oc | • {{#if: UbuntuHelp:LiveCdRecovery|occitan| [[::LiveCdRecovery/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/pl | • {{#if: UbuntuHelp:LiveCdRecovery|polski| [[::LiveCdRecovery/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/pt | • {{#if: UbuntuHelp:LiveCdRecovery|português| [[::LiveCdRecovery/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/ro | • {{#if: UbuntuHelp:LiveCdRecovery|română| [[::LiveCdRecovery/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/ru | • {{#if: UbuntuHelp:LiveCdRecovery|русский| [[::LiveCdRecovery/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/si | • {{#if: UbuntuHelp:LiveCdRecovery|සිංහල| [[::LiveCdRecovery/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/sq | • {{#if: UbuntuHelp:LiveCdRecovery|shqip| [[::LiveCdRecovery/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/sr | • {{#if: UbuntuHelp:LiveCdRecovery|српски / srpski| [[::LiveCdRecovery/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/sv | • {{#if: UbuntuHelp:LiveCdRecovery|svenska| [[::LiveCdRecovery/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/th | • {{#if: UbuntuHelp:LiveCdRecovery|ไทย| [[::LiveCdRecovery/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/tr | • {{#if: UbuntuHelp:LiveCdRecovery|Türkçe| [[::LiveCdRecovery/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/vi | • {{#if: UbuntuHelp:LiveCdRecovery|Tiếng Việt| [[::LiveCdRecovery/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/yue | • {{#if: UbuntuHelp:LiveCdRecovery|粵語| [[::LiveCdRecovery/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/zh | • {{#if: UbuntuHelp:LiveCdRecovery|中文| [[::LiveCdRecovery/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/zh-hans | • {{#if: UbuntuHelp:LiveCdRecovery|中文(简体)| [[::LiveCdRecovery/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LiveCdRecovery | UbuntuHelp:LiveCdRecovery | {{#if: | :}}LiveCdRecovery}}/zh-hant | • {{#if: UbuntuHelp:LiveCdRecovery|中文(繁體)| [[::LiveCdRecovery/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:LiveCdRecovery|:LiveCdRecovery|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :LiveCdRecovery/zh | | {{#ifexist: LiveCdRecovery/zh | | {{#ifeq: {{#titleparts:LiveCdRecovery|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:LiveCdRecovery|1|-1|}} | zh | | }}
This page describes methods for using the Ubuntu Live CD for recovering from different kinds of problems. If you do not have an Ubuntu disk, please refer to GettingUbuntu.
Lost Password
Here is how you can use the Live CD to change the administrative password on your machine if you have lost/forgot the current password. Note that you can usually just boot into "Recovery Mode" and run the `passwd` command directly. 0. Boot the Ubuntu Live CD. 0. Press `Ctrl-Alt-F1` 0. `sudo mount /dev/hda1 /mnt` 0. Depending on your machine it could also be `sudo mount /dev/sda1 /mnt`. If you created a custom partition layout when installing Ubuntu you have to find your root partition using the `fdisk` utility. See the section `Finding your root partition`. 0. `sudo chroot /mnt` You can now use the `passwd` command to reset a password. Note: In the `mount` command, `/dev/hda1` will need to be replaced with the partition where the root of the file system resides.
Add User to a Group
Note that you can simply boot into "Recovery Mode" and run the `adduser` command directly. 0. Boot the Ubuntu Live CD. 0. Press `Ctrl-Alt-F1` 0. `sudo mount /dev/hda1 /mnt` 0. `sudo chroot /mnt` 0. `adduser username groupname`
Update Failure
If there was an update that made your system non-bootable and they have fixed it in the repositories, you can use the Live CD to run apt-get to get the new files to fix your system. 0. Boot the Ubuntu Live CD. 0. Press `Ctrl-Alt-F1` 0. `sudo mount /dev/hda1 /mnt` 0. `sudo chroot /mnt` 0. `apt-get update` 0. `apt-get upgrade`
Finding your root partition
If you created a custom partition layout during the Ubuntu installation, your root partition is probably not /dev/hda1 or /dev/sda1. If you do not know which partition corresponds to your root partition you can use the following procedure to find your root partition. We assume you have booted the live cd and are at the terminal.
- If you are not using a software raid setup or have setup your partitions using LVM/2 or EVMS your IDE/SATA/SCSI devices should be accessible through the files /dev/hd[a-z] and /dev/sd[a-z]. /dev/hda corresponds to the primary master device on your IDE bus, while /dev/sda is your first SCSI/SATA device. If you are using software raid, LVM, LVM2 or EVMS, your devices may be listed in the following directories:
/dev/evms/dm if you are using software raid /dev/evms/lvm if you are using LVM /dev/evms/lvm2 if you are using LVM2 /dev/evms if you are using EVMS
with their device (software raid) or partition name. You can learn more about Linux partitions here: http://tldp.org/HOWTO/Partition
2. Now use the fdisk utility to list the partitions on a device. Let's assume that you installed Ubuntu to the fist IDE disk. Type the following:
sudo fdisk -l /dev/hda
This will produce some output like this:
Password: Disk /dev/hda: 120.0 GB, 120034123776 bytes 16 heads, 63 sectors/track, 232581 cylinders Units == cylinders of 1008 * 512 == 516096 bytes Device Boot Start End Blocks Id System /dev/hda1 * 1 13206 6655792+ 7 HPFS/NTFS /dev/hda2 13207 232581 110565000 5 Extended /dev/hda5 228706 232484 1904616 82 Linux swap / Solaris /dev/hda6 13207 228705 108611464+ 83 Linux /dev/hda7 232485 232581 48856+ 83 Linux Partition table entries are not in disk order
That means you have two standard Linux partitions on your disk: /dev/hda6 and /dev/hda7
. You can now try to mount them and see if your Ubuntu installation is there. In this case /dev/hda7
is probably not the root partition, because it is only about 50MiB in size (see the Blocks column). Therefore we mount /dev/hda6:
sudo mount /dev/hda6 /mnt
Now show the files on the partition:
ls /mnt
If this command shows something like:
bin dev home media proc sbin tmp var boot etc lib opt root sys usr
it is a partition holding a Linux distribution. You can check if it really is Ubuntu (if you have multiple linux installations on your disk) using the following command:
cat /mnt/etc/lsb-release
That will give you some information about the distribution (if this file does not exist, it is probably not Ubuntu). If it is the wrong partition, just unmount it: sudo umount /mnt
and try another partition on the same disk or choose a different partition on another disk (using fdisk as before).
Recover Grub
If you install some other system and lose the grub. 0. Boot the Ubuntu Live CD. 0. Press `Ctrl-Alt-F1` 0. Find the partition where your /boot directory is (normally the root partition) check the previous tip for that. 0. `sudo mount /dev/hda1 /mnt` 0. `sudo chroot /mnt` 0. `grub` 0. `find /boot/grub/stage1` (will output a partition name like (hd0,3) ) 0. `root (hd0,3)` 0. `setup (hd0)` 0. `quit` 0. Now restart the system and remove the Live CD