Skip to content

Commit

Permalink
Added instructions for using Armbian in TF/USB
Browse files Browse the repository at this point in the history
  • Loading branch information
ophub committed Oct 19, 2021
1 parent 3788195 commit 22722ed
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 1 deletion.
41 changes: 41 additions & 0 deletions README.cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,47 @@ armbian-docker
armbian-config
```

- ### 当在 TF/USB 中使用 Armbian 时如何激活剩余空间

我们使用的 TF/USB 一般比较大,Armbian 在写入卡中时默认只占用了2G左右的空间,如果不写入 EMMC,以后计划在 TF/USB 中使用 Armbian 系统,可以通过以下的方法激活剩余空间使用。查看 [操作截图](https://user-images.githubusercontent.com/68696949/137860992-fbd4e2fa-e90c-4bbb-8985-7f5db9f49927.jpg)

登录 Armbian 系统 → 输入命令:

```yaml
# 1. 根据空间大小确认 TF/USB 的名称,TF卡为 [ mmcblk ],USB 为[ sd ]
在命令行中: 输入 [ fdisk -l | grep "sd" ] 查看卡的名称

# 2. 获取剩余空间的起始值,复制并保存,下面使用(例如:5382144)
在命令行中: 输入 [ fdisk -l | grep "sd" | sed -n '$p' | awk '{print $3}' | xargs -i expr {} + 1 ] 得到剩余空间起始值

# 3. 开始分配未使用的空间(例如:sda、mmcblk0 或 mmcblk1)
在命令行中: 输入 [ fdisk /dev/sda ] 开始分配剩余空间
在命令行中: 输入 [ n ] 创建新分区
在命令行中: 输入 [ p ] 指定分区类型为主分区
在命令行中: 将分区号设置为 [ 3 ]
在命令行中: 分区的起始值,输入第二步得到的值 [ 5382144 ]
在命令行中: 分区的结束值,按 [ 回车 ] 使用默认值
在命令行中: 如果提示是否删除签名?[Y]es/[N]o: 输入 [ Y ]
在命令行中: 输入 [ t ] 指定分区类型
在命令行中: 输入分区编号 [ 3 ]
在命令行中: 指定分区类型为 Linux,输入代码 [ 83 ]
在命令行中: 输入 [ w ] 保存结果
在命令行中: 输入 [ reboot ] 重启

# 4. 重新启动后,格式化新分区
在命令行中: 输入 [ mkfs.ext4 -F -L SHARED /dev/sda3 ] 格式新分区

# 5. 为新分区设置挂载目录
在命令行中: 输入 [ mkdir -p /mnt/share ] 创建新分区的挂载目录
在命令行中: 输入 [ mount -t ext4 /dev/sda3 /mnt/share ] 进行挂载

# 6. 添加开机自动挂载
在命令行中: [ vi /etc/fstab ]
# 按 [ i ] 进入编译模式,将下面的代码复制,黏贴到文件的末尾处
/dev/sda3 /mnt/share ext4 defaults 0 0
# 按 [ esc ] 键退出,输入 [ :wq! ] 后按 [ 回车 ] 保存退出,结束设置。
```

## Armbian 固件制作方法

- 不同的 Amlogic armbian 固件,使用对应的 soc 代码生成。 请根据你的盒子的 soc 型号进行选择。支持 `s922x``s905x3``s905x2``s912``s905d``s905x``s905w`
Expand Down
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,48 @@ Login in to armbian → input command:
armbian-config
```

- ### When using Armbian in TF/USB, enable free space

TF/USB is generally relatively large. Armbian only occupies about 2G of space when writing to the card. If you do not write EMMC, you plan to use the Armbian system in TF/USB in the future. You can use the following method to activate the remaining space. View [Operation screenshot](https://user-images.githubusercontent.com/68696949/137860992-fbd4e2fa-e90c-4bbb-8985-7f5db9f49927.jpg)

Login in to armbian → input command:

```yaml
# 1. Confirm the name of the TF/USB according to the size of the space
# The TF is [ mmcblk ], USB is [ sd ]
Command: Enter [ fdisk -l | grep "sd" ]

# 2. Get the starting value of the remaining space, Copy and save, used below (E.g: 5382144)
Command: Enter [ fdisk -l | grep "sd" | sed -n '$p' | awk '{print $3}' | xargs -i expr {} + 1 ]

# 3. Start allocating unused space (E.g: sda, mmcblk0 or mmcblk1)
Command: Enter [ fdisk /dev/sda ] Start allocating the remaining space
Command: Select [ n ] to create a partition
Command: Select [ p ] to specify the partition type as primary partition
Command: Set the partition number to [ 3 ]
Command: The start value of the partition, enter the value obtained in the second step, E.g: [ 5382144 ]
Command: End value, press [ Enter ] to use the default value
Command: If there is a hint: Do you want to remove the signature? [Y]es/[N]o: Enter [ Y ]
Command: Enter [ t ] to specify the partition type
Command: Enter Partition number [ 3 ]
Command: Enter Hex code (type L to list all codes): [ 83 ]
Command: Enter [ w ] to save
Command: Enter [ reboot ] to restart

# 4. After restarting, format the new partition
Command: Enter [ mkfs.ext4 -F -L SHARED /dev/sda3 ] to format the new partition

# 5. Set the mount directory for the new partition
Command: Enter [ mkdir -p /mnt/share ] to Create mount directory
Command: Enter [ mount -t ext4 /dev/sda3 /mnt/share ] to Mount the newly created partition to the directory

# 6. Add automatic mount at boot
Command: Enter [ vi /etc/fstab ]
# Press [ i ] to enter the input mode, copy the following values to the end of the file
/dev/sda3 /mnt/share ext4 defaults 0 0
# Press [ esc ] to exit, Input [ :wq! ] and [ Enter ] to Save, Finish.
```

## Armbian firmware make method

- Different amlogic armbian firmware, use the corresponding soc code to generate. Please choose according to your box soc model. Supported soc are `s922x`, `s905x3`, `s905x2`, `s912`, `s905d`, `s905x`, `s905w`.
Expand Down
2 changes: 1 addition & 1 deletion make
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ make_image() {

SKIP_MB=68
BOOT_MB=256
ROOT_MB=2304
ROOT_MB=2748
IMG_SIZE=$((SKIP_MB + BOOT_MB + ROOT_MB))

dd if=/dev/zero of=${build_image_file} bs=1M count=${IMG_SIZE} conv=fsync >/dev/null 2>&1
Expand Down

0 comments on commit 22722ed

Please sign in to comment.