PageSourceSearch

https://blikvm.com/assets/js/23779f24.3ef38986.js

js blikvm.com collected 2026-10-09 22:22:56 UTC 9,701 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkmy_website=self.webpackChunkmy_website||[]).push([[5547],{2045:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/gparted05-7efb1ae46e555d759bcfbfede802fa18.png"},3242:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/expand_ok-146fd2c704321e501dd7133f286b5421.png"},14146:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/gparted02-ff0fac902250aa59bafb40c1df2080dd.png"},28453:(e,t,n)=>{n.d(t,{R:()=>r,x:()=>o});var s=n(96540);const i={},a=s.createContext(i);function r(e){const t=s.useContext(a);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),s.createElement(a.Provider,{value:t},e.children)}},35275:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/gparted03-2a51042be1ab1a36f8de3e75b696429d.png"},62145:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>o,default:()=>l,frontMatter:()=>r,metadata:()=>s,toc:()=>c});const s=JSON.parse('{"id":"function/expand-filesystem","title":"Expand Filesystem","description":"If you find that the free space of the raspberry pi SD card or eMMC is smaller than the capacity of the actual SD card or eMMC, you need to do the following to expand the raspberry pi. If you find that the system does not have the raspi config tool, you can use Method 2 (use the GParted partition tool).","source":"@site/docs/function/expand-filesystem.md","sourceDirName":"function","slug":"/function/expand-filesystem","permalink":"/docs/function/expand-filesystem","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{},"sidebar":"tutorialSidebar","previous":{"title":"OLED Display","permalink":"/docs/function/OLED-display"},"next":{"title":"Serial Terminal","permalink":"/docs/function/serial-terminal"}}');var i=n(74848),a=n(28453);const r={},o="Expand Filesystem",d={},c=[{value:"Method 1: Use raspi-config tool",id:"method-1-use-raspi-config-tool",level:2},{value:"Method 2: Use GParted tool",id:"method-2-use-gparted-tool",level:2},{value:"Method 3: Use script",id:"method-3-use-script",level:2}];function h(e){const t={br:"br",code:"code",h1:"h1",h2:"h2",header:"header",hr:"hr",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,a.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.header,{children:(0,i.jsx)(t.h1,{id:"expand-filesystem",children:"Expand Filesystem"})}),"\n",(0,i.jsx)(t.p,{children:"If you find that the free space of the raspberry pi SD card or eMMC is smaller than the capacity of the actual SD card or eMMC, you need to do the following to expand the raspberry pi. If you find that the system does not have the raspi config tool, you can use Method 2 (use the GParted partition tool)."}),"\n",(0,i.jsx)(t.h2,{id:"method-1-use-raspi-config-tool",children:"Method 1: Use raspi-config tool"}),"\n",(0,i.jsx)(t.p,{children:"If you are using a mirror after June 2023 and have added a third read-write partition, this method is no longer applicable. Please refer to method 2 and method 3."}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"1."})," Open raspi-config."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"sudo raspi-config\n"})}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"2."})," Choose Advancd Options\uff1a",(0,i.jsx)(t.br,{}),"\n",(0,i.jsx)(t.img,{alt:"IMG_8366",src:n(77441).A+"",width:"954",height:"413"})]}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"3."})," Choose Expand Filesystem\uff1a",(0,i.jsx)(t.br,{}),"\n",(0,i.jsx)(t.img,{alt:"IMG_8366",src:n(98159).A+"",width:"954",height:"413"})]}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"4."})," Ok:",(0,i.jsx)(t.br,{}),"\n",(0,i.jsx)(t.img,{alt:"IMG_8366",src:n(3242).A+"",width:"714",height:"463"})]}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"5."})," Execute the command ",(0,i.jsx)(t.code,{children:"resize2fs /dev/mmcblk0p2"})," in the terminal to see that the SD card has been successfully expanded."]}),"\n",(0,i.jsx)(t.h2,{id:"method-2-use-gparted-tool",children:"Method 2: Use GParted tool"}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"1."})," Connect the SD card or EMMc that has burned the image to the computer through USB. Take the GParted partition tool on Linux as an example. Other platforms also have similar partition tools."]}),"\n",(0,i.jsx)(t.p,{children:"Open GParted software and select SD card:"}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"gparted1",src:n(70233).A+"",width:"1560",height:"1082"})}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"2."})," By observing the partition of the SD card in the above figure, we can find that 2.01GB and 21.87GB of space are unused before and after the sdb3 partition, which is the space we want to expand."]}),"\n",(0,i.jsx)(t.p,{children:"Select the sdb3 partition and click Resize."}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.img,{alt:"gparted2",src:n(14146).A+"",width:"1600",height:"1494"}),"\n",(0,i.jsx)(t.img,{alt:"gparted3",src:n(35275).A+"",width:"1558",height:"1092"})]}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"3."}),' You can drag the white partition of sdb3 to the leftmost and rightmost, or fill in 25958 with "Previous Free Space" as "0" and "New Size" as "Maximum Size", and then click Resize in the lower right corner. Then click OK to see that all unused space of sd has been used.',(0,i.jsx)(t.br,{}),"\n",(0,i.jsx)(t.img,{alt:"gparted4",src:n(85364).A+"",width:"1564",height:"1098"}),"\n",(0,i.jsx)(t.img,{alt:"gparted5",src:n(2045).A+"",width:"1556",height:"1082"})]}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"4."})," Insert the SD card into the device and start it."]}),"\n",(0,i.jsx)(t.h2,{id:"method-3-use-script",children:"Method 3: Use script"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"If you are using a BliKVM image, you can run the following script on KVM to automatically expand the space."}),"\n"]}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"1."})," Log in to the KVM terminal, confirm that the system has read and write permissions, run ",(0,i.jsx)(t.code,{children:"vim expand.sh"})," on any path, and write the following content to expand.sh."]}),"\n",(0,i.jsxs)(t.p,{children:["If your hardware is ",(0,i.jsx)(t.strong,{children:"v1"}),",",(0,i.jsx)(t.strong,{children:"v2"})," or ",(0,i.jsx)(t.strong,{children:"v3"}),", use:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'#!/bin/bash\nset -x\n\nresize_mmcblk0p3() {\n  echo "Resizing mmcblk0p3 partition..."\n  parted /dev/mmcblk0 resizepart 3 100%\n  resize2fs /dev/mmcblk0p3\n  echo "mmcblk0p3 partition resized successfully."\n}\n\necho "Starting partition resizing..."\n\nresize_mmcblk0p3\n\necho "Partition resizing completed."\n'})}),"\n",(0,i.jsxs)(t.p,{children:["If your hardware is ",(0,i.jsx)(t.strong,{children:"v4"}),", use:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'#!/bin/bash\nset -x\n\nresize_mmcblk0p1() {\n  echo "Resizing mmcblk0p1 partition..."\n  parted /dev/mmcblk0 resizepart 1 100%\n  resize2fs /dev/mmcblk0p1\n  echo "mmcblk0p1 partition resized successfully."\n}\n\necho "Starting partition resizing..."\n\nresize_mmcblk0p1\necho "Partition resizing completed."\n'})}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.p,{children:"If you are using a PiKVM image, you can run the script below on the KVM to automatically expand the space."}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"1."})," Log in to the KVM terminal, confirm that the system has read and write permissions, run ",(0,i.jsx)(t.code,{children:"vim expand.sh"})," on any path, and write the following content to ",(0,i.jsx)(t.code,{children:"expand.sh"})]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'#!/bin/bash\nset -x\n        if grep -q \'X-kvmd\\.otgmsd\' /etc/fstab; then\n                part=$(grep \'X-kvmd\\.otgmsd\' /etc/fstab | awk \'{print $1}\')\n                # shellcheck disable=SC2206\n                splitted=(${part//=/ })\n                if [ "${splitted[0]}" == LABEL ]; then\n                        label=${splitted[1]}\n                        part=$(blkid -c /dev/null -L "$label")\n                else\n                        label=PIMSD\n                fi\n                unset splitted\n                disk=/dev/$(lsblk -no pkname "$part")\n                npart=$(cat "/sys/class/block/${part//\\/dev\\//}
1/partition")\n                umount "$part"\n                parted "$disk" -a optimal -s resizepart "$npart" 100%\n                yes | mkfs.ext4 -L "$label" -F -m 0 "$part"\n                mount "$part"\n                unset disk part npart label\n        fi\n'})}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"2."})," Execute ",(0,i.jsx)(t.code,{children:"bash expand.sh"})," on the terminal and wait for the execution to complete."]})]})}function l(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},70233:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/gparted01-9cdf51c12b5c1f5ae5d24622b7baffe2.png"},77441:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/advance_option-6fa878a6bf25a318417a949342fbfb7b.png"},85364:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/gparted04-187630c493f8cb5469f4e156145ddb3e.png"},98159:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/expand-47ab430644dc69f49718bdb34982e526.png"}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.