因為 VirtualBox 找不到讀卡機的關係,必須要有辦法在 ubuntu 讀寫整個 disk image 中的個別
partitions...更新後再到 windows disk image 更新...
原本只知道 mount -o loop 掛載單一 partition 到目錄。
Ken 找到 loop mount disk image 的選項中,有 offset 的選項可以將 root disk image 中的 partition
個別掛載到 linux 目錄。
可以先對 disk image 下 fdisk -ul 或 parted,差別是 parted 可以直接下 unit 給 B 選項知道
partition 在 disk image 中的 byte offset,fdisk 需要從 sector size 轉成 byte
fdisk 指令是給 -u 取得該 disk 的 sector byte size
sudo fdisk -u -l /dev/sdx
parted 指令是給
sudo parted /dev/sdx
unit B (設定 byte offset)
print
parted 可以用 -s 的 script 選項變成對 script 友善的工具。
最後再下 mount -o loop,offset=calcalated_byte_offset whole_disk_image /path/to/dir
掛載其中的單一 partition
參考:
http://www.andremiller.net/content/mounting-hard-disk-image-including-partitions-using-linux
http://nixcraft.com/ubuntu-debian/15295-ubuntu-mount-root-disk-image-loop-device-using-offset.html
Speed, Precision, Strength, Adaptation, Elegance
2012年1月15日星期日
訂閱:
張貼意見 (Atom)
標籤雲、文章分類
版權宣告、免責聲明
姓名標示、非商業性、相同方式分享3.0台灣授權條款授權。如果您看不懂以上版權,表示您無權使用本網頁任何資料。
免責聲明: 本文所載資料僅供參考,並不構成投資建議,
讀者閱讀或使用該資料所導致結果需要自擔風險與責任,作者概不承擔閱讀人行為之任何風險與責任。

0 comments:
張貼意見