#11597 closed defect (fixed)
Taking a snapshot increases the number of blocks on the guest harddrive => fixed in svn
回報者: | rshaw | 負責人: | |
---|---|---|---|
元件: | virtual disk | 版本: | VirtualBox 4.2.8 |
關鍵字: | iscsi disk blocks | 副本: | |
Guest type: | other | Host type: | Linux |
描述
This seems to be applicable to iSCSI backed mediums:
Expected results: Taking a snapshot does not alter drive block count
Observed results: Taking a snapshot increases the number of blocks the drive reports to have
Steps to reproduce (These steps assume a linux host which has tgtadm installed):
- Create a dd file with known number of blocks
dd if=/dev/zero of=bug_demo.dd count=10000
- Create loopback block device for iSCSI target
sudo losetup /dev/loop0 bug_demo.dd
- Verify number of blocks in block device
sudo blockdev --getsize /dev/loop0 10000
- Use iSCSI software to expose block device as target
sudo tgt-setup-lun -d /dev/loop0 -n bug_demo
- Verify target
ryan@TehDualLinux:~/bug$ sudo tgtadm --lld iscsi --mode target --op showTarget 1: iqn.2001-04.com.TehDualLinux-bug_demo System information: Driver: iscsi State: ready I_T nexus information: LUN information: LUN: 0 Type: controller SCSI ID: IET 00010000 SCSI SN: beaf10 Size: 0 MB, Block size: 1 Online: Yes Removable media: No Readonly: No Backing store type: null Backing store path: None Backing store flags: LUN: 1 Type: disk SCSI ID: IET 00010001 SCSI SN: beaf11 Size: 5 MB, Block size: 512 Online: Yes Removable media: No Readonly: No Backing store type: rdwr Backing store path: /dev/loop0 Backing store flags: Account information: ACL information: ALL
- Attach iSCSI target to a virtual machine of choice (note, I used an IDE controller).
VBoxManage storageattach "Ubuntu" --storagectl "IDE" --port 0 --device 1 --type hdd --medium iscsi --server localhost --target "iqn.2001-04.com.TehDualLinux-bug_demo" --lun 1 --tport 3260 --mtype normal
- Attach a CD in order to bootup VM inside of a live linux distro. From within the guest, verify size of added disk
sudo blockdev --getsize /dev/sda 10000
- Shutdown VM, take an offline snapshot, and power back on into previous live linux enviornment. Verify size of disk.
sudo blockdev --getsize /dev/sda 10240
- Disk has grown by 240 blocks. Open up wireshark, filter on the iSCSI protocol. Observe how when reading past the end of the drive (LBA 9999), VBox actually begins issuing iSCSI commands to read the beginning of the drive (acccessing LBA 0,1, etc).
- Open up log file for machine. You will find errors such as:
00:00:09.073586 PIIX3 ATA: LUN#1: disk read error (rc=VERR_INVALID_PARAMETER iSector=0x2780 cSectors=0x8)
- Note the sector value in the above errors when converted to decimal are all past the valid number of blocks the drive should have.
更動歷史 (4)
注意:
瀏覽 TracTickets
來幫助您使用待辦事項功能
Additional notes - the wrap around as mentioned in step 9 occurs when using a SATA interface, it gets an IO error when using IDE.
The block count difference seems to be a characteristic of VBox due to a megabyte alignment requirement. If using an image that is generated on megabyte alignment (
2^20 bytes
) this problem does not present itself. If it is not generated on this alignment, the image will pad itself until it is megabyte aligned, but only after a snapshot has been taken.