Please enable javascript, or click here to visit my ecommerce web site powered by Shopify.
Jump to: navigation, search

Difference between revisions of "Rock/resize linux rootfs"

(Created page with "The default size of lubuntu firmware's roofts is about 2.0G, it's too small, you can do as follows to expends it 1: For Nand image If you flash the image on nand flash, you c...")
 
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The default size of lubuntu firmware's roofts is about 2.0G, it's too small, you can do as follows to expends it
+
{{rock_header}}
 +
{{Languages| rock/resize_linux_rootfs}}
  
1: For Nand image
+
'''The default size of lubuntu firmware's roofts is about 2.0G, it's too small, you can do as follows to expends it.
 +
'''But there are two kinds of firmware, one is for nand,and another one is for sdcard. So you should use different method to do it'''
 +
 
 +
 +
==For Nand image==
 
If you flash the image on nand flash, you can execute the below command on the terminal  in the board's lubuntu system
 
If you flash the image on nand flash, you can execute the below command on the terminal  in the board's lubuntu system
 
        
 
        
   "resize2fs /dev/block/mtd/by-name/linux-root "
+
   resize2fs /dev/block/mtd/by-name/linux-root
  
 
to expand the rootfs
 
to expand the rootfs
 
   
 
   
  
2: For sdcard image
+
==For sdcard image==
  
If you use the sdcard's image, you should put the sdcard into  a card reader ,and put the card reader into PC and resize the partations
+
There are two methods to do this
  
1: For PC with Linux
+
==On board  run the script ==
 +
 
 +
Note:
 +
 
 +
a) need root permission
 +
 
 +
b) need execute "resize2fs  /dev/mmcblk0p1" after reboot (refer to the script below)
 +
 
 +
 
 +
#!/bin/bash
 +
START_SECTOR=`cat /sys/block/mmcblk0/mmcblk0p1/start`
 +
fdisk /dev/mmcblk0  << EOF
 +
d
 +
n
 +
p
 +
1
 +
$START_SECTOR
 +
 
 +
w
 +
 +
EOF
 +
 +
echo -e "\n\n\n
 +
\n============================================================"
 +
echo "!!!!!expands rootfs done! reboot system"
 +
echo "!!!!!and run command "resize2fs  /dev/mmcblk0p1"  after reboot"
 +
echo -e "=============================================================\n\n\n"
 +
 
 +
 
 +
 
 +
== On pc ,use  tools to resize the partations ==
 +
 
 +
 
 +
you should put the sdcard into  a card reader ,and put the card reader into PC and resize the partations
 +
 
 +
 
 +
a) For PC with Linux
  
 
Use gparted   
 
Use gparted   
  
#sudo gparted  /dev/sdb
+
#sudo gparted  /dev/sdb
  
 
[[File:wiki_resize_sd_1.jpg]]
 
[[File:wiki_resize_sd_1.jpg]]
 +
 +
Selete the partation of rootfs, change the size by input the new number or change the square frame by mouse
  
 
[[File:wiki_resize_sd_2.jpg]]
 
[[File:wiki_resize_sd_2.jpg]]
  
[[File:wiki_resize_sd_3.jpg]]
+
unplug the reader and input the sdcard  into board and reboot. you will see the rootfs's size has been changed
 +
 
 +
b) For PC with windows
  
2: For PC with windows
+
//No useful methods has found.

Latest revision as of 04:20, 6 January 2015

The default size of lubuntu firmware's roofts is about 2.0G, it's too small, you can do as follows to expends it. But there are two kinds of firmware, one is for nand,and another one is for sdcard. So you should use different method to do it


For Nand image

If you flash the image on nand flash, you can execute the below command on the terminal in the board's lubuntu system

 resize2fs /dev/block/mtd/by-name/linux-root

to expand the rootfs


For sdcard image

There are two methods to do this

On board run the script

Note:

a) need root permission

b) need execute "resize2fs /dev/mmcblk0p1" after reboot (refer to the script below)


#!/bin/bash
START_SECTOR=`cat /sys/block/mmcblk0/mmcblk0p1/start`
fdisk /dev/mmcblk0  << EOF
d
n
p
1
$START_SECTOR
 
w

EOF

echo -e "\n\n\n
\n============================================================"
echo "!!!!!expands rootfs done! reboot system"
echo "!!!!!and run command "resize2fs  /dev/mmcblk0p1"  after reboot"
echo -e "=============================================================\n\n\n"


On pc ,use tools to resize the partations

you should put the sdcard into a card reader ,and put the card reader into PC and resize the partations


a) For PC with Linux

Use gparted

#sudo gparted  /dev/sdb

Wiki resize sd 1.jpg

Selete the partation of rootfs, change the size by input the new number or change the square frame by mouse

Wiki resize sd 2.jpg

unplug the reader and input the sdcard into board and reboot. you will see the rootfs's size has been changed

b) For PC with windows

//No useful methods has found.