备份与还原扩充存储空间
OnceAir by newghost on 1536770378547


 

OnceAir Lite 操作系统存放在TF卡中,可使用磁盘备份软件进行系统备份和还原,还可更换更大容量的TF卡扩充系统盘存储空间。但多次插拔可能会影响TF卡的使用寿命,并且TF存储本身读写速度有限,建议外接移动硬盘扩充存储空间,提高读写速度。

 

要进行系统备份,需准备一个TF卡读卡器。然后安装  windisk32imager 磁盘镜像工具,下载地址: https://sourceforge.net/projects/win32diskimager/files/latest/download 

系统备份

安装 windisk32imager 之后,读卡器连接电脑并插入TF卡,此时会显示新设备G:,选择一个文件地址,点击读取,将TF卡内容读取到 onceair.img 文件中。然后等待系统备份完成。

系统还原

您可以用备份好的镜像重新写回TF卡,还原系统,选好 img 镜像文件,点击写入,即可将镜像文件写入TF卡。即还原完成。

扩大存储空间

您可以更换更大容量的TF卡,来扩大系统存储空间,TF卡必须是 class10 以上的,否则无法正确启动。将系统还原写入大容量TF卡后,还要重新调整分区大小,使之扩展到整个TF卡。

将还原好的TF卡插回OnceAir并连接网络。

远程登陆 OnceAir

调整分区需要远程远程登陆 OnceAir 在Linux命令行中操作,需要先打开 OnceAir SSH 远程登录。点开 Home键 -> 控制面板 -> 服务,将 SSH 远程登录,改为是,然后重启网盘。

 

然后下载远程连接工具 putty, 下载地址: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

 

安装完成之后,在桌面中找到『系统信息』查看网盘的IP地址,假如是 192.168.0.104,并加上管理员用户名 root,即 root@192.168.0.104 填入putty 中的 Host Name 中:

点击 Open。

 

在提示框中填入 root 管理员的默认密码: OnceAir 

即成功进入 ssh 命令行。

自动扩展存储空间

使用 Linux 命令调整系统存储空间比较复杂,我们制作了一个自动化脚本,只需要在运行命令即可:

onceair-resize start

运行完成之后,重启即可:

reboot

 

以下是命令行终端的提示信息,脚本为网络下载,执行完成之后会自动重启系统。

root@onceairliteplus:~# curl http://onceair.com/img/onceair-resize > onceair-resize
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 6952 100 6952 0 0 75879 0 --:--:-- --:--:-- --:--:-- 76395
root@onceairliteplus:~# chmod +x onceair-resize
root@onceairliteplus:~# ./onceair-resize start
Wed Sep 12 15:18:06 UTC 2018 | | | arm64 | aarch64 | 4.14.65-sunxi64

### [resize2fs] Leaving 1 percent spare area. Start resizing partition /dev/mmcblk0p1 now:

major minor #blocks name

179 0 15558144 mmcblk0
179 1 7562432 mmcblk0p1
254 0 51200 zram0
254 1 61772 zram1
254 2 61772 zram2
254 3 61772 zram3
254 4 61772 zram4

Executing fdisk, fsck and partprobe:

Welcome to fdisk (util-linux 2.29.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): Selected partition 1
Partition 1 has been deleted.

Command (m for help): Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p): Partition number (1-4, default 1): First sector (2048-31116287, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (8192-31116287, default 31116287):
Created a new partition 1 of type 'Linux' and of size 14.7 GiB.
Partition #1 contains a ext4 signature.

Command (m for help):
The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Device or resource busy

The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).

New partition table:

major minor #blocks name

179 0 15558144 mmcblk0
179 1 15398464 mmcblk0p1
254 0 51200 zram0
254 1 61772 zram1
254 2 61772 zram2
254 3 61772 zram3
254 4 61772 zram4

Now trying to resize ext4 filesystem on /dev/mmcblk0p1 to the limits:

resize2fs 1.43.4 (31-Jan-2017)
Filesystem at /dev/mmcblk0p1 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
The filesystem on /dev/mmcblk0p1 is now 3849616 (4k) blocks long.


### [resize2fs] Start resizing ext4 partition /dev/mmcblk0p1 now

resize2fs 1.43.4 (31-Jan-2017)
The filesystem is already 3849616 (4k) blocks long. Nothing to do!

root@onceairliteplus:~# reboot

 

 

 

 

 

 

上一篇: 命令行终端 下一篇: 团队流程协作