It is currently Wed Jun 19, 2013 2:44 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: how to boot from a usb drive w/ an internal SATA disk on TP2
PostPosted: Wed Nov 16, 2011 11:29 pm 
Tonido MVP
Tonido MVP
Joined: Fri Oct 21, 2011 8:20 pm
Posts: 295

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:
>>  setenv bootargs_usb root=/dev/sdb1 rw rootdelay=10

4. Remove the SATA drive from the boot sequence. Note the escaped semicolon.
Code:
>>  setenv bootcmd run bootcmd_usb\;\ run bootcmd_nand

5. Set the default root partition to sdb1
Code:
>>  setenv root /dev/sdb1 rw rootdelay=10

6. Save the environment variables to flash.
Code:
>>  saveenv

7. Disconnect the serial cable.
8. SSH into the TP2 and enter reboot at the shell prompt.
Code:
#  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:
>>  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:
>>  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.

Offline
 Profile  
 Post subject: Re: how to boot from a usb drive w/ an internal SATA disk on
PostPosted: Thu Nov 17, 2011 10:05 am 
Admin Tonidoid
Admin Tonidoid
User avatar
Joined: Tue Dec 30, 2008 12:13 am
Posts: 7408
Location: Dallas, USA

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


Offline
 Profile  
 Post subject: Re: how to boot from a usb drive w/ an internal SATA disk on
PostPosted: Thu Nov 17, 2011 12:00 pm 
Tonido MVP
Tonido MVP
Joined: Fri Oct 21, 2011 8:20 pm
Posts: 295

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


Offline
 Profile  
 Post subject: Re: how to boot from a usb drive w/ an internal SATA disk on
PostPosted: Tue Dec 27, 2011 4:00 pm 
Super Tonidoid
Super Tonidoid
Joined: Sat Oct 22, 2011 2:52 pm
Posts: 36

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.


Offline
 Profile  
 Post subject: Re: how to boot from a usb drive w/ an internal SATA disk on
PostPosted: Wed Apr 04, 2012 4:02 am 
Super Tonidoid
Super Tonidoid
Joined: Thu Dec 01, 2011 10:41 am
Posts: 41

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:
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:
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


Offline
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours [ DST ]


 Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: