Forum
[IDEA] Boot XBian from USB - Printable Version

+- Forum (http://forum.xbian.org)
+-- Forum: Software (/forum-6.html)
+--- Forum: Installation (/forum-16.html)
+--- Thread: [IDEA] Boot XBian from USB (/thread-427.html)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28


RE: USB Installation - Fred - 14th Jul, 2013 07:20 AM

The size of the USB stick is probably just some sectors smaller than the SD card, but it probably only failed to copy empty space so that's no problem. I think the copy went just fine.

In the cmdline.txt search for
Code:
root=LABEL=xbian-root-btrfs
and change it to:
Code:
root=/dev/sda1



RE: USB Installation - mk01 - 15th Jul, 2013 08:15 AM

(12th Jul, 2013 01:25 PM)daveski3 Wrote:  I hate to ask noob questions but I have searched all over and cannot find an answer on my own. I installed Xbian to my SD card using the installer and booted xbian. I then ssh into xbian and typed "sudo dd if=/dev/mmcblk0p2 of=/dev/sda1" to copy the root partition to the usb drive. This is the message I got back:

Dave,
don't use dd while copying RW mounted partition.
1) you will with no reason copy 16gb is sdcard size is 16gb, even if xbian has not even 500mb
2) dd makes no atomic copy of filesystem's state
3) UUID and LABEL will be the same => Sad LABEL is possible to change, UUID not so easy

just boot the system, go to terminal and do:
Code:
0) stop xbmc
1) mkfs.btrfs -L xbian-usb /dev/sda1
2) mount /dev/sda1 /mnt
3) rsync -avx —progress / /mnt
4) rsync -avx —progress /home /mnt/home
5) step 3)
6) nano /mnt/etc/fstab :
a) remove line with "/home"
b) change LABEL=xbian-root-btrfs to LABEL=xbian-usb, remove "subvol=root/@," option from "/".
7) edit /boot/cmdline.txt
a) change LABEL the same way as in 6a)
b) change mod_scsi.scan=async to =sync
c) according the need, change number after rootwait=



RE: USB Installation - IriDium - 16th Jul, 2013 02:36 AM

I easily booted off a HDD on Alpha 5 and to be honest didn't notice any real improvement. What I did find is that it would not reboot if I had another USB drive attached! Hard reboot was fine, but would not soft reboot - something to do with the way the disks were allocated.

I haven't tested on Beta 1.1 so it might be Ok, now.


RE: USB Installation - mk01 - 16th Jul, 2013 02:44 AM

(16th Jul, 2013 02:36 AM)IriDium Wrote:  I easily booted off a HDD on Alpha 5 and to be honest didn't notice any real improvement. What I did find is that it would not reboot if I had another USB drive attached! Hard reboot was fine, but would not soft reboot - something to do with the way the disks were allocated.

I haven't tested on Beta 1.1 so it might be Ok, now.

soft reboot you mean "reboot" ? specially as you reported, I have instantly attached sd card in hub with ntfs and wd 1tb as ext4 and can not reproduce this. can you "wget http://ivka57.dyndns-ip.com/a.sh", run it and send me file /tmp/a.tar.gz via email ?


RE: USB Installation - Fred - 16th Jul, 2013 02:53 AM

For me the soft reboot did not work in alpha 5 because the usb drive did not come up fast enough (it was hardcoded to wait 10 seconds).
That is fixed in beta where you can set the rootwait value in cmdline.txt

Maybe that was your problem too IriDium?


RE: USB Installation - mk01 - 16th Jul, 2013 02:59 AM

(16th Jul, 2013 02:53 AM)Fred Wrote:  For me the soft reboot did not work in alpha 5 because the usb drive did not come up fast enough (it was hardcoded to wait 10 seconds).
That is fixed in beta where you can set the rootwait value in cmdline.txt

Maybe that was your problem too IriDium?

ok, I misunderstood? I understand it as running -> issuing reboot -> reboot will "freeze" at the end, will not reboot rpi.


RE: USB Installation - IriDium - 16th Jul, 2013 03:02 AM

(16th Jul, 2013 02:44 AM)mk01 Wrote:  
(16th Jul, 2013 02:36 AM)IriDium Wrote:  I easily booted off a HDD on Alpha 5 and to be honest didn't notice any real improvement. What I did find is that it would not reboot if I had another USB drive attached! Hard reboot was fine, but would not soft reboot - something to do with the way the disks were allocated.

I haven't tested on Beta 1.1 so it might be Ok, now.

soft reboot you mean "reboot" ? specially as you reported, I have instantly attached sd card in hub with ntfs and wd 1tb as ext4 and can not reproduce this. can you "wget http://ivka57.dyndns-ip.com/a.sh", run it and send me file /tmp/a.tar.gz via email ?
MK01 - This was on Aplha5 - I haven't tried on Beta 1.1
Soft reboot = reboot from XBMc or ssh (sudo reboot)
Hard reboot = RPi shut down and restarted.


RE: USB Installation - Fred - 16th Jul, 2013 03:10 AM

So hard reboot=power cycle


RE: USB Installation - IriDium - 16th Jul, 2013 11:50 PM

Well I tried with a fresh Beta 1.1 install.

Did the necessary changes and it booted correctly.

Attached another USB drive - Screen went blank - Xbian logo "XBMC closing". Stayed like that for ages. Had to switch off.

Switched back on with USB Flash (Now the boot) and USB drive (Movies) in HUB.

