Booting from SATA and expand Partition

Discussion in 'General Discussion' started by fjubuu, Apr 5, 2015.

  1. fjubuu

    fjubuu New Member

    Joined:
    Oct 16, 2014
    Messages:
    1
    Likes Received:
    0
    I wanted to boot into sata and use all of this space and i written down my expierience here.
    Maybe someone can use this.

    OK i bought me a "OCZ Vector SSD 256GB" and connected the sata "sata data cable" and "sata power cable".

    A Description is here http://makeitbreakitfixit.com/2014/03/19/diy-complete-media-system-part-2-hardware-and-os/ available.
    I choosed a another way but that doesnt matter.

    First i am booting in the "MMC" and configure the u-boot-prozess via Envoirment-Variables.

    This is the example do not refer to this output.
    Code:
    baudrate=115200
    boot=echo No boot source specified
    bootargs_base=setenv bootargs console=ttymxc0,115200
    bootargs_nfs=setenv bootargs $(bootargs) root=/dev/nfs ip=dhcp nfsroot=$(serverip):$(nfsrootfs),v3,tcp
    bootcmd=run ${src}boot; run sataboot; run mmcboot; run netboot; 
    bootcmd_net=run bootargs_base bootargs_mtd bootargs_nfs; tftpboot 0x81000000 uImage-mx31; bootm
    bootdelay=5
    console=ttymxc1
    ethact=FEC
    ethaddr=00:c0:08:88:9c:ce
    ethprime=FEC
    get_cmd=ntp
    ipaddr=dhcp
    loadaddr=0x12000000
    memory=fbmem=24M gpu_reserved=128M
    mmcargs=setenv bootargs console=${console},${baudrate} root=${mmcroot} ${hdmi_patch} ${memory} ${video}
    mmcboot=if mmc rescan; then echo Booting from mmc ...; run mmcloaduimage; run mmcargs; bootm; else mmc boot failed; fi
    mmcdev=0
    mmcloaduimage=ext2load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}
    mmcpart=1
    mmcroot=/dev/mmcblk0p1 rootwait rw
    netargs=setenv bootargs console=${console},${baudrate} root=/dev/nfs ${hdmi_patch} ${memory} ${video} ip=${ipaddr} nfsroot=${serverip}:${nfsroot},v3,tcp
    netboot=echo Booting from net ...; run netargs; ${get_cmd} ${uimage}; bootm
    nfsroot=/src/nfs4/
    prg_uboot=tftpboot 0x81000000 u-boot-with-spl.bin; nand erase 0x0 0x40000; nand write 0x81000000 0x0 0x40000
    sataargs=setenv bootargs console=${console},${baudrate} root=${sataroot} ${hdmi_patch} ${memory} ${video}
    sataboot=if sata init; then echo Booting from sata ...; run sataloaduimage; run sataargs; bootm; else sata boot failed; fi
    satadev=0
    sataloaduimage=ext2load sata ${satadev}:${satapart} ${loadaddr} ${uimage}
    satapart=1
    sataroot=/dev/sda1 rootwait rw
    serverip=192.168.1.1
    splashpos=m,m
    uimage=/boot/uImage
    video=video=mxcfb0:dev=hdmi,1920x1080M@60,bpp=32
    
    It seems very easy.
    I have only to set the "src" to sata or use the Udoo Configuration Tool to set the Boot Device to "sata".
    Code:
    fw_setenv src=sata
    Attention! I can only do this because i flash the ssd-sata with an Distribution before.
    Example
    Code:
    dcfldd of=/media/usb-stick/udooxx_foo.img if=/dev/sda
    or
    Code:
    dd of=/media/usb-stick/udooxx_foo.img if=/dev/sda
    OK now i am reboot..
    Code:
    sudo reboot
    Now the UDOO boot from the sata disk.

    At this Point i could completly remove or umount the "MMC" but i need the MMC to boot into the sata filesystem.

    Code:
    root@udoo-debian-hfp:~# lsblk -d
    NAME    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
    sda       8:0    0 223.6G  0 disk 
    mmcblk0 179:0    0  14.9G  0 disk 
    
    You see that the "-sda1" run under "sda" Device as root Partition.

    Code:
    sda           8:0    0 223.6G  0 disk 
    `-sda1        8:1    0   6.7G  0 part /
    mmcblk0     179:0    0  14.9G  0 disk 
    `-mmcblk0p1 179:1    0   6.5G  0 part 
    
    Now i have a small Partition of 6GB and i want to expand this to maximum of unallocate space.

    I disonnect the sata and i boot in the "mmc" again.
    Use the Udoo Configuration Tool to set the boot device to "mmc" and plugged in the sata and reboot again.

    Then i turn off the Journal of the ext3 Partition
    Code:
    tune2fs -O ^has_journal /dev/sda1
    and check the filesystem
    Code:
    e2fsck -f /dev/sda1
    Code:
    e2fsck 1.38 (30-Jun-2005)
    Pass 1: Checking inodes, blocks, and sizes
    Pass 2: Checking directory structure
    Pass 3: Checking directory connectivity
    Pass 4: Checking reference counts
    Pass 5: Checking group summary information
    /dev/sda1: 164178/1254176 files (0.6% non-contiguous), 1051617/2504124 blocks 
    i used "gparted" to resize the filesystem that contains my boot-system on sata and click through all "warnings".
    Code:
    debian@udoo-debian-hfp:~ $ sudo df -H
    [sudo] password for debian: 
    Filesystem      Size  Used Avail Use% Mounted on
    rootfs           62G  2.7G   57G   5% /
    /dev/root        62G  2.7G   57G   5% /
    devtmpfs        459M     0  459M   0% /dev
    tmpfs            92M  2.7M   90M   3% /run
    tmpfs           5.3M     0  5.3M   0% /run/lock
    tmpfs           184M     0  184M   0% /run/shm
    /dev/mmcblk0p1  6.9G  2.6G  4.0G  39% /media/UDOObuntu
    Thats all.
     

Share This Page