Forum

Full Version: Boot XBian from USB
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
(17th Jul, 2013 12:43 AM)Fred Wrote: [ -> ]I also removed subvol=root/@ from rootopts in cmdline.txt

ok, this is reason to try here Wink

give me 20 minutes.

(17th Jul, 2013 12:46 AM)mk01 Wrote: [ -> ]
(17th Jul, 2013 12:43 AM)Fred Wrote: [ -> ]I also removed subvol=root/@ from rootopts in cmdline.txt

ok, this is reason to try here Wink

give me 20 minutes.

ok, just plugged a drive, formatted to btrfs, rsync / , changed root=, sync reboot. already up.

Code:
/                                     /dev/sda1                  btrfs      rw,noatime,thread_pool=1,compress=lzo,space_cache,autodefrag
├─/sys                                sysfs                      sysfs      rw,nosuid,nodev,noexec,relatime
│ ├─/sys/kernel/debug                                            debugfs    rw,relatime
│ └─/sys/kernel/security                                         securityfs rw,relatime
├─/proc                               proc                       proc       rw,nosuid,nodev,noexec,relatime
├─/dev                                udev                       devtmpfs   rw,relatime,size=10240k,nr_inodes=39498,mode=755
│ └─/dev/pts                          devpts                     devpts     rw,nosuid,noexec,relatime,gid=5,mode=620
├─/run                                tmpfs                      tmpfs      rw,nosuid,noatime
│ ├─/run/lock                                                    tmpfs      rw,nosuid,nodev,noexec,relatime,size=5120k
│ ├─/run/shm                                                     tmpfs      rw,nosuid,nodev,relatime
│ ├─/run/user                                                    tmpfs      rw,nosuid,nodev,noexec,relatime,size=102400k,mode=755
│ └─/run/rpc_pipefs                   rpc_pipefs                 rpc_pipefs rw,relatime
├─/home                               /dev/mmcblk0p2[/HOMEold/@] btrfs      rw,noatime,compress=lzo,ssd,space_cache,autodefrag
├─/boot                               /dev/mmcblk0p1             vfat       rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=m
└─/Network/Servers/media.private/xbmc media.private:/xbmc        nfs4       rw,noatime,vers=4.0,rsize=8192,wsize=8192,namlen=255,hard,proto=tcp,port=0
xbian@xbian:~$

and in four minutes !!!

Code:
/dev/mmcblk0p1: SEC_TYPE="msdos" UUID="7687-080D" TYPE="vfat"
/dev/mmcblk0p2: LABEL="xbian-root-btrfs" UUID="67c085e4-91f4-431c-bd89-404d4625de17" UUID_SUB="b4741649-3413-4607-bb62-2d93316853fe" TYPE="btrfs"
/dev/mmcblk0p3: UUID="81ba1f36-57f4-422e-9190-f983490bbc39" TYPE="swap"
/dev/zram0: UUID="1eb3a2a8-6aaa-4945-b6d2-df74fafcd169" TYPE="swap"
/dev/sda1: LABEL="xbian-home-usb" UUID="5969d714-65db-45b8-b7e3-ed9109457047" UUID_SUB="796a6570-8033-40f5-be65-8bdcd500c352" TYPE="btrfs"
/dev/sda2: UUID="b6641f08-e7a5-4bdd-8aaf-ef4f8788baaf" TYPE="swap"

and even auto used all available swap partitions Wink guys, I love XBIAN !
Code:
Filename                Type        Size    Used    Priority
/dev/sda2                               partition    195308    0    19
/dev/zram0                              partition    106492    0    20
/dev/mmcblk0p3                          partition    262140    0    0

and, from class4 card, on usb, with nfs filesystems, xbmc full up in 50 seconds Wink I will not eat cheese today.

Code:
52.98 16.00 job= event=xbmc-loaded netdev= ON_BOOT=
Okay I got it working too. In step 7 also remove "subvol=root/@ from cmdline.txt and it will work.
(17th Jul, 2013 01:42 AM)Fred Wrote: [ -> ]Okay I got it working too. In step 7 also remove "subvol=root/@ from cmdline.txt and it will work.

BUT. I even found one special case, when LABEL and UUID wasn't converted to DEV.

so, are we ok? (not the cheese).

posting commit now.
(14th Jul, 2013 07:20 AM)Fred Wrote: [ -> ]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

I think I may have it now but how can I tell that it is running from the USB and not still the SD?

I assume that it still needs the SD card inserted for it to boot?
You can use the command 'df' or 'mount' to see which partitions are mounted.

