how to boot from a usb drive w/ an internal SATA disk on TP2

Support for your TonidoPlug
UrbanVoyeur
Tonido MVP
Tonido MVP
Posts: 321
Joined: Fri Oct 21, 2011 8:20 pm

how to boot from a usb drive w/ an internal SATA disk on TP2

Postby UrbanVoyeur » Wed Nov 16, 2011 11:29 pm

It is possible to boot from a USB drive with an internal SATA disk installed on the TP2.
To do this you must set the boot partition to sdb1 and remove the sata drive form the boot sequence. When a SATA drive is present it is always /dev/sda and the USB drives start with /dev/sdb

Warning! This will most likely void your warranty!
Warning! Bad environment variables can BRICK your plug!

1. Connect to your plug using the serial console. A how-to on serial consoling can be found on other threads.
2. Interrupt the Marvell U-boot loader by pressing CTRL-C after you see "NAND:"
3. At the console shell prompt (Marvell>>) Set the USB boot root partition to sdb1

Code: Select all

>>  setenv bootargs_usb root=/dev/sdb1 rw rootdelay=10

4. Remove the SATA drive from the boot sequence. Note the escaped semicolon.

Code: Select all

>>  setenv bootcmd run bootcmd_usb\;\ run bootcmd_nand

5. Set the default root partition to sdb1

Code: Select all

>>  setenv root /dev/sdb1 rw rootdelay=10

6. Save the environment variables to flash.

Code: Select all

>>  saveenv

7. Disconnect the serial cable.
8. SSH into the TP2 and enter reboot at the shell prompt.

Code: Select all

#  reboot


To restore your TP2 to it's original settings.
1. Connect via serial console and interrupt the boot.
2. Enter the following setenv lines at the Marvell shell:

Code: Select all

>>  setenv bootargs_usb root=/dev/sda1 rw rootdelay=10
>>  setenv bootcmd run bootcmd_usb\;\ run bootcmd_sata\;\ run bootcmd_nand
>>  setenv root /dev/sda1 rw rootdelay=10

3. Save the changes

Code: Select all

>>  saveenv

4. Disconnect the serial cable and reboot from the SSH shell.

Tips:
- help at the serial console will list the available commands.
- printenv at the serial console will output all the environment variables.

It's a good idea to copy and paste default environment variables into a text file before you start as a reference in case you need to undo a change later.
Last edited by UrbanVoyeur on Thu Nov 17, 2011 8:59 pm, edited 3 times in total.

User avatar
madhan
Admin Tonidoid
Admin Tonidoid
Posts: 8617
Joined: Tue Dec 30, 2008 12:13 am
Location: Austin, TX, USA
Contact:

Re: how to boot from a usb drive w/ an internal SATA disk on

Postby madhan » Thu Nov 17, 2011 10:05 am

Thanks for the write up! Stickied.
Also consider adding to http://www.tonidouser.com

UrbanVoyeur
Tonido MVP
Tonido MVP
Posts: 321
Joined: Fri Oct 21, 2011 8:20 pm

Re: how to boot from a usb drive w/ an internal SATA disk on

Postby UrbanVoyeur » Thu Nov 17, 2011 12:00 pm

madhan wrote:Thanks for the write up! Stickied.
Also consider adding to http://www.tonidouser.com

Done!
http://www.tonidouser.com/doku.php?id=a ... otwithsata

pmcallihan
Super Tonidoid
Super Tonidoid
Posts: 36
Joined: Sat Oct 22, 2011 2:52 pm

Re: how to boot from a usb drive w/ an internal SATA disk on

Postby pmcallihan » Tue Dec 27, 2011 4:00 pm

Discovered that after building the tp2 kernel the wifi was disabled. Didn't have luck finding wifi driver to compile. So used one that was loaded from root.tar.gz to solve the problem. Here is the procedure. The procedure assumes the tp2 is running on the drive with the rebuilt kernel and logged in as root with ssh.

Attach ubi and mount the tonido kernel
ubiattach /dev/ubi_ctrl -m 3
mount -t ubifs ubi0:rootfs /mnt/

Copy the plug wifi driver and dismount the tonido kernel.
cp -r /mnt/lib/modules/2.6.31.8-topkick1281p2-001-004-20101214/kernel/drivers/net/wireless/ /lib/modules/2.6.31.8-topkick1281p2-001-004-20101214/kernel/drivers/net/
umount /mnt

Install the driver and check their loaded
depmod -a
modprobe mlan
modprobe sd8xxx

lsmod
Should show
sd8xxx 123216 1
mlan 185849 1 sd8xxx

Log onto your.tonidoid.com and enable wifi.

RaymondDay
Super Tonidoid
Super Tonidoid
Posts: 41
Joined: Thu Dec 01, 2011 10:41 am

Re: how to boot from a usb drive w/ an internal SATA disk on

Postby RaymondDay » Wed Apr 04, 2012 4:02 am

Thank you pmcallihan I did not know of that UBI mount.

I think after you do the "umount /mnt" you have to detach the Internet flash drive.

Code: Select all

root@small2:/# ubiattach /dev/ubi_ctrl -m 3
ubiattach: error!: cannot attach mtd3
           error 17 (File exists)
root@small2:/# ubidetach /dev/ubi_ctrl -m 3
root@small2:/#


Or is any thing bad about leaving it attached?

I guess you could do:

Code: Select all

cd /
mkdir internal_flash_drive
ubiattach /dev/ubi_ctrl -m 3
mount -t ubifs ubi0:rootfs /internal-flash-drive


See any problem with that?

Well the internet flash drive is a good back up so just copy it over. Then unmount it.

cp -rpf /mnt/* /internal-flash-drive/

That's what I did.

-Raymond Day


Return to “TonidoPlug Support”

Who is online

Users browsing this forum: No registered users and 6 guests