Last active
February 11, 2025 16:13
-
-
Save pashamray/7866f21d2e1925f72132415903c45db0 to your computer and use it in GitHub Desktop.
mount img files in linux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Первый шаг, получить список разделов в образе: | |
fdisk -l hive-0.5-12-20171211.img | |
Диск hive-0.5-12-20171211.img: 7 GiB, 7549747200 байтов, 14745600 секторов | |
Единицы измерения: секторов из 1 * 512 = 512 байтов | |
Размер сектора (логический/физический): 512 байт / 512 байт | |
I/O size (minimum/optimal): 512 bytes / 512 bytes | |
Тип метки диска: dos | |
Идентификатор диска: 0x244b7fbe | |
Устр-во Загрузочный Start Конец Секторы Size Id Тип | |
hive-0.5-12-20171211.img1 2048 43007 40960 20M e W95 FAT16 (LBA) | |
hive-0.5-12-20171211.img2 * 43008 14690303 14647296 7G 83 Linux | |
Второй шаг, найти отступ в байтах до нужного раздела. Для этого стартовое значение сектора умножаем на размер сектора: | |
hive-0.5-12-20171211.img2 * 43008 14690303 14647296 7G 83 Linux | |
43008 * 512 = 22020096 | |
Шаг третий, монтирование образа: | |
sudo mount -o loop,offset=22020096 hive-0.5-12-20171211.img /mnt/tmp | |
Шаг четвертый, проверка: | |
➜ tmp pwd | |
/mnt/tmp | |
➜ tmp ls | |
bin dev hive hive-drivers-pack lib lost+found mnt proc run srv tmp var | |
boot etc hive-config home lib64 media opt root sbin sys usr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment