Skip to content

Commit

Permalink
Create 2024-12-07-grub2usb.md
Browse files Browse the repository at this point in the history
  • Loading branch information
shownb authored Dec 7, 2024
1 parent 21ad9f6 commit 63efc29
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions _posts/2024-12-07-grub2usb.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
```bash
umount /dev/sdb1
dd if=/dev/zero of=/dev/sdb bs=512 count=1
fdisk /dev/sdb
```
## Then to create the first exFAT partition;
第一个分区要是windows可以认得的,不然放在第二分区,windows认不得。exfat好处是可以放超过4g的文件

type n and then press enter to create a new
p to create a primary
1 to create the first primary partition
just press enter to start at the default sector
type -50M to set the size minus 50M (if prompted to remove signature, press Y)
t for enabling type
7 to set the partition type to exFAT

## Now to create the second fat32 partition;
n to create a new
p for primary
2 to create the second partition
just press enter to start at the default sector
then press enter once more to end at the default last sector
t to enable type
2 to select the second partition
6 to set the type to fat
a to make this partition active
2 again for the second partition
w to write the information to disk and exit

```bash
mkfs.exfat -n USB /dev/sdb1
mkfs.vfat -F 32 -n BOOT /dev/sdb2
```
```bash
grub-install --target=x86_64-efi --efi-directory=/media/user/BOOT/boot/efi --boot-directory=/media/user/BOOT/boot --force --removable --no-floppy
```

0 comments on commit 63efc29

Please sign in to comment.