cubieplayer / Cubian

Debian for Cubieboard
http://cubian.org
270 stars 49 forks source link

Move root to HDD #407

Open jarain78 opened 9 years ago

jarain78 commented 9 years ago

Hi all I have a question. is It possible to move the root (Cubian) of nand to HDD?

Tanks

DavidKoenig commented 9 years ago

It should be possible. Here a tutorial for moving from sd to hdd but should also work in the same way for nand if you adjust the paths.

  1. Get the path of your sd and your hdd with sudo fdisk -l (hdd would be usually sda, sd would be mmcblk0p1 and mmcblk0p2)
  2. Create a primary partition on your hdd with sudo fdisk /dev/sda. Example for the output: Command (m for help): n Partition type: p primary (0 primary, 0 extended, 4 free) e extended Select (default p): p Partition number (1-4, default 1): Using default value 1 First sector (2048-156301487, default 2048): Using default value 2048 Last sector, +sectors or +size{K,M,G} (2048-156301487, default 156301487): Using default value 156301487
  3. Create ext4 filesystem: sudo mkfs.ext4 /dev/sda1
  4. Move rootfs to hdd: sudo dd if=/dev/mmcblk0p2 of=/dev/sda1 bs=1M
  5. Sync: sudo sync
  6. Edit: sudo nano /boot/uEnv.txt --> the following line from: root=/dev/mmcblk0p2 rootwait to root=/dev/sda1 rootwait
  7. Reboot: sudo reboot
  8. Resize: sudo resize2fs /dev/sda1

If you speek german you can also have a look at this: Maffert

jarain78 commented 9 years ago

Hi, thanks for your answer. I solved my problem thanks to your help. :)

eravion commented 9 years ago

Hello, For information, you forgot to change /etc/fstab file Replace this line : /dev/mmcblk0p2 / ext4 defaults 0 1 by this one : /dev/sda1 / ext4 defaults 0 1