zoukankan      html  css  js  c++  java
  • Debian U盘 安装 Error: "Incorrect CDROM detected"

    有点厌倦了yum软件安装的繁琐,想安装Debian,新鲜一下。

    没有光盘,只能用U盘做系统盘,不满于总是按照别人的步骤安装,稍微有些问题就解决不了,决定稍微学习一下grub的使用。

    废话少说,上步骤:

    1、在U盘安装grub2

    条件:

      电脑设为从USB设备启动。
      要有一个Linux系统来安装Grub.

    实施步骤:

    将U盘分为2个区,第一个区为vfat格式,第二个区为ext2格式,grub安装到第二个区,将第二个区作为可引导区

    1、分区

    1. [root@localhost ~]# fdisk /dev/sdb  
    2.   
    3. Command (m for help): d  
    4. Selected partition 1  
    5.   
    6. Command (m for help): n  
    7. Command action  
    8.    e   extended  
    9.    p   primary partition (1-4)  
    10. p  
    11. Partition number (1-4): 1  
    12. First cylinder (1-487, default 1):  
    13. Using default value 1  
    14. Last cylinder or +size or +sizeM or +sizeK (1-487, default 487): +3072M  
    15.   
    16. Command (m for help): n  
    17. Command action  
    18.    e   extended  
    19.    p   primary partition (1-4)  
    20. p  
    21. Partition number (1-4): 2  
    22. First cylinder (375-487, default 375):  
    23. Using default value 375  
    24. Last cylinder or +size or +sizeM or +sizeK (375-487, default 487):  
    25. Using default value 487  
    26.   
    27. Command (m for help): w  
    28. The partition table has been altered!  
    29.   
    30. Calling ioctl() to re-read partition table.  
    31.   
    32. WARNING: Re-reading the partition table failed with error 16: 设备或资源忙.  
    33. The kernel still uses the old table.  
    34. The new table will be used at the next reboot.  
    35. Syncing disks.  


    2、格式化分区
    卸载U盘:在桌面右键点击“删除文件卷”
    插上U盘

    1. [root@localhost ~]# ls /dev/sd*  
    2. /dev/sda  /dev/sda1  /dev/sda2  /dev/sda3  /dev/sda4  /dev/sda5  /dev/sda6  /dev/sda7  /dev/sda8  /dev/sdb  /dev/sdb1  /dev/sdb2  
    3.   
    4. [root@localhost ~]# umount /dev/sdb1  
    5. [root@localhost ~]# umount /dev/sdb2  
    6. [root@localhost ~]# mkfs.vfat /dev/sdb1  
    7. mkfs.vfat 2.11 (12 Mar 2005)  
    8. [root@localhost ~]# mkfs.ext2 /dev/sdb2  
    9. mke2fs 1.39 (29-May-2006)  
    10. Filesystem label=  
    11. OS type: Linux  
    12. Block size=4096 (log=2)  
    13. Fragment size=4096 (log=2)  
    14. 113568 inodes, 226918 blocks  
    15. 11345 blocks (5.00%) reserved for the super user  
    16. First data block=0  
    17. Maximum filesystem blocks=234881024  
    18. 7 block groups  
    19. 32768 blocks per group, 32768 fragments per group  
    20. 16224 inodes per group  
    21. Superblock backups stored on blocks:  
    22.         32768, 98304, 163840  
    23.   
    24. Writing inode tables: done                              
    25. Writing superblocks and filesystem accounting information: done  
    26.   
    27. This filesystem will be automatically checked every 24 mounts or  
    28. 180 days, whichever comes first.  Use tune2fs -c or -i to override.  



    3、激活/dev/sdb2

    1. [root@localhost ~]# fdisk /dev/sdb  
    2.   
    3. Command (m for help): a  
    4. Partition number (1-4): 2  
    5.   
    6. Command (m for help): w  
    7. The partition table has been altered!  
    8.   
    9. Calling ioctl() to re-read partition table.  
    10. Syncing disks.  
    11.   
    12. [root@localhost ~]# fdisk -l  
    13. ...  
    14. Disk /dev/sdb: 4008 MB, 4008706048 bytes  
    15. 255 heads, 63 sectors/track, 487 cylinders  
    16. Units = cylinders of 16065 * 512 = 8225280 bytes  
    17.   
    18.    Device Boot      Start         End      Blocks   Id  System  
    19. /dev/sdb1               1         374     3004123+  83  Linux  
    20. /dev/sdb2   *         375         487      907672+  83  Linux        # 可引导分区  


    4、安装grub到U盘
    查看U盘各分区的挂载情况

    1. [root@localhost ~]# df  
    2. ...  
    3. /dev/sdb2               893388       904    847104   1% /media/disk  
    4. /dev/sdb1              2998248         4   2998244   1% /media/disk-1  
    5.   
    6. [root@localhost ~]# grub-install --root-directory=/media/disk --no-floppy /dev/sdb2  
    7. Probing devices to guess BIOS drives. This may take a long time.  
    8. Installation finished. No error reported.  
    9. This is the contents of the device map /media/disk/boot/grub/device.map.  
    10. Check if this is correct or not. If any of the lines is incorrect,  
    11. fix it and re-run the script `grub-install'.  
    12.   
    13. (hd0)   /dev/sda  
    14. (hd1)   /dev/sdb  


    5、安装到U盘的MBR

      1. [root@localhost ~]# grub  
      2.     GNU GRUB  version 0.97  (640K lower / 3072K upper memory)  
      3.   
      4.  [ Minimal BASH-like line editing is supported.  For the first word, TAB  
      5.    lists possible command completions.  Anywhere else TAB lists the possible  
      6.    completions of a device/filename.]  
      7.   
      8. grub> root (hd1,  
      9.  Possible partitions are:  
      10.    Partition num: 0,  Filesystem type unknown, partition type 0x83  
      11.    Partition num: 1,  Filesystem type is ext2fs, partition type 0x83  
      12.   
      13. grub> root (hd1,1)  
      14.  Filesystem type is ext2fs, partition type 0x83  
      15.   
      16. grub> setup (hd1)  
      17.  Checking if "/boot/grub/stage1" exists... yes  
      18.  Checking if "/boot/grub/stage2" exists... yes  
      19.  Checking if "/boot/grub/e2fs_stage1_5" exists... yes  
      20.  Running "embed /boot/grub/e2fs_stage1_5 (hd1)"...  15 sectors are embedded.  
      21. succeeded  
      22.  Running "install /boot/grub/stage1 (hd1) (hd1)1+15 p (hd1,1)/boot/grub/stage2 /boot/grub/grub.conf"... succeeded  
      23. Done.  
      24.   
      25. grub> quit  

    参考网址:http://blog.csdn.net/duyiwuer2009/article/details/7799687

    接下来重启,并用grub引导:

      重启计算机,将会看到多了一个grub启动选项。选择它,进入grub提示符。输入如下命令:grub>kernel (hd0,0)/vmlinuz root=/dev/ram ramdisk_size=20000 devfs=mount,dall|grub>initrd (hd0,0)/initrd.gz|grub>boot|

    注:在grup>提示符下,输入“|”约定表示回车注: (hd0,0)表示第一块硬盘的第一分区, (hd0,1)表示第一块硬盘的第二分区 (hd1,0)表示第二块硬盘的第一分区。依此类推,依自己实际iso所在位置不同而改变
    接着马上就会进入安装界面了。

    接下来处理"Incorrect CD-ROM detected"错误:

    ubuntu官网这样解决的:

    If you get "Incorrect CD-ROM detected" error on detection stage, reboot, press F6 and then ESC to go to manual boot line editing, and add the option 'cdrom-detect/try-usb=true'. On Ubuntu 9.10 server edition the install menu will be shown right after reboot. Chose "Help" and then press F6.

    但是,我试了没用。。。囧

    下面的我用了可以,推荐大家试一下:

    In my case the commands below used
    “/dev/sdb1” as “/dev/<usb drive partition device file>” and
    “/mnt/iso/ubutnu-10.04-server-i386.iso” as “/mnt/usb/<iso file>”
    but yours my vary.

    When you get the screen with “Load CD-ROM driver from removable media?” press ALT-F2 to get a console and enter these commands:

    mkdir /mnt/usb /mnt/iso
    mount –t vfat /dev/<usb drive partition device file> /mnt/usb
    mount –t iso9660 –o loop /mnt/usb/<iso file> /mnt/iso

    ALT-F1 to return to installation dialog and answer as follows:
    Load CD-ROM driver from removable media? <No> 
    Manually select CD-ROM module and device> <Yes>
    Module needed for accessing the CD-ROM: none
    Device file for accessing the CD-ROM: /dev/loop0

    翻译一下:就是我用/dev/sdb1代表我u盘的分区

    用/mnt/iso/ubun...代表我iso文件所在位置。

    当通过grub进入安装菜单后,按组合键:alt+f2 进入命令窗口,输入以下:

    mkdir /mnt/usb /mnt/iso
    mount –t vfat /dev/<usb drive partition device file> /mnt/usb
    mount –t iso9660 –o loop /mnt/usb/<iso file> /mnt/iso

    可以根据自己情况修改。然后再alt+f1回去,选择如下:

    Load CD-ROM driver from removable media? <No> 
    Manually select CD-ROM module and device> <Yes>
    Module needed for accessing the CD-ROM: none
    Device file for accessing the CD-ROM: /dev/loop0

    over!!!!!!!!!!!!!!!!!!!!!!

  • 相关阅读:
    [arXiv18]更快的基于非二叉化自底向上策略的转移系统成分句法分析
    [AAAI18]面向序列建模的元多任务学习
    [COLING18]两种成分句法分析的局部特征模型
    [ACL18]基于RNN和动态规划的线性时间成分句法分析
    成分句法分析综述
    [NAACL16]RNN文法
    [TACL17]基于中序转移的成分句法分析
    K-摇臂赌博机算法与实现
    关于JVM案例分析(四)
    关于JVM案例分析(三)
  • 原文地址:https://www.cnblogs.com/bigbigtree/p/3073586.html
Copyright © 2011-2022 走看看