└── README.md /README.md: -------------------------------------------------------------------------------- 1 | ## Resize storage on OpenWrt Raspberry Pi 2 | > Assuming Openwrt is already installed in your Raspberry-Pi device (if not install from [here](https://github.com/rahulelex/installation-of-openwrt-on-raspberry-pi-4b)) 3 | ### Step 1. To resize storage on Raspberry Pi, internet access is required to download additional software. 4 | 1. Access the OpenWrt WEB interface by opening a browser on your computer by typing http://192.168.1.1 5 | 2. Click on drop down menu and select 6 | 3. In Wireless Overview section beside radio0 click on . It will start wireless scan. 7 | 4. Choose your network's SSID having internet access and click on 8 | 5. If wireless network is encrypted, Enter your network password in and click submit. 9 | 6. Click on save and apply button to connect to this wireless network. 10 | 7. To check it internet is working properly. Click on drop down menu and select 11 | 8. Under Network Utilities section click on 12 | 9. It will give ping us back as long as we have internet connection. 13 | 14 | The Raspberry Pi now has internet access, allowing it to download software. 15 | 16 | ### Step 3. ssh in the openwrt device 17 | To ssh your Raspberry Pi use below command (make sure Raspberry Pi is connected to your computer using RJ45 cable): 18 | ```sh 19 | ssh root@192.168.1.1 20 | ``` 21 | ### Step 4. Install the required packages 22 | ```sh 23 | opkg update 24 | opkg install cfdisk resize2fs tune2fs 25 | ``` 26 | ### Step 5. Resize the partition 27 | ```sh 28 | cfdisk /dev/mmcblk0 29 | ``` 30 | Now Resize the /dev/mmcblk0p2 partition (enter desired space). After this write the changes and quit. 31 | ```sh 32 | reboot 33 | ``` 34 | ### Step 6. remount root as RO (if fails, reboot and remount as ro again) 35 | ```sh 36 | mount -o remount,ro / 37 | ``` 38 | ### Step 7. Remove reserved GDT blocks 39 | ```sh 40 | tune2fs -O^resize_inode /dev/mmcblk0p2 41 | fsck.ext4 /dev/mmcblk0p2 42 | ``` 43 | (This might probably fail, doesn't seem to affect anything though) 44 | ```sh 45 | reboot 46 | ``` 47 | ### Step 8. Resize the f2fs filesystem 48 | ```sh 49 | resize2fs /dev/mmcblk0p2 50 | ``` 51 | ### Step 9. Check new root partition size with: 52 | ```sh 53 | df –h 54 | ``` 55 | This will successfully increase your storage. 56 | 57 | ## License 58 | **Free Software, Hell Yeah!** 59 | 60 | ## Authors 61 | - [Rahul Gupta](https://github.com/rahulelex) 62 | --------------------------------------------------------------------------------