zoukankan      html  css  js  c++  java
  • [quote] Using RAW Devices In VirtualBox VMs

    Original URL

    http://www.howtoforge.com/using-raw-devices-in-virtualbox-vms-p2

    How to access a second .vdi image created in virtualbox stoage tab.

    Disk /dev/sdb: 5368 MB, 5368709120 bytes
    255 heads, 63 sectors/track, 652 cylinders, total 10485760 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000

    Disk /dev/sdb doesn't contain a valid partition table

    You can now use this drive as you would normally do, e.g. partition it...

    fdisk /dev/sdb

    root@vm10:~# fdisk /dev/sdb
    Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
    Building a new DOS disklabel with disk identifier 0x862fb2cf.
    Changes will remain in memory only, until you decide to write them.
    After that, of course, the previous content won't be recoverable.

    Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

    Command (m for help):
     <-- n
    Partition type:
       p   primary (0 primary, 0 extended, 4 free)
       e   extended
    Select (default p):
     <-- p
    Partition number (1-4, default 1): <-- 1
    First sector (2048-10485759, default 2048): <-- ENTER
    Using default value 2048
    Last sector, +sectors or +size{K,M,G} (2048-10485759, default 10485759):
     <-- ENTER
    Using default value 10485759

    Command (m for help):
     <-- t
    Selected partition 1
    Hex code (type L to list codes):
     <-- 83

    Command (m for help): <-- w
    The partition table has been altered!

    Calling ioctl() to re-read partition table.
    Syncing disks.
    root@vm10:~#

    ... create a file system on it (e.g. ext4)...

    mkfs.ext4 /dev/sdb1

    ... and mount it:

    mount /dev/sdb1 /mnt

  • 相关阅读:
    快速幂 快速乘法
    扩展欧几里得学习笔记
    求逆序数数目(树状数组+离散化)
    隐式图的遍历
    随机数生成
    推倒重来
    动态规划初步
    子集生成
    东大oj1155 等凹函数
    P1278 单词游戏
  • 原文地址:https://www.cnblogs.com/lake-of-embedded-system/p/3644074.html
Copyright © 2011-2022 走看看