Rough exact steps . . .

*On X86 development machine:*
william@eee-pc:~$ cd backup/
william@eee-pc:~/backup$ wget
https://rcn-ee.com/rootfs/bb.org/testing/2016-06-19/console/BBB-blank-debian-8.5-console-armhf-2016-06-19-2gb.img.xz

william@eee-pc:~/backup$ 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  29.8G  0 disk
└─sdb1   8:17   1  29.8G  0 part

william@eee-pc:~/backup$ xzcat
BBB-blank-debian-8.5-console-armhf-2016-06-19-2gb.img.xz | sudo dd
of=/dev/sdb
3481600+0 records in
3481600+0 records out
1782579200 bytes (1.8 GB) copied, 500.677 s, 3.6 MB/s

*On Beaglebone:*

*Backup eMMC:*
william@beaglebone:~$ lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
mmcblk1boot0 179:16   0    2M  1 disk
mmcblk1boot1 179:24   0    2M  1 disk
mmcblk0      179:0    0 14.7G  0 disk
`-mmcblk0p1  179:1    0  1.7G  0 part /
mmcblk1      179:8    0  3.6G  0 disk
|-mmcblk1p1  179:9    0   96M  0 part
`-mmcblk1p2  179:10   0  3.5G  0 part

william@beaglebone:~$ ls
am33xx-pruss-uio.dts  dev  remove-modules.sh  temp

william@beaglebone:~$ cd dev/
william@beaglebone:~/dev$ ls
C  beaglebone_cleanup  bonejs  dtb-4.4-ti  dtb-single  javascript  misc
test-dts

william@beaglebone:~/dev$ mkdir backup-emmc
william@beaglebone:~/dev$ cd backup-emmc/

*This is an NFS share, so will take a while.*
william@beaglebone:~/dev/backup-emmc$ time sudo dd if=/dev/mmcblk1
of=./2016-07-27-emmc_backup.img bs=1M
[sudo] password for william:
3688+0 records in
3688+0 records out
3867148288 bytes (3.9 GB) copied, 451.522 s, 8.6 MB/s

real    7m36.950s
user    0m0.252s
sys     1m5.144s

william@beaglebone:~/dev/backup-emmc$ sudo halt






*At this point remove the sdcard from the x86 dev machine, and place into
the Beaglebone. Then toggle the power button.If you have a serial debug
cable connected to the beaglebone, you can watch the progress of the
flasher. This should finish very quickly. Once the LEDs all go solid, the
board is in the process of shutting down. Let all LEDs go off, and stay off
before removing the sdcard and attempting to boot from eMMC. Once booted
from eMMC on the Beaglebone you can login via the serial debug terminal. Or
you can login via ssh.*

