个人工具
104.160.18.24
该IP地址的讨论
登录
查看“UbuntuHelp:LiveCdRecovery”的源代码 - Ubuntu中文
UbuntuHelp
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“UbuntuHelp:LiveCdRecovery”的源代码
来自Ubuntu中文
←
UbuntuHelp:LiveCdRecovery
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{From|https://help.ubuntu.com/community/LiveCdRecovery}} {{Languages|UbuntuHelp:LiveCdRecovery}} 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 [[UbuntuHelp:GettingUbuntu|GettingUbuntu]]. If you have any issues booting the [[UbuntuHelp:LiveCD|LiveCD]], please have a look at the [[BootFromCD]] page. Most of the methods described below can also be used from [[UbuntuHelp:RecoveryMode|RecoveryMode]] === 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. Please note that you can usually boot into [[UbuntuHelp:RecoveryMode|RecoveryMode]] and run the `passwd` command directly. <ol><li>Boot the Ubuntu Live CD. </li><li>Press `Ctrl-Alt-F1` </li><li>`sudo mount /dev/hda1 /mnt` </li><li>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`. </li><li>`sudo chroot /mnt`</li></ol> 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 === If you have removed yourself from a group, you can use the following to add yourself again. Please note that you can usually use [[UbuntuHelp:RecoveryMode|RecoveryMode]] and run the `adduser` command directly. <ol><li>Boot the Ubuntu Live CD. </li><li>Press `Ctrl-Alt-F1` </li><li>`sudo mount /dev/hda1 /mnt` </li><li>`sudo chroot /mnt` </li><li>`adduser username groupname`</li></ol> === 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. <ol><li>Boot the Ubuntu Live CD. </li><li>Press `Ctrl-Alt-F1` </li><li>`sudo mount /dev/hda1 /mnt` </li><li>`sudo chroot /mnt` </li><li>`apt-get update` </li><li>`apt-get upgrade`</li></ol> === 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. <ol><li>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: <pre><nowiki> /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 </nowiki></pre> with their device (software raid) or partition name. You can learn more about Linux partitions here: http://tldp.org/HOWTO/Partition </li><li>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: <pre><nowiki> sudo fdisk -l /dev/hda</nowiki></pre></li></ol> This will produce some output like this: <pre><nowiki> 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 </nowiki></pre> That means you have two standard Linux partitions on your disk: <code><nowiki>/dev/hda6 and /dev/hda7</nowiki></code>. You can now try to mount them and see if your Ubuntu installation is there. In this case <code><nowiki>/dev/hda7</nowiki></code> is probably not the root partition, because it is only about 50MiB in size (see the Blocks column). Therefore we mount /dev/hda6: <pre><nowiki> sudo mount /dev/hda6 /mnt</nowiki></pre> Now show the files on the partition: <pre><nowiki> ls /mnt</nowiki></pre> If this command shows something like: <pre><nowiki> bin dev home media proc sbin tmp var boot etc lib opt root sys usr </nowiki></pre> 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: <pre><nowiki> cat /mnt/etc/lsb-release</nowiki></pre> 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: <code><nowiki>sudo umount /mnt</nowiki></code> 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, or change drives and lose your Grub bootloader. For more information please have a look at the [[Grub]] page. <ol><li>Boot the Ubuntu Live CD. </li><li>Press `Ctrl-Alt-F1` </li><li>Find the partition where your /boot directory is (normally the root partition) check the previous tip for that. </li><li>`sudo mount /dev/hda1 /mnt` </li><li>`sudo chroot /mnt` </li><li>`grub` </li><li>`find /boot/grub/stage1` (will output a partition name like (hd0,3) ) </li><li>`root (hd0,3)` </li><li>`setup (hd0)` </li><li>`quit` </li><li>Now restart the system and remove the Live CD</li></ol> ==== The GUI Way: Reinstalling Grub ==== <ol><li>Boot your computer with the Ubuntu CD </li><li>Go through the installation process until you reach "[!!!] Disk Partition" </li><li>Select Manual Partition </li><li>Mount your appropriate linux partions:</li></ol> */ */boot *swap *... <ol><li>'''DO NOT FORMAT THEM.''' </li><li>Finish the manual partition </li><li>Say "Yes" when it asks you to save the changes </li><li>It will give you errors saying that "the system couldn't install ....." after that </li><li>Ignore them, keep select "continue" until you get back to the Ubuntu installation menu </li><li>Jump to "Install Grub ...." </li><li>Once it is finished, just restart your computer</li></ol> From: http://doc.gwos.org/index.php/Restore_Grub and http://ubuntuforums.org/showthread.php?t=76652 === See also === ---- [[category:CategoryLive]] [[category:CategoryBackupRecovery]] [[category:UbuntuHelp]]
该页面使用的模板:
模板:From
(
查看源代码
)
模板:Languages
(
查看源代码
)(受保护)
模板:Languages/Lang
(
查看源代码
)(受保护)
返回至
UbuntuHelp:LiveCdRecovery
。