This repo provides two initcpio hooks (mountntfs
, loopfile
) for booting Arch Linux from an image file in NTFS filesystem.
-
Prepare for a working Arch Linux OS root in an image file.
- It is mounted by
losetup /dev/loop0 arch.img && mount /dev/loop0 /mnt
/boot
should be in a partition outside the image file. Otherwise, the GRUB bootloader may fail to find it. (TODO: use GRUB loopback to support/boot
in file)
- It is mounted by
-
(Chroot to the OS in file)
-
Copy the files in
initcpio
into/etc/initcpio/
. -
Add initcpio hooks
mountntfs
loopfile
.- Edit
/etc/mkinitcpio.conf
, inHOOKS
, addmountntfs loopfile
afterblock
. - Rebuild initcpio (
mkinitcpio -P
).
- Edit
-
Add kernel cmdline parameters.
- (GRUB bootloader for example)
- Edit
/etc/default/grub
- Add
mountntfs=<NTFS_DEV>:/ntfs loopfile=/ntfs/arch.img
in cmdline.
(This mounts<NTFS_DEV>
and maps thearch.img
file as/dev/loop0
.) - Run
grub-mkconfig -o /boot/grub/grub.cfg