菜单

Administrator
发布于 2025-10-14 / 4 阅读
0
0

R4S安装openwrt--扩容分区

首先,直接贴代码

--------------------------------------------------
root@ImmortalWrt:~# opkg update
Downloading https://mirrors.vsean.net/openwrt/releases/24.10.3/targets/rockchip/armv8/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/immortalwrt_core
Downloading https://mirrors.vsean.net/openwrt/releases/24.10.3/targets/rockchip/armv8/packages/Packages.sig
Signature check passed.
Downloading https://mirrors.vsean.net/openwrt/releases/24.10.3/packages/aarch64_generic/base/Packages.gz
Updated list of available packages in /var/opkg-lists/immortalwrt_base
Downloading https://mirrors.vsean.net/openwrt/releases/24.10.3/packages/aarch64_generic/base/Packages.sig
Signature check passed.
Downloading https://mirrors.vsean.net/openwrt/releases/24.10.3/targets/rockchip/armv8/kmods/6.6.104-1-56b82a387138e46ddfde5d0f1c18bbac/Packages.gz
Updated list of available packages in /var/opkg-lists/immortalwrt_kmods
Downloading https://mirrors.vsean.net/openwrt/releases/24.10.3/targets/rockchip/armv8/kmods/6.6.104-1-56b82a387138e46ddfde5d0f1c18bbac/Packages.sig
Signature check passed.
Downloading https://mirrors.vsean.net/openwrt/releases/24.10.3/packages/aarch64_generic/luci/Packages.gz
Updated list of available packages in /var/opkg-lists/immortalwrt_luci
Downloading https://mirrors.vsean.net/openwrt/releases/24.10.3/packages/aarch64_generic/luci/Packages.sig
Signature check passed.
Downloading https://mirrors.vsean.net/openwrt/releases/24.10.3/packages/aarch64_generic/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/immortalwrt_packages
Downloading https://mirrors.vsean.net/openwrt/releases/24.10.3/packages/aarch64_generic/packages/Packages.sig
Signature check passed.
Downloading https://mirrors.vsean.net/openwrt/releases/24.10.3/packages/aarch64_generic/routing/Packages.gz
Updated list of available packages in /var/opkg-lists/immortalwrt_routing
Downloading https://mirrors.vsean.net/openwrt/releases/24.10.3/packages/aarch64_generic/routing/Packages.sig
Signature check passed.
Downloading https://mirrors.vsean.net/openwrt/releases/24.10.3/packages/aarch64_generic/telephony/Packages.gz
Updated list of available packages in /var/opkg-lists/immortalwrt_telephony
Downloading https://mirrors.vsean.net/openwrt/releases/24.10.3/packages/aarch64_generic/telephony/Packages.sig
Signature check passed.
root@ImmortalWrt:~# opkg install fdisk lsblk losetup f2fs-tools
Package fdisk (2.40.2-r1) installed in root is up to date.
Installing lsblk (2.40.2-r1) to root...
Downloading https://mirrors.vsean.net/openwrt/releases/24.10.3/packages/aarch64_generic/base/lsblk_2.40.2-r1_aarch64_generic.ipk
Installing libmount1 (2.40.2-r1) to root...
Downloading https://mirrors.vsean.net/openwrt/releases/24.10.3/packages/aarch64_generic/base/libmount1_2.40.2-r1_aarch64_generic.ipk
Installing losetup (2.40.2-r1) to root...
Downloading https://mirrors.vsean.net/openwrt/releases/24.10.3/packages/aarch64_generic/base/losetup_2.40.2-r1_aarch64_generic.ipk
Installing f2fs-tools (1.16.0-r3) to root...
Downloading https://mirrors.vsean.net/openwrt/releases/24.10.3/packages/aarch64_generic/base/f2fs-tools_1.16.0-r3_aarch64_generic.ipk
Installing f2fsck (1.16.0-r3) to root...
Downloading https://mirrors.vsean.net/openwrt/releases/24.10.3/packages/aarch64_generic/base/f2fsck_1.16.0-r3_aarch64_generic.ipk
Configuring f2fsck.
Configuring f2fs-tools.
Configuring libmount1.
Configuring lsblk.
Configuring losetup.
root@ImmortalWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 6.3M      6.3M         0 100% /rom
tmpfs                     1.9G      1.2M      1.9G   0% /tmp
/dev/loop0              291.9M     57.7M    234.1M  20% /overlay
overlayfs:/overlay      291.9M     57.7M    234.1M  20% /
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/mmcblk1p1           15.7M      6.1M      9.3M  39% /mnt/mmcblk1p1
root@ImmortalWrt:~# fdisk -l
Disk /dev/loop0: 293.88 MiB, 308150272 bytes, 601856 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mmcblk1: 58.24 GiB, 62534975488 bytes, 122138624 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x5452574f

