Starting from a blank sdcard.
william@eee-pc:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 149.1G 0 disk
├─sda1 8:1 0 9.3G 0 part /
├─sda2 8:2 0 1K 0 part
├─sda5 8:5 0 2G 0 part [SWAP]
└─sda6 8:6 0 137.8G 0 part /home
sdb 8:16 1 14.7G 0 disk
william@eee-pc:~$ ls downloads/linux-images/
bone-debian-7.7-console-armhf-2014-11-19-2gb.img
bone-debian-7.8-console-armhf-2015-03-01-2gb.img
bone-debian-8.0-console-armhf-2015-05-04-2gb.img
william@eee-pc:~$ sudo dd if=/home/william/downloads/linux-images/bone-debian-7.8-console-armhf-2015-03-01-2gb.img of=/dev/sdb
3481600+0 records in
3481600+0 records out
1782579200 bytes (1.8 GB) copied, 615.607 s, 2.9 MB/s
Eject sdcard
william@eee-pc:~$ sync
re-insert sdcard
william@eee-pc:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 149.1G 0 disk
├─sda1 8:1 0 9.3G 0 part /
├─sda2 8:2 0 1K 0 part
├─sda5 8:5 0 2G 0 part [SWAP]
└─sda6 8:6 0 137.8G 0 part /home
sdb 8:16 1 14.7G 0 disk
└─sdb1 8:17 1 1.7G 0 part
william@eee-pc:~$ sudo mount /dev/sdb1 /media/rootfs/
[sudo] password for william:
william@eee-pc:~$ df -h /media/rootfs/
Filesystem Size Used Avail Use% Mounted on
/dev/sdb1 1.7G 214M 1.4G 14% /media/rootfs
Eject card
william@eee-pc:~$ sync
Attempt to boot beaglebone from card. As I just happen to know which IP the beaglebone will take from DNS on a fresh install . . .
william@eee-pc:~$ ssh debian@192.168.254.36
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
Please contact your system administrator.
Add correct host key in /home/william/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/william/.ssh/known_hosts:1
ECDSA host key for 192.168.254.36 has changed and you have requested strict checking.
Host key verification failed.
So, wrong ECDSA key, but it’s there, and happily blinking away. Correct way to deal with the problem ? Most definately not, but I do not care . . .
william@eee-pc:~$ rm ~/.ssh/known_hosts
william@eee-pc:~$ ssh debian@192.168.254.36
The authenticity of host ‘192.168.254.36 (192.168.254.36)’ can’t be established.
ECDSA key fingerprint is .
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘192.168.254.36’ (ECDSA) to the list of known hosts.
Debian GNU/Linux 7
BeagleBoard.org Debian Image 2015-03-01
Support/FAQ: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian
default username:password is [debian:temppwd]
debian@192.168.254.36’s password:
debian@beaglebone:~$
Ok all good, but while I’m here going to take care of g_ether.[EDIT] But not very well as you can see I forgot to edit /etc/network/interfaces as well, and did not edit uEnv.txt to get rid of systemd as I usually do . . .
debian@beaglebone:~$ sudo nano /etc/modules
—>g_ether
debian@beaglebone:~$ sudo shutdown now -h
Broadcast message from root@beaglebone (pts/0) (Sun Mar 1 21:36:59 2015):
The system is going down for system halt NOW!
Eject sdcard from the beaglebone, and put back into Linux workstation.
william@eee-pc:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 149.1G 0 disk
├─sda1 8:1 0 9.3G 0 part /
├─sda2 8:2 0 1K 0 part
├─sda5 8:5 0 2G 0 part [SWAP]
└─sda6 8:6 0 137.8G 0 part /home
sdb 8:16 1 14.7G 0 disk
└─sdb1 8:17 1 1.7G 0 part
Backup MBR
william@eee-pc:~$ sudo dd if=/dev/sdb of=/home/william/mbr-sdb.bak bs=1M count=1
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.0680266 s, 15.4 MB/s
Backup rootfs
william@eee-pc:~$ sudo mount /dev/sdb1 /media/rootfs/
william@eee-pc:~$ cd /media/rootfs/
william@eee-pc:/media/rootfs$ sudo tar -zcvf ~/backup/rootfs.tar.gz .
william@eee-pc:/media/rootfs$ cd ~
william@eee-pc:~$ sudo umount /media/rootfs/
Wipe out the MBR, and partition table RCN style
william@eee-pc:~$ sudo dd if=/dev/zero of=/dev/sdb bs=1M count=10
10+0 records in
10+0 records out
10485760 bytes (10 MB) copied, 0.737684 s, 14.2 MB/s
Copy MBR ( MLO / uboot.img ) to disk.
william@eee-pc:~$ sudo dd if=/home/william/mbr-sdb.bak of=/dev/sdb bs=512k count=1
1+0 records in
1+0 records out
524288 bytes (524 kB) copied, 0.0429171 s, 12.2 MB/s
Check sfdisk version.
william@eee-pc:/media/rootfs$ sudo sfdisk --version
sfdisk from util-linux 2.20.1
Create new partition with sfdisk
william@eee-pc:~$ sudo sfdisk --in-order --Linux --unit M /dev/sdb <<-EOF
> 1,1000,0x83,*
> EOF
Checking that no-one is using this disk right now …
OK
Disk /dev/sdb: 14991 cylinders, 64 heads, 32 sectors/track
sfdisk: ERROR: sector 0 does not have an msdos signature
/dev/sdb: unrecognized partition table type
Old situation:
No partitions found
New situation:
Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End MiB #blocks Id System
/dev/sdb1 * 1 1000 1000 1024000 83 Linux
/dev/sdb2 0 - 0 0 0 Empty
/dev/sdb3 0 - 0 0 0 Empty
/dev/sdb4 0 - 0 0 0 Empty
Successfully wrote the new partition table
Re-reading the partition table …
If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)
Create file system ( format ) the new partition.
william@eee-pc:~$ sudo mkfs.ext4 /dev/sdb1
mke2fs 1.42.5 (29-Jul-2012)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
64000 inodes, 256000 blocks
12800 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=264241152
8 block groups
32768 blocks per group, 32768 fragments per group
8000 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376
Allocating group tables: done
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done
Copy over rootfs
william@eee-pc:~$ sudo mount /dev/sdb1 /media/rootfs/
william@eee-pc:~$ sudo tar xzvf ~/backup/rootfs.tar.gz -C /media/rootfs
Eject sdcard
william@eee-pc:~$ sync
Place sdcard into beaglebone, and attempt to boot. Then pray to the UNIX gods you did not do something silly like me . . . Like trying to substitute Kilobytes with Bytes in dd . . .
william@eee-pc:~$ ssh debian@192.168.254.36
Debian GNU/Linux 7
BeagleBoard.org Debian Image 2015-03-01
Support/FAQ: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian
default username:password is [debian:temppwd]
debian@192.168.254.36’s password:
Last login: Sun Mar 1 21:34:48 2015 from 192.168.254.162
debian@beaglebone:~$ uname -r
3.8.13-bone70
debian@beaglebone:~$ cat /etc/dogtag
BeagleBoard.org Debian Image 2015-03-01
debian@beaglebone:~$ df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/mmcblk0p1 969M 181M 738M 20% /
whew