Mounting HDD on PC: Difference between revisions
Jump to navigation
Jump to search
(→Test) |
|||
Line 31: | Line 31: | ||
echo "00 01 00 01 00 01" | xxd -r -p > /dev/mapper/test | echo "00 01 00 01 00 01" | xxd -r -p > /dev/mapper/test | ||
# device mapper target | |||
hexdump -C /dev/mapper/test | hexdump -C /dev/mapper/test | ||
Line 37: | Line 39: | ||
* | * | ||
00019000 | 00019000 | ||
# real data, as you see bytes are swapped in each 16-bit word | |||
# device mapper allows you to do really cool things :) | |||
hexdump -C /home/glevand/test.bin | hexdump -C /home/glevand/test.bin |
Revision as of 20:03, 3 September 2012
Introduction
- The goal is to mount PS3 HDD on PC Linux and make changes to it.
- Use device mapper for transparent encryption/decryption.
Device Mapper
- A really cool feature of Linux 2.6/3.
- The device mapper is stackable.
dm-bswap16
- Swaps bytes in each 16-bit word.
- It is necessray for HDD/VFLASH encryption/decryption.
GIT repo: http://gitorious.ps3dev.net/ps3linux/dm-bswap16
Test
modprobe loop modprobe dm_mod insmod ./dm-bswap16.ko dd if=/dev/zero of=test.bin bs=1K count=100 losetup /dev/loop0 ./test.bin echo "0 200 bswap16 /dev/loop0" | sudo dmsetup create test echo "00 01 00 01 00 01" | xxd -r -p > /dev/mapper/test # device mapper target hexdump -C /dev/mapper/test 00000000 00 01 00 01 00 01 00 00 00 00 00 00 00 00 00 00 |................| 00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00019000 # real data, as you see bytes are swapped in each 16-bit word # device mapper allows you to do really cool things :) hexdump -C /home/glevand/test.bin 00000000 01 00 01 00 01 00 00 00 00 00 00 00 00 00 00 00 |................| 00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00019000