Device         Boot  Start    End Sectors  Size Id Type
/dev/mmcblk1p1 *     65536  98303   32768   16M 83 Linux
/dev/mmcblk1p2      131072 745471  614400  300M 83 Linux
root@ImmortalWrt:~# fdisk /dev/mmcblk1

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

This disk is currently in use - repartitioning is probably a bad idea.
It's recommended to umount all file systems, and swapoff all swap
partitions on this disk.


Command (m for help): p

Disk /dev/mmcblk1: 58.24 GiB, 62534975488 bytes, 122138624 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x5452574f

Device         Boot  Start    End Sectors  Size Id Type
/dev/mmcblk1p1 *     65536  98303   32768   16M 83 Linux
/dev/mmcblk1p2      131072 745471  614400  300M 83 Linux

Command (m for help): d
Partition number (1,2, default 2): 2

Partition 2 has been deleted.

Command (m for help): n
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (2-4, default 2): 2
First sector (2048-122138623, default 2048): 131072
Last sector, +/-sectors or +/-size{K,M,G,T,P} (131072-122138623, default 122138623): 

Created a new partition 2 of type 'Linux' and of size 58.2 GiB.
Partition #2 contains a squashfs signature.

Do you want to remove the signature? [Y]es/[N]o: n

Command (m for help): p

Disk /dev/mmcblk1: 58.24 GiB, 62534975488 bytes, 122138624 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x5452574f

Device         Boot  Start       End   Sectors  Size Id Type
/dev/mmcblk1p1 *     65536     98303     32768   16M 83 Linux
/dev/mmcblk1p2      131072 122138623 122007552 58.2G 83 Linux

Command (m for help): w
The partition table has been altered.
Syncing disks.

root@ImmortalWrt:~# df  -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 6.3M      6.3M         0 100% /rom
tmpfs                     1.9G      1.2M      1.9G   0% /tmp
/dev/loop0              291.9M     57.7M    234.1M  20% /overlay
overlayfs:/overlay      291.9M     57.7M    234.1M  20% /
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/mmcblk1p1           15.7M      6.1M      9.3M  39% /mnt/mmcblk1p1
root@ImmortalWrt:~# losetup
NAME       SIZELIMIT  OFFSET AUTOCLEAR RO BACK-FILE  DIO LOG-SEC
/dev/loop0         0 6422528         1  0 /mmcblk1p2   0     512
root@ImmortalWrt:~# losetup -f -o 6422528 /dev/mmcblk1p2
root@ImmortalWrt:~# losetup
NAME       SIZELIMIT  OFFSET AUTOCLEAR RO BACK-FILE      DIO LOG-SEC
/dev/loop1         0 6422528         0  0 /dev/mmcblk1p2   0     512
/dev/loop0         0 6422528         1  0 /mmcblk1p2       0     512
root@ImmortalWrt:~# mount /dev/loop1 /mnt
root@ImmortalWrt:~# ls -l /mnt
drwxr-xr-x    7 root     root          3488 Sep 21 22:45 upper
drwxr-xr-x    3 root     root          3488 Jan 18  2013 work
root@ImmortalWrt:~# umount /dev/loop1
root@ImmortalWrt:~# lsblk -f
NAME        FSTYPE   FSVER LABEL       UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
loop0       f2fs           rootfs_data 87e69da1-1f14-48c3-b713-a80895354a97  234.1M    20% /overlay
loop1       f2fs           rootfs_data 87e69da1-1f14-48c3-b713-a80895354a97                
mmcblk1                                                                                    
├─mmcblk1p1 ext4           kernel      84173db5-fa99-e35a-95c6-28613cc79ea9    9.3M    39% /mnt/mmcblk1p1
└─mmcblk1p2 squashfs                                                              0   100% /rom
root@ImmortalWrt:~# resize2fs   /dev/loop1
-ash: resize2fs: not found
root@ImmortalWrt:~# resize.f2fs /dev/loop1
Info: MKFS version
  "Linux version 6.6.104 ([email protected]) (aarch64-openwrt-linux-musl-gcc (OpenWrt GCC 13.3.0 r33451-5531f6bc76a3) 13.3.0, GNU ld (GNU Binutils) 2.42) #0 SMP Sun Sep 21 14:45:27 2025"