debian@beaglebone:~$ lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
mmcblk0boot0 179:8    0    2M  1 disk
mmcblk0boot1 179:16   0    2M  1 disk
mmcblk0      179:0    0  3.6G  0 disk
`-mmcblk0p1  179:1    0  3.6G  0 part /

debian@beaglebone:~$ uname -r
4.4.12-ti-r31

debian@beaglebone:~$ cat /etc/dogtag
BeagleBoard.org Debian Image 2016-06-19



*Knowing the contents pf /etc/fstab will be helpful at this point. Although
I plan on mounting the eMMC as device namenot by UUID. So I may as well
double check that this will work by changing it now.*
debian@beaglebone:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
UUID=a84daf59-1ce7-4cf8-af6f-b50652ab71a9  /  ext4
noatime,errors=remount-ro  0  1
debugfs  /sys/kernel/debug  debugfs  defaults  0  0

debian@beaglebone:~$ mount |grep mmcblk
/dev/mmcblk0p1 on / type ext4 (rw,noatime,errors=remount-ro,data=ordered)

debian@beaglebone:~$ sudo nano /etc/fstab
Change to:
# /etc/fstab: static file system information.
#
/dev/mmcblk0p1  /  ext4  noatime,errors=remount-ro  0  1
debugfs  /sys/kernel/debug  debugfs  defaults  0  0

debian@beaglebone:~$ sudo reboot



*At this point you'll likely see some errors about fsck having issues with
various disk properties. These should besafe to ignore. Now would be the
time to make additional changes if you wish to save the contents of the
eMMC forfuture use. Personally, I need to mount and nfs share so I can now
backup the eMMC via dd.*

debian@beaglebone:~$ sudo nano /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        address 192.168.254.167
        netmask 255.255.255.0
        gateway 192.168.2254.254

debian@beaglebone:~$ sudo ifdown eth0
debian@beaglebone:~$ sudo ifup eth0

debian@beaglebone:~$ sudo apt-get update
debian@beaglebone:~$ sudo apt-get install nfs-common rpcbind

debian@beaglebone:~$ mkdir dev
debian@beaglebone:~$ sudo mount -o v3 192.168.254.162:/home/william/share
/home/debian/dev
debian@beaglebone:~$ df -h
Filesystem                           Size  Used Avail Use% Mounted on
udev                                  10M     0   10M   0% /dev
tmpfs                                 99M  4.3M   95M   5% /run
/dev/mmcblk0p1                       3.5G  367M  3.0G  11% /
tmpfs                                247M     0  247M   0% /dev/shm
tmpfs                                5.0M     0  5.0M   0% /run/lock
tmpfs                                247M     0  247M   0% /sys/fs/cgroup
192.168.254.162:/home/william/share  136G   51G   79G  39% /home/debian/dev


*hmmm, a lot of work to do on this image. So maybe I'll bypass doing a
backup.*
debian@beaglebone:~$ sudo halt
[ 4676.329564] reboot: System halted

Switched back to sdcard:

william@beaglebone:~$ lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
mmcblk1boot0 179:16   0    2M  1 disk
mmcblk1boot1 179:24   0    2M  1 disk
mmcblk0      179:0    0 14.7G  0 disk
`-mmcblk0p1  179:1    0  1.7G  0 part /
mmcblk1      179:8    0  3.6G  0 disk
`-mmcblk1p1  179:9    0  3.6G  0 part
william@beaglebone:~$ ls /
ID.txt  boot  etc   lib         media  nfs-uEnv.txt  opt   root  sbin  sys
uEnv.txt  var
bin     dev   home  lost+found  mnt    node_modules  proc  run   srv   tmp
usr

william@beaglebone:~$ ls /media/
william@beaglebone:~$ sudo mkdir /media/rootfs

william@beaglebone:~$ sudo mount /dev/mmcblk1p1 /media/rootfs/
william@beaglebone:/media/rootfs$ sudo rm -rf /media/rootfs/
william@beaglebone:~$ ls /media/rootfs/ /* Crickets . . . */

*Switched to x86 dev machine:*

william@eee-pc:~$ ls cleanup/downloads/linux-images/
bone-debian-7.7-console-armhf-2014-11-19-2gb.img
bone-debian-8.0-console-armhf-2015-05-04-2gb.img
bone-debian-7.8-console-armhf-2015-03-01-2gb.img  v3.8.13-bone47

william@eee-pc:~$ sudo fdisk -lu
cleanup/downloads/linux-images/bone-debian-7.8-console-armhf-2015-03-01-2gb.img

Disk
cleanup/downloads/linux-images/bone-debian-7.8-console-armhf-2015-03-01-2gb.img:
1782 MB, 1782579200 bytes
184 heads, 31 sectors/track, 610 cylinders, total 3481600 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


Device Boot      Start         End      Blocks   Id  System
cleanup/downloads/linux-images/bone-debian-7.8-console-armhf-2015-03-01-2gb.img1
*        2048     3481599     1739776   83  Linux

*offset= 512 * 2048 or sector size * start*
william@eee-pc:~$ sudo mount -o loop,offset=1048576
cleanup/downloads/linux-images/bone-debian-7.8-console-armhf-2015-03-01-2gb.img
/media/rootfs/

william@eee-pc:~$ cd /media/rootfs/
william@eee-pc:/media/rootfs$ ls
bin   dev  home    lib         media  nfs-uEnv.txt  proc  run   selinux
sys  uEnv.txt       usr
boot  etc  ID.txt  lost+found  mnt    opt           root  sbin  srv
tmp  uEnv.txt.save  var

william@eee-pc:/media/rootfs$ cat etc/dogtag
BeagleBoard.org Debian Image 2015-03-01

william@eee-pc:/media/rootfs$ sudo tar -zcvpf ~/test-rootfs.tar.gz .
william@eee-pc:/media/rootfs$ cd ~
william@eee-pc:~$ sudo umount /media/rootfs/
william@eee-pc:~$ mv test-rootfs.tar.gz share/

*switch back to beaglebone:*
william@beaglebone:~$ cd dev/
william@beaglebone:~/dev$ ls | grep rootfs
test-rootfs.tar.gz

william@beaglebone:~/dev$ sudo tar xzvf ./test-rootfs.tar.gz -C
/media/rootfs/
william@beaglebone:~/dev$ ls /media/rootfs/
ID.txt  boot  etc   lib         media  nfs-uEnv.txt  proc  run   selinux
sys  uEnv.txt       usr
bin     dev   home  lost+found  mnt    opt           root  sbin  srv
tmp  uEnv.txt.save  var

william@beaglebone:~$ cd /media/rootfs/
william@beaglebone:/media/rootfs$ cat etc/fstab
# /etc/fstab: static file system information.
#
# Auto generated by RootStock-NG: setup_sdcard.sh
#
/dev/mmcblk0p1  /  ext4  noatime,errors=remount-ro  0  1
debugfs  /sys/kernel/debug  debugfs  defaults  0  0

*Looks good.*

william@beaglebone:/media/rootfs$ cat etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        address 192.168.254.167
        netmask 255.255.255.0
        gateway 192.168.254.254

william@beaglebone:/media/rootfs$ cat etc/resolv.conf
nameserver 192.168.254.254

william@beaglebone:/media/rootfs$ head boot/uEnv.txt
#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0

uname_r=3.8.13-bone70
#dtb=
cmdline=root=/dev/mmcblk0p1

##Example
#cape_disable=capemgr.disable_partno=
#cape_enable=capemgr.enable_partno=

william@beaglebone:/media/rootfs$ cd ~
william@beaglebone:~$ sudo umount /media/rootfs/

william@beaglebone:~/dev$ sudo halt

*Remove sdcard and toggle the power button.*
debian@beaglebone:~$ uname -r
3.8.13-bone70
debian@beaglebone:~$ cat /etc/dogtag
BeagleBoard.org Debian Image 2015-03-01

debian@beaglebone:~$ lsblk
NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
mmcblk0boot0 179:8    0     2M  1 disk
mmcblk0boot1 179:16   0     2M  1 disk
mmcblk0      179:0    0   3.6G  0 disk
`-mmcblk0p1  179:1    0   3.6G  0 part /

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CALHSORpu803xiVbQZ_fVoye5CVZ3OZSb%3DNAvmLXkC%2B%3DwdofVgQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to