You will still need the SD card because the RPi will read the bootcode from that.
(15th Jul, 2013 08:15 AM)mk01 Wrote: [ -> ]
(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=

Quote:The easiest way is:
- Install XBian img to your SD card
- Boot xbian
- Login to shell with ssh
- dd if=/dev/mmcblk0p2 of=/dev/sda2
- Change /boot/cmdline.txt

This only copies the /root partition to your USB drive.


So I am confused. Which one of these methods is the easiest way to copy my root partition to my PNY USB drive????

Thanks!

Mark
(19th Jul, 2013 02:00 AM)Mark Wrote: [ -> ]
(15th Jul, 2013 08:15 AM)mk01 Wrote: [ -> ]
(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=

Quote:The easiest way is:
- Install XBian img to your SD card
- Boot xbian
- Login to shell with ssh
- dd if=/dev/mmcblk0p2 of=/dev/sda2
- Change /boot/cmdline.txt

This only copies the /root partition to your USB drive.


So I am confused. Which one of these methods is the easiest way to copy my root partition to my PNY USB drive????

Thanks!

Mark

@Mark
It depends on the Version of Xbian you are running.
Alpha works with the "dd" statement.
Beta works with the "rsysnc" statement.

If you are unsure, from a ssh - type df -T
if it shows something like /dev/mmcblk0p2 btrfs (NOTE btrfs) then run the later "rsysnc" statements.
(19th Jul, 2013 02:19 AM)IriDium Wrote: [ -> ]
(19th Jul, 2013 02:00 AM)Mark Wrote: [ -> ]
(15th Jul, 2013 08:15 AM)mk01 Wrote: [ -> ]
(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=

Quote:The easiest way is:
- Install XBian img to your SD card
- Boot xbian
- Login to shell with ssh
- dd if=/dev/mmcblk0p2 of=/dev/sda2
- Change /boot/cmdline.txt

This only copies the /root partition to your USB drive.


So I am confused. Which one of these methods is the easiest way to copy my root partition to my PNY USB drive????

Thanks!

Mark

@Mark
It depends on the Version of Xbian you are running.
Alpha works with the "dd" statement.
Beta works with the "rsysnc" statement.

If you are unsure, from a ssh - type df -T
if it shows something like /dev/mmcblk0p2 btrfs (NOTE btrfs) then run the later "rsysnc" statements.

I am using the beta 1 version.... so I will use the rsync method. Going to try it now......

Ok. So I tried it and on almost every rsync, it says after the file, Operation not permitted (1). Not sure why.. ??

Ok. So I tried it and on almost every rsync, it says after the file, Operation not permitted (1). Not sure why.. ??
You have to be root or use sudo before the command

Also remove "subvol=root/@," from cmdline.txt in step 7
An example of what is shown on almost every line:


rsync: chown "/mnt/usr/include/linux/netfilter_ipv4" failed: Operation not permitted (1)

Still happening. Logged in as Xbian and then did a sudo -s. Typed in password and got into root. Ran the commands and still got the operation is not permitted (1).
Do you have write access to the mounted drive?
How do I check that???? Just a note. I reflashed my sd card and I will reconfigure the basics. Then try to rsync to USB again... I will use another USB drive. I plugged the old one in my windows pc and it said it was corrupted. so in a few minutes I will know.

(19th Jul, 2013 03:40 AM)Mark Wrote: [ -> ]How do I check that???? Just a note. I reflashed my sd card and I will reconfigure the basics. Then try to rsync to USB again... I will use another USB drive. I plugged the old one in my windows pc and it said it was corrupted. so in a few minutes I will know.


Code:
root@xbian:~# stop xbmc
stop: Unknown instance:
root@xbian:~# mkfs.btrfs -L xbian-usb /dev/sda1

WARNING! - Btrfs Btrfs v0.19 IS EXPERIMENTAL
WARNING! - see http://btrfs.wiki.kernel.org before using

/dev/sda1 is mounted
root@xbian:~#
root@xbian:~#
root@xbian:~#
root@xbian:~# mount /dev/sda1 /mnt
root@xbian:~# rsync -avx —progress / /mnt
sending incremental file list
rsync: link_stat "/root/—progress" failed: No such file or directory (2)
./
rsync: chown "/mnt/." failed: Operation not permitted (1)
bin/
rsync: chown "/mnt/bin" failed: Operation not permitted (1)
bin/bash
bin/bunzip2
bin/busybox
bin/bzcat
rsync: symlink "/mnt/bin/bzcmp" -> "bzdiff" failed: Operation not permitted (1)
bin/bzdiff
rsync: symlink "/mnt/bin/bzegrep" -> "bzgrep" failed: Operation not permitted (1)
bin/bzexe
rsync: symlink "/mnt/bin/bzfgrep" -> "bzgrep" failed: Operation not permitted (1)
bin/bzgrep
bin/bzip2
bin/bzip2recover
rsync: symlink "/mnt/bin/bzless" -> "bzmore" failed: Operation not permitted (1)

So same issue with a new USB drive and new install of XBIAN.

So how do I fix the Operation no permitted 1?

I set my root password and logged in. Everything seemd normal. Then I just ran the cmds as root.
Try sudo su instead of sudo -s
Ok.

I will try that as soon as I can which will be in a few minutes Smile

Thanks for all o the help guys..

But whats the difference between su and just doing it as root? Why wouldnt it work as root? Am I doing someting wrong?


Steps I do:

Format SD CARD using SD CARD FORMATTER

Install XBIAN BETA 1.0

Configure Wi-Fi and Video Calibration

Reboot

Login as XBian

configure root pw

run steps that mk01 gave and seems every time it doesnt work

did I miss a step in there?

Another question:

Must I complete the rsync steps and such (copy root to usb) using SSH or directly in the Xbian CLI?

nope. Still no luck. getting a lot of Operation not permitted (1).

Examples of errors:
rsync: chown "/mnt/etc/network/if-up.d" failed: Operation not permitted (1)

rsync: symlink "/mnt/etc/network/if-up.d/wpasupplicant" -> "../../wpa_supplicant/ifupdown.sh" failed: Operation not permitted (1)


STILL NO IDEA WHY!!?!?!?!?!?

Sorry for the frusteration but after a few days of trying this (this is my thrid day and finally asking for help Big Grin )

please help!

NO IDEA why it isnt working

A side note:

Could I use the XBIAN installer and install directly to a USB drive??

Then install XBIAN to a SD Card as well? Then edit the cmdline.txt file to point it to the USB?

Will this work?? please helpp!

Ok. Evidently I am doing something wrong and I understand that. I know that mk01 method will work. Maybe because I am a total computer novice, I will need better instructions? Can someone give in-detail (very detail please) of how to do what he said????

Please this would help out much!
You can´t use the XBian installer for the USB stick.
Can you post the output of the command ´mount´ here.
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
Reference URL's