Info: FSCK version
  from "Linux version 6.6.104 ([email protected]) (aarch64-openwrt-linux-musl-gcc (OpenWrt GCC 13.3.0 r33451-5531f6bc76a3) 13.3.0, GNU ld (GNU Binutils) 2.42) #0 SMP Sun Sep 21 14:45:27 2025"
    to "Linux version 6.6.104 ([email protected]) (aarch64-openwrt-linux-musl-gcc (OpenWrt GCC 13.3.0 r33451-5531f6bc76a3) 13.3.0, GNU ld (GNU Binutils) 2.42) #0 SMP Sun Sep 21 14:45:27 2025"
Info: superblock features = 0 : 
Info: superblock encrypt level = 0, salt = 00000000000000000000000000000000
Info: Segments per section = 1
Info: Sections per zone = 1
Info: total FS sectors = 601856 (293 MB)
Info: CKPT version = 180d8058
Info: Duplicate valid checkpoint to mirror position 1024 -> 512
Info: Write valid nat_bits in checkpoint
[migrate_main: 206] Info: Done to migrate Main area: main_blkaddr = 0x1000 -> 0x16a00
[migrate_ssa: 272] Info: Done to migrate SSA blocks: sum_blkaddr = 0xe00 -> 0xf600
[migrate_nat: 389] Info: Done to migrate NAT blocks: nat_blkaddr = 0xa00 -> 0xe00
[migrate_sit: 447] Info: Done to restore new SIT blocks: 0x600
[rebuild_checkpoint: 486] Info: Overprovision ratio = 0.590%
[rebuild_checkpoint: 487] Info: Overprovision segments = 178 (GC reserved = 176)
Info: Write valid nat_bits in checkpoint
[rebuild_checkpoint: 603] Info: Done to rebuild checkpoint blocks
[update_superblock: 765] Info: Done to update superblock

Done: 14.123909 secs
root@ImmortalWrt:~# fdisk -l
Disk /dev/loop0: 293.88 MiB, 308150272 bytes, 601856 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop1: 58.17 GiB, 62461444096 bytes, 121995008 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mmcblk1: 58.24 GiB, 62534975488 bytes, 122138624 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x5452574f

Device         Boot  Start       End   Sectors  Size Id Type
/dev/mmcblk1p1 *     65536     98303     32768   16M 83 Linux
/dev/mmcblk1p2      131072 122138623 122007552 58.2G 83 Linux
root@ImmortalWrt:~# lsblk -f
NAME        FSTYPE   FSVER LABEL       UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
loop0       f2fs           rootfs_data 87e69da1-1f14-48c3-b713-a80895354a97  234.1M    20% /overlay
loop1       f2fs           rootfs_data 87e69da1-1f14-48c3-b713-a80895354a97                
mmcblk1                                                                                    
├─mmcblk1p1 ext4           kernel      84173db5-fa99-e35a-95c6-28613cc79ea9    9.3M    39% /mnt/mmcblk1p1
└─mmcblk1p2 squashfs                                                              0   100% /rom
root@ImmortalWrt:~# reboot
root@ImmortalWrt:~# 


评论