July 05, 2020, 12:32:36 pm

News:

Have you visited the Allwinner Chipset wiki? - http://linux-sunxi.org/


Free space missing from 2.5" HDD with cubietruck

Started by hwatari, November 07, 2013, 10:59:14 am

Previous topic - Next topic

hwatari

November 07, 2013, 10:59:14 am Last Edit: November 07, 2013, 11:00:50 am by hwatari
Hi,

I just bought a cubietruck and installed lubuntu on 1TB 2.5" HDD.
But file manager says the size of my rootfs is only 2GB with only 700MB of free space.
I followed the instructions given in resources->tutorials->cubietruck->moving_rootfs_from_nand_flash_to_hdd.
Am I missing something in more ways than one ?

Thanks,
Hiromichi

patwood

The images have fixed size partitions designed to fit on SD cards (typically 4 or 8GB).  You need to run gparted to extend the partition and expand the file system to fit it.

milkboy007

Quote from: patwood on November 07, 2013, 06:35:45 pm
The images have fixed size partitions designed to fit on SD cards (typically 4 or 8GB).  You need to run gparted to extend the partition and expand the file system to fit it.

that means use gparted on another LINUX computer to resize the hdd
you can use the cubieboard(via sd/nand) to do it, as long as the hdd isnt being use to boot the CB.

hwatari

Hi patwood and milkboy007,

Thank you for your reply.
I tried running gparted after booting from NAND on the cubietruck but wasn't successful,
it got stuck during update stage.
I'll try again and keep you guys posted on the development.

Thanks,
Hiromichi

patwood

Quote from: milkboy007 on November 08, 2013, 04:05:23 am
Quote from: patwood on November 07, 2013, 06:35:45 pm
The images have fixed size partitions designed to fit on SD cards (typically 4 or 8GB).  You need to run gparted to extend the partition and expand the file system to fit it.

that means use gparted on another LINUX computer to resize the hdd
you can use the cubieboard(via sd/nand) to do it, as long as the hdd isnt being use to boot the CB.


Actually, resize2fs (and presumably gparted) will expand a mounted file system just fine, as it doesn't need to move any data around and can perform atomic updates to the fs metadata.

hwatari

Update:

I finally succeeded in reclaiming all the space in my 2.5" HDD, steps are as follows.

1) create a partition in HDD just large enough (in my case 2GB) to accommodate rootfs from NAND (I believe that any extra space will be lost, is this correct ? patwood, milkboy007)
2) dd to copy rootfs from NAND to the partition
3) run gparted to expand the partition to cover the entire disk
4) edit uEnv.txt in /dev/nanda to use /dev/sda1 as nand_root

The problem I had was exasperated by the fact that gparted was new to me.

Thanks to patwood and milkboy007.

Hiromichi

patwood

Gparted is smart enough to preserve existing partitions, even move them around to free up contiguous space, but it has to be able to unmount partitions to move them.

Also, while dd will usually work for what you did (gparted will run fsck on the new file system), it's better to do this with a unmounted file system.  If you're copying a mounted fs, rsync is safer.

HLFH

With CubieTruck, when I boot on sda1, when I have done a resizefs with sda1 mounted as root, the router assigned on DHCP my CubieTruck as "unknown". I think the error may be due to resizefs and the sda1 which is mounted.