Black screen.
To dropdown shell.
Loading initram modules.
1 Waiting for root
2 Waiting for root.
FATAL: only the last partition can be reized
Mounting root as mount -t btrfs -o rw.subvol=root/@ noatimr, compress=lzo,threadpool=a,space=cache,autodefrag /dev/sda1 /rootfs
Mounting root partition /dev/sda1 failed.

So it looks like it is the "same" problem as in alpha5.

------------------------------------------------------------

Now trying MK01 solution.


RE: USB Installation - Fred - 17th Jul, 2013 12:00 AM

(15th Jul, 2013 08:15 AM)mk01 Wrote:  just boot the system, go to terminal and do:
Code:
0) stop xbmc
1) mkfs.btrfs -L xbian-usb /dev/sda1
2) mount /dev/sda1 /mnt
3) rsync -avx —progress / /mnt
4) rsync -avx —progress /home /mnt/home
5) step 3)
6) nano /mnt/etc/fstab :
a) remove line with "/home"
b) change LABEL=xbian-root-btrfs to LABEL=xbian-usb, remove "subvol=root/@," option from "/".
7) edit /boot/cmdline.txt
a) change LABEL the same way as in 6a)
b) change mod_scsi.scan=async to =sync
c) according the need, change number after rootwait=

Using the disk label in cmdline.txt won't work for me. It will say root partition LABEL=xbian-usb not found. If i change it to /dev/sda1 it will work.


RE: USB Installation - mk01 - 17th Jul, 2013 12:03 AM

(16th Jul, 2013 11:50 PM)IriDium Wrote:  Black screen.
To dropdown shell.
Loading initram modules.
1 Waiting for root
2 Waiting for root.
FATAL: only the last partition can be reized
Mounting root as mount -t btrfs -o rw.subvol=root/@ noatimr, compress=lzo,threadpool=a,space=cache,autodefrag /dev/sda1 /rootfs
Mounting root partition /dev/sda1 failed.

So it looks like it is the "same" problem as in alpha5.

Works fine without the second USB drive mounted (BTW it's an old IDE, if that makes any difference_

definitely you have mishmash with LABEL or UUID. what the messages on screen mean is, that root= parameter from cmdline was taken and evaluated. partition /dev/sda1 was found as matching. and it tries to mount it with again your parameters from cmdline.txt and it failed.
SO:
post your cmdline.txt and while booted up and attached both disks, post "blkid" output.

i'm almost sure that:
your mmcblk0p2 and sda1 have the same UUID or LABEL which is used in cmdline.txt as root= and mmcblk0p2 iust btrfs, but sda1 is not.

agains my recommendations and warnings about using dd as a tool to copy / create filesystems / backups / etc, nobody really gets the implications.

Wink

if you setup will be OK, i'm prepared to eat cheese (I hate cheese!).


RE: USB Installation - IriDium - 17th Jul, 2013 12:03 AM

(17th Jul, 2013 12:00 AM)Fred Wrote:  
(15th Jul, 2013 08:15 AM)mk01 Wrote:  just boot the system, go to terminal and do:
Code:
0) stop xbmc
1) mkfs.btrfs -L xbian-usb /dev/sda1
2) mount /dev/sda1 /mnt
3) rsync -avx —progress / /mnt
4) rsync -avx —progress /home /mnt/home
5) step 3)
6) nano /mnt/etc/fstab :
a) remove line with "/home"
b) change LABEL=xbian-root-btrfs to LABEL=xbian-usb, remove "subvol=root/@," option from "/".
7) edit /boot/cmdline.txt
a) change LABEL the same way as in 6a)
b) change mod_scsi.scan=async to =sync
c) according the need, change number after rootwait=

Using the disk label in cmdline.txt won't work for me. It will say root partition LABEL=xbian-usb not found. If i change it to /dev/sda1 it will work.
Already on it :-) Just reformatting the cards.. Just posted my last remarks as a reminder.


RE: USB Installation - mk01 - 17th Jul, 2013 12:07 AM

(17th Jul, 2013 12:00 AM)Fred Wrote:  Using the disk label in cmdline.txt won't work for me. It will say root partition LABEL=xbian-usb not found. If i change it to /dev/sda1 it will work.

I smell the cheese Smile)... what version of initramfs
and, it fail immediatelly with first mount attempt, or you get the usuall
wait 1
wait 2
.
.
.
?

I remember the wrong logical expression, which I was fixing, but it was weeks ago Undecided

can you post the same as iridium? I will try to reproduce then.


RE: USB Installation - IriDium - 17th Jul, 2013 12:31 AM

(17th Jul, 2013 12:07 AM)mk01 Wrote:  
(17th Jul, 2013 12:00 AM)Fred Wrote:  Using the disk label in cmdline.txt won't work for me. It will say root partition LABEL=xbian-usb not found. If i change it to /dev/sda1 it will work.

I smell the cheese Smile)... what version of initramfs
and, it fail immediatelly with first mount attempt, or you get the usuall
wait 1
wait 2
.
.
.
?

I remember the wrong logical expression, which I was fixing, but it was weeks ago Undecided

can you post the same as iridium? I will try to reproduce then.

Same problem as me, except changing it to /dev/sda1 didn't work.


RE: USB Installation - Fred - 17th Jul, 2013 12:43 AM

I also removed subvol=root/@ from rootopts in cmdline.txt