User Tools

  • (equal to forum credentials)

Site Tools


installation_usb

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

installation_usb [2014/06/24 01:13]
curlymo
installation_usb [2015/10/18 19:19] (current)
abdulmueid Added troubleshooting for external devices with long spin up times on boot.
Line 18: Line 18:
 <​code>​ <​code>​
 root@pi:~# sudo -i root@pi:~# sudo -i
-root@pi:~# blkid -s UUID -o value /dev/root+root@pi:~# blkid -s UUID -o value /dev/sda1
 240d84e4-dd44-42df-b31e-fe4f492b5cce 240d84e4-dd44-42df-b31e-fe4f492b5cce
 </​code>​ </​code>​
Line 24: Line 24:
 <​code>​ <​code>​
 root@pi:~# sudo -i root@pi:~# sudo -i
-root@pi:~# blkid -s LABEL -o value /dev/root+root@pi:~# blkid -s LABEL -o value /dev/sda1
 xbian-copy xbian-copy
 </​code>​ </​code>​
Line 60: Line 60:
   * change ''​LABEL=xbian-root-btrfs''​ to ''​root=/​dev/​sda1''​ and remove the ''​subvol=root/​@,''​ from the ''/''​ entry.   * change ''​LABEL=xbian-root-btrfs''​ to ''​root=/​dev/​sda1''​ and remove the ''​subvol=root/​@,''​ from the ''/''​ entry.
   * Then edit the ''/​boot/​cmdline.txt''​ and\\ change ''​LABEL=xbian-root-btrfs''​ to ''​root=/​dev/​sda1''​\\ remove ''​subvol=root/​@''​\\ change ''​mod_scsi.scan=async''​ to ''​mod_scsi.scan=sync''​\\ and when needed,\\ increase the number after ''​rootwait='' ​   * Then edit the ''/​boot/​cmdline.txt''​ and\\ change ''​LABEL=xbian-root-btrfs''​ to ''​root=/​dev/​sda1''​\\ remove ''​subvol=root/​@''​\\ change ''​mod_scsi.scan=async''​ to ''​mod_scsi.scan=sync''​\\ and when needed,\\ increase the number after ''​rootwait='' ​
 +
 +
 +
 +==== Procedure for Cubox-i ====
 +1. Unmount external drive and make filesystem:
 +<​code>​
 +sudo umount /dev/sda1
 +sudo mkfs.btrfs -L xbian-usb /dev/sda1
 +</​code>​
 +
 +2. Mount it and copy files from sd-card
 +<​code>​
 +sudo mount /dev/sda1 /mnt
 +sudo rsync -aAX /* /mnt/ --exclude={/​dev/​*,/​proc/​*,/​sys/​*,/​tmp/​*,/​run/​*,/​mnt/​*,/​media/​*,/​lost+found,/​home/​*/​.gvfs} --progress
 +</​code>​
 +
 +3. Edit boot.scr.txt
 +<​code>​
 +sudo nano /​boot/​boot.scr.txt
 +</​code>​
 +
 +change ''​root=/​dev/​mmcblk0p2''​ to ''​root=/​dev/​sda1''​ (or what your partition on the external drive is)
 +remove ''​subvol=root/​@,''​
 +
 +
 +and compile boot.scr with (make backups of both files beforehand - just in case):
 +<​code>​
 +cd /boot; sudo ./mks
 +</​code>​
 +
 +Reboot
 +
 +That's all! 
 +
 +**To use sub volumes again:** (Important for filesystem snapshots)
 +<​code>​
 +sudo -i
 +cd /
 +btrfs sub create ROOT
 +btrfs sub snap / ROOT/@
 +</​code>​
 +
 +and then re add the previous deleted text at the same position: ​
 +<​code>​
 +sudo nano /​boot/​boot.scr.txt
 +</​code>​
 +''​subvol=ROOT/​@,''​
 +and compile it again with: 
 +<​code>​
 +cd /boot; sudo ./mks
 +</​code>​
 +
 +(It's important that ROOT is written the same way as created, in this case in capital letters!)
 +For more informations see: https://​github.com/​xbianonpi/​xbian/​issues/​556
 +
 +==== Troubleshooting ====
 +Some external USB drives such as Seagate Expansion take longer than 10 seconds to spin up on boot, resulting in xbian not identifying the xbian-copy partition in time and results in recovery mode on start up.
 +
 +It is necessary to add appropriate delay in the initramfs script between device initialization and root mounting to resolve this issue.
 +
 +<​code>​
 +xbian@xbian ~ $ sudo nano /​etc/​xbian-initramfs/​init
 +</​code>​
 +
 +Add ''​sleep 10''​ on a new line between ''​up "after modprobe"''​ and ''​INITIALBOOT="​0"''​
 +
 +<​code>​
 +...
 +up "after modprobe"​
 +
 +sleep 10
 +
 +INITIALBOOT="​0"​
 +...
 +</​code>​
 +
 +Adjust the delay from 10 to the appropriate amount needed for your external drive.
 +
 +Now, update the initramfs image:
 +
 +<​code>​
 +xbian@xbian ~ $ sudo xbian-update-initramfs
 +</​code>​
 +
 +The system should now boot from external USB drive properly. The only downside is a few additional seconds wait time during boot up.
installation_usb.1403565206.txt.gz ยท Last modified: 2014/06/24 01:13 by curlymo