首页 > 代码库 > 【cb2】扩展硬盘
【cb2】扩展硬盘
1、硬盘为sata串口
2、参考 http://docs.cubieboard.org/tutorials/ct1/installation/moving_rootfs_from_nandflash_to_hard_drive
Prepeare the drive for rootfs
The drive must have a primary partition (for example with 10 GByte) formated with filesystem "ext4". You can use the Linaro user interface DISK app, gparted or use the following shell commands
list all available drives
#fdisk -l
Choose the drive you want to make changes to (e.g. sda):
#fdisk /dev/sda
use "p" (print partition of a drive), "d" delete a partition or "n" (create new partition). The partition should be of type "83"
Format the partition for rootfs with EXT4 filesystem
#mkfs.ext4 /dev/sda1
Copying Rootfs
We assume that, /dev/sda is the hard drive we want to install
$sudo su - root
#dd if=/dev/nandb of=/dev/sda1 bs=1M
Changing Boot Parameters
$sudo su - root
#mount /dev/nanda /mnt
#vi /mnt/uEnv.txt
Change the contents of uEnv.txt to
root@cubietruck:~# cat /mnt/uEnv.txt
console=tty0
extraargs=console=ttyS0,115200 hdmi.audio=EDID:0 disp.screen0_output_mode=EDID:1280x720p50 rootwait panic=10 rootfstype=ext4 rootflags=discard
nand_root=/dev/sda1
#sync
#umount /mnt
#reboot
3、解决问题
按照官网的方法重启后发现根系统容量2G,但根文件系统的确位于硬盘,容量和分区大小相差很大。
经过咨询
修改 /mnt/uEnv.txt 仍然用nand_root=/dev/nandb 用原flash启动(卸载了sda1 才能resize2fs /dev/sda1)。
resize2fs /dev/sda1
可能会提示一个前置操作,按照提示来。然后resize2fs。
【cb2】扩展硬盘