Create usb pendrive with Arch Linux to boot in several systems
- 128GB USB3 pendrive
- Run Arch Linux in my Udoo system and eventually laptop and other systems.
- Has a data partition to be oponed in all Operating Systems (Formatted in NTFS)
To check if the disk drive is in gpt or dos you should run:
sudo fdisk -l /dev/sdb
You will see something like that:
Disk /dev/sdb: 931,5 GiB, 1000204886016 bytes, 1953525168 sectors
Disklabel type is
dos you should change to gpt, if is marked as
gpt you can continue to next point.
WARNING Doing this will remove all data from disk!
If your partition table is msdos you should change it to gpt running the next command:
sudo fdisk /dev/sdb
g to create the GPT partition table and
w to persist the changes.
We want to create the next schema:
Disk /dev/sdb: 119,2 GiB, 128035323904 bytes, 250068992 sectors
Just use fdisk or parted to create the partitions you want.
mkfs.fat -F32 /dev/sdb2
sudo mkfs.ext4 -O "^has_journal" /dev/sdb3
Enable pacman mirrors:
Chroot to new system:
Update sources and install base system:
# Initialize packman keys
# Mount system partition to /tmp folder
Before creating the initial RAM disk # mkinitcpio -p linux, in /etc/mkinitcpio.conf add the block hook to the hooks array right after udev. This is necessary for appropriate module loading in early userspace.
# Mount filesystem