Custom Search

Wednesday, March 12, 2014

Cubietruck Lubuntu Desktop Server SD Card Installation

http://docs.cubieboard.org/tutorials/ct1/installation/install_lubuntu_desktop_server_to_sd_card


1)
$ sudo fdisk -l

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x847a942a

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1  1953525167   976762583+  ee  GPT

Disk /dev/sdb: 15.9 GB, 15931539456 bytes
64 heads, 32 sectors/track, 15193 cylinders, total 31116288 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/sdb doesn't contain a valid partition table
$



2)
Cleaning SD Card
==================


$ card=/dev/sdb
$
$
$ echo $card
/dev/sdb
$
$
$ sudo dd if=/dev/zero of=${card} bs=1024 seek=544 count=128
128+0 records in
128+0 records out
131072 bytes (131 kB) copied, 0.0847697 s, 1.5 MB/s
$
3)
Make Bootable SD Card
=======================

$
$ ls
bootfs-part1.tar.gz  doc.txt  doc.txt~  rootfs-part2.tar.gz  u-boot-sunxi-with-spl-ct-20131102.bin
$
$
$sudo dd if=u-boot-sunxi-with-spl-ct-20131102.bin of=$card bs=1024 seek=8
254+1 records in
254+1 records out
260260 bytes (260 kB) copied, 0.0836902 s, 3.1 MB/s
$
$

4)
Partitioning
==============

$
$sudo fdisk $card
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xdc9d3115.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help):


m

l

n


Command (m for help):
Command (m for help):
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-31116287, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-31116287, default 31116287): 133119
Command (m for help):
Command (m for help):
Command (m for help):


Command (m for help):
Command (m for help):
Command (m for help):
Command (m for help): n
Partition type:
   p   primary (1 primary, 0 extended, 3 free)
   e   extended
Select (default p):
Using default response p
Partition number (1-4, default 2):
Using default value 2
First sector (133120-31116287, default 133120):
Using default value 133120
Last sector, +sectors or +size{K,M,G} (133120-31116287, default 31116287):
Using default value 31116287

Command (m for help):
Command (m for help):
Command (m for help):
Command (m for help):
Command (m for help):
Command (m for help):
Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 22: Invalid argument.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
$
$
$ sudo fdisk -l
WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x847a942a

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1  1953525167   976762583+  ee  GPT

Disk /dev/sdb: 15.9 GB, 15931539456 bytes
64 heads, 32 sectors/track, 15193 cylinders, total 31116288 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xdc9d3115

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048      133119       65536   83  Linux
/dev/sdb2          133120    31116287    15491584   83  Linux
$
$
$

----------------- remove memory card and reinsert -------------------

$
$
$sudo mkfs.ext2 ${card}1
mke2fs 1.42.8 (20-Jun-2013)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
16384 inodes, 65536 blocks
3276 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67108864
8 block groups
8192 blocks per group, 8192 fragments per group
2048 inodes per group
Superblock backups stored on blocks:
    8193, 24577, 40961, 57345

Allocating group tables: done                           
Writing inode tables: done                           
Writing superblocks and filesystem accounting information: done
$
$
$
$sudo mkfs.ext4 ${card}2mke2fs 1.42.8 (20-Jun-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
969136 inodes, 3872896 blocks
193644 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=3967811584
119 block groups
32768 blocks per group, 32768 fragments per group
8144 inodes per group
Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208

Allocating group tables: done                           
Writing inode tables: done                           
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information:       
done
$
$
$

5)
Copying
=========

$
$ mkdir /tmp/sdd1 /tmp/sdd2
$
$
$ sudo mount -t ext2 ${card}1 /tmp/sdd1
$
$
$ ls /tmp/sdd1
lost+found
$
$
$ ls -a /tmp/sdd1
.  ..  lost+found
$
$
$ sudo mount -t ext4 ${card}2 /tmp/sdd2
$
$
$ ls -a /tmp/sdd2
.  ..  lost+found
$
$
$ sudo tar -C /tmp/sdd1 -xvf bootfs-part1.tar.gz
script.bin
uEnv.txt
uImage
$
$
$ sudo tar -C /tmp/sdd2 -xvf rootfs-part2.tar.gz
bin/
bin/cpio
bin/open
bin/gunzip
bin/chvt
.....
.....
.....

$
$
$ sync
$
$
$ sudo umount /tmp/sdd1
$
$
$ sudo umount /tmp/sdd2
$
$

2 comments:

  1. How to create Partitions in SD card
    ------------------------
    sudo fdisk -l
    card=/dev/sdb
    sudo fdisk $card
    Command (m for help): p <-- Print All Partitions
    Command (m for help): d <-- Delete a Partion
    Command (m for help): p <-- Print All Partitions
    Command (m for help): n <-- add a new partition
    Command (m for help): w <-- write table to disk and exit
    Command (m for help): q <-- quit without saving changes

    ReplyDelete
  2. Do you have sdcard android image for cubietruck? Thanks.

    ReplyDelete