Buffalo NAS-Central Forums

Welcome to the Linkstation Wiki community
It is currently Mon Jun 25, 2018 4:19 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 31 posts ]  Go to page Previous 1 2 3 Next
Author Message
PostPosted: Fri Jul 25, 2008 2:45 pm 
Offline
Site Admin
User avatar

Joined: Mon Aug 28, 2006 1:15 am
Posts: 2606
stjopa wrote:
Short reasearch on the topic shows we need scsi_mod , sd_mod , usb-storage as modules. This can be implemented statically (boot script with modprobe scsi-mod ... in it) or dynamically (using udev rules). Dont know if they are compiled in, but probably not because it doesnt work.

Concerning the question if we need usb-support in the bootloader for using usb as root. No, we don't. We would only need it if we wanted to boot DIRECTLY from the usb-stick (i.e. starting the kernel from there too), which we won't (the hassle of porting u-boot wouldnt make up for it).

P.S: davy_gravy your bootlog shows me those modules are already there. As im still not at home (alas, work work work ;)), i cant inspect it myself. If you boot normally (root=harddisk), is the usb-stick recognized and if yes, as which device?).

For clarity sake, I'm not using an initrd at all in my image.


Well, I'm not sure what you mean w/ the first sentence (but I've not had my 1st cup of coffee yet... ;) ) ... you say "... we need scsi_mod , sd_mod , usb-storage as modules." I know that USB storage works fine/normally and is built-in (not modulized) in my kernel (which is updated to 2.6.25.9 w/ a bucketful of new modules... 609 to be exact). It seems counter intuitive to me to have those three (scsi_mod , sd_mod , usb-storage) as modules. Wouldn't they need to be built in so the kernel can recognize and work w/ the USB storage device? I'm thinking that the fs support for whatever fs is on the flash drive must also be built in (rather than modulized) otherwise, the kernel couldn't read it. (?)

Contents of sdb1 (ext3 filesystem - an afterthought ext3 should be OK, or does it have to be ext2 for uboot ?):
Code:
LS-GL:/media/usb0# ls -ln 
total 42
drwxr-xr-x  2 0 0  3072 May 30 03:07 bin
drwxr-xr-x  2 0 0  1024 Jun 22 02:24 boot
drwxr-xr-x  4 0 0  3072 May 30 03:09 dev
drwxr-xr-x 42 0 0  3072 Jun 22 02:35 etc
drwxr-xr-x  2 0 0  1024 Mar 11 11:20 home
drwxr-xr-x 11 0 0  5120 Jun 14 14:57 lib
drwx------  2 0 0 12288 Jul 25 13:21 lost+found
drwxr-xr-x  2 0 0  1024 May 30 03:02 media
drwxr-xr-x  2 0 0  1024 Mar 11 11:20 mnt
drwxr-xr-x  2 0 0  1024 May 30 03:02 opt
drwxr-xr-x  2 0 0  1024 Mar 11 11:20 proc
drwxr-xr-x  3 0 0  1024 May 31 20:23 root
drwxr-xr-x  2 0 0  3072 Jun  1 19:06 sbin
drwxr-xr-x  2 0 0  1024 May 30 03:02 srv
drwxr-xr-x  2 0 0  1024 Apr 12 09:06 sys
drwxrwxrwt  5 0 0  1024 Jun 21 09:42 tmp
drwxr-xr-x 11 0 0  1024 May 30 04:00 usr
drwxr-xr-x 13 0 0  1024 May 30 03:02 var
drwxr-xr-x  2 0 0  1024 Jun  1 19:29 www


The second sentence, I agree w/, but I haven't looked at if we'd need more than turning on CFG_CMD_USB in the UBoot header(s) & code. Maybe we'd also need to define CONFIG_USB_STORAGE to get it to see the flash drive properly ... as it sees a hdd now. Building a new UBoot is no problem if it is just a tweak of the code. "If" is the operative word there ... I'm not sure how much wiggle room there is in that tiny 256k image ... the crosscompiler/toolchain always pads it out to 240k roughly for the LSPro's UBoot. On the KuroPro's UBoot I had to disable some of the CFG options that I wanted orginally to throw in ... as it didn't map out in memory - I think bbradley knows how to fix that.

From /u-boot-1.1.4-LSPro-w_netconsolepatchesbasic/doc/README.usb :
Quote:
...

Common USB Commands:
- usb start:
- usb reset: (re)starts the USB. All USB devices will be
initialized and a device tree is build for them.
- usb tree: shows all USB devices in a tree like display
- usb info [dev]: shows all USB infos of the device dev, or of all
the devices
- usb stop [f]: stops the USB. If f==1 the USB will also stop if
an USB keyboard is assigned as stdin. The stdin
is then switched to serial input.
Storage USB Commands:
- usb scan: scans the USB for storage devices.The USB must be
running for this command (usb start)
- usb device [dev]: show or set current USB staorage device
- usb part [dev]: print partition table of one or all USB storage
devices
- usb read addr blk# cnt:
read `cnt' blocks starting at block `blk#'to
memory address `addr'
- usbboot addr dev:part:
boot from USB device

Config Switches:
----------------
CFG_CMD_USB enables basic USB support and the usb command
CONFIG_USB_UHCI defines the lowlevel part.A lowlevel part must be defined if
using CFG_CMD_USB
CONFIG_USB_KEYBOARD enables the USB Keyboard
CONFIG_USB_STORAGE enables the USB storage devices


For grins I may try it later on... but my guess is that I'd have to turn off some of those extra functions in order to get CFG_CMD_USB and CONFIG_USB_STORAGE to fit in ...

_________________
LS1 (foonas, nfs, Tranmission & p910nd print server, Firefly for my Roku)
LS-HG500 (Lenny)
Various LS-Pros v1,v2 (unbricked w/ serial & jtag)
KuroPro, LS2 & KuroHG (foonas)
Working on davysweather.dyndns.org lately...

=> wooohooo!
wooohooo!
Unknown command 'wooohooo!' - try 'help'


Top
   
PostPosted: Fri Jul 25, 2008 3:31 pm 
Offline
Regular Member
User avatar

Joined: Tue Oct 09, 2007 9:01 am
Posts: 117
Absolutely my fault, i wasnt precise enough. I meant what you thought, though ;). (I kinda thought of the menuconfig view in the kernel config procedure and thus said "module" for one of the features you can enable).


Top
   
PostPosted: Fri Jul 25, 2008 3:53 pm 
Offline
Site Admin
User avatar

Joined: Mon Aug 28, 2006 1:15 am
Posts: 2606
;)

kk, I'm wondering if this is an ext2/3 thing? I will try it w/ ext2 as the fs on sdb1.

and I need that cup of coffee ... hmmmph.

EDIT: No joy on ext2 either... :evil:

EDIT 2: Compiling the UBoot w/ these extra options may or may not work... all of these would have to be enabled for it to work...

CFG_CMD_USB
CONFIG_USB_UHCI
CONFIG_USB_STORAGE

I am sure that it will run over the boundaries for the memory map, but that can be worked around or some nonessential can be turned off in the config to try to free up some wiggle room.

EDIT 3 : I can confirm that it is more likely that we'd have to wait for anew UBoot port to Orion. ...

_________________
LS1 (foonas, nfs, Tranmission & p910nd print server, Firefly for my Roku)
LS-HG500 (Lenny)
Various LS-Pros v1,v2 (unbricked w/ serial & jtag)
KuroPro, LS2 & KuroHG (foonas)
Working on davysweather.dyndns.org lately...

=> wooohooo!
wooohooo!
Unknown command 'wooohooo!' - try 'help'


Top
   
PostPosted: Sun Jul 27, 2008 12:15 pm 
Offline
Regular Member
User avatar

Joined: Tue Oct 09, 2007 9:01 am
Posts: 117
Upon finally having physical access to my box, i inspected the whole thing.

Code:
Jul 27 13:06:29 Nas kernel: VFS: Mounted root (ext3 filesystem).
Jul 27 13:06:29 Nas kernel: Freeing init memory: 148K
Jul 27 13:06:29 Nas kernel: scsi 2:0:0:0: Direct-Access     Kingston DataTravele
r 2.0 5.00 PQ: 0 ANSI: 0 CCS
Jul 27 13:06:29 Nas kernel: sd 2:0:0:0: [sdc] 7830528 512-byte hardware sectors
(4009 MB)
Jul 27 13:06:29 Nas kernel: sd 2:0:0:0: [sdc] Write Protect is off
Jul 27 13:06:29 Nas kernel: sd 2:0:0:0: [sdc] Mode Sense: 23 00 00 00
Jul 27 13:06:29 Nas kernel: sd 2:0:0:0: [sdc] Assuming drive cache: write throug
h
Jul 27 13:06:29 Nas kernel: sd 2:0:0:0: [sdc] 7830528 512-byte hardware sectors
(4009 MB)
Jul 27 13:06:29 Nas kernel: sd 2:0:0:0: [sdc] Write Protect is off
Jul 27 13:06:29 Nas kernel: sd 2:0:0:0: [sdc] Mode Sense: 23 00 00 00
Jul 27 13:06:29 Nas kernel: sd 2:0:0:0: [sdc] Assuming drive cache: write throug
h
Jul 27 13:06:29 Nas kernel:  sdc: sdc1
Jul 27 13:06:29 Nas kernel: sd 2:0:0:0: [sdc] Attached SCSI removable disk


The problem is, the usb stick gets recognized right AFTER the rootfs is mounted, and thus too late for the usb stick to be the rootfs. This happens because usb-storage waits for the usb subsystem to settle. This means we boot too fast ;). We need some way to tell the boot process to wait for 1-2 secs and usb booting should work.

P.S: http://linux.derkeiler.com/Mailing-List ... 10216.html.

2 Options:

- "late root mount" (dont know if this got commited though) in kernel config

- root-delay as kernel command line option


Top
   
PostPosted: Sun Jul 27, 2008 12:46 pm 
Offline
Regular Member
User avatar

Joined: Tue Oct 09, 2007 9:01 am
Posts: 117
Well, rootdelay=10 as bootarg_root does the trick.

Code:
Waiting 10sec before mounting root device...
scsi 2:0:0:0: Direct-Access     Kingston DataTraveler 2.0 5.00 PQ: 0 ANSI: 0 CCS
sd 2:0:0:0: [sdc] 7830528 512-byte hardware sectors (4009 MB)
sd 2:0:0:0: [sdc] Write Protect is off
sd 2:0:0:0: [sdc] Assuming drive cache: write through
sd 2:0:0:0: [sdc] 7830528 512-byte hardware sectors (4009 MB)
sd 2:0:0:0: [sdc] Write Protect is off
sd 2:0:0:0: [sdc] Assuming drive cache: write through
 sdc: sdc1
sd 2:0:0:0: [sdc] Attached SCSI removable disk
sd 2:0:0:0: Attached scsi generic sg2 type 0
md: Autodetecting RAID arrays.
md: Scanned 0 and added 0 devices.
md: autorun ...
md: ... autorun DONE.
List of all partitions:
0100      32768 ram0 (driver?)
0101      32768 ram1 (driver?)
0102      32768 ram2 (driver?)
0800  244198584 sda driver: sd
  0801      56196 sda1
  0802    2939895 sda2
  0803     136552 sda3
  0804  241063357 sda4
0810  390711384 sdb driver: sd
  0811   39062016 sdb1
  0812          1 sdb2
  0815     979933 sdb5
  0816  350666788 sdb6
1f00        256 mtdblock0 (driver?)
1f01      16384 mtdblock1 (driver?)
1f02      16384 mtdblock2 (driver?)
1f03      16384 mtdblock3 (driver?)
1f04      32768 mtdblock4 (driver?)
1f05     180224 mtdblock5 (driver?)
0820    3915264 sdc driver: sd
  0821    3915248 sdc1
No filesystem could mount root, tried:  reiserfs ext3 ext2 cramfs jfs
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,2)


Still it doesnt work, wonder what i missed.


Top
   
PostPosted: Sun Jul 27, 2008 2:33 pm 
Offline
Site Admin
User avatar

Joined: Mon Aug 28, 2006 1:15 am
Posts: 2606
awesome!

_________________
LS1 (foonas, nfs, Tranmission & p910nd print server, Firefly for my Roku)
LS-HG500 (Lenny)
Various LS-Pros v1,v2 (unbricked w/ serial & jtag)
KuroPro, LS2 & KuroHG (foonas)
Working on davysweather.dyndns.org lately...

=> wooohooo!
wooohooo!
Unknown command 'wooohooo!' - try 'help'


Top
   
PostPosted: Sun Jul 27, 2008 6:35 pm 
Offline
Regular Member
User avatar

Joined: Tue Oct 09, 2007 9:01 am
Posts: 117
Problem solved, sdc1 wasnt cleanly unmounted. Remounting solved it.

Code:
VFS: Mounted root (ext3 filesystem).


Following bootloader commands were necessary:

Code:
setenv default_kernel_addr 0x00100000 
setenv bootargs_base console=ttyS0,115200
setenv bootargs_root 'root=/dev/sdc1 rw; rootdelay=10' (where sdc1 is my usb stick with the rootfs onboard)
setenv bootargs $(bootargs_base) $(bootargs_root) $(buffalo_ver)
setenv bootcmd 'ide reset; ext2load ide 1:1 0x00100000 /boot/uImage; bootm 0x00100000' (kernel resides on the second harddisk, for first take 0:1)


Have fun 8-)


Top
   
PostPosted: Sun Jul 27, 2008 6:43 pm 
Offline
Site Admin
User avatar

Joined: Mon Aug 28, 2006 1:15 am
Posts: 2606
really neat... nicely done...
... this makes a lot of options possible for those who have a corrupted hard drive (rootfs partition only)... getting data off will be easier...
as long as there is a valid kernel on the sda1 they would be able to try to effect some repairs.

what was your boot time like?

EDIT : maybe this is another good reason to have the kernel on sda1 and not normally mount sda1 during normal operation? If it is not mounted, then it is not going to be written to and, then it is unlikely that it could be corrupted (except for excessive g's, like dropping it on the ground ...?)

_________________
LS1 (foonas, nfs, Tranmission & p910nd print server, Firefly for my Roku)
LS-HG500 (Lenny)
Various LS-Pros v1,v2 (unbricked w/ serial & jtag)
KuroPro, LS2 & KuroHG (foonas)
Working on davysweather.dyndns.org lately...

=> wooohooo!
wooohooo!
Unknown command 'wooohooo!' - try 'help'


Top
   
PostPosted: Tue Jul 29, 2008 3:55 am 
Offline
Newbie

Joined: Fri Jul 18, 2008 3:35 am
Posts: 22
stjopa wrote:
I'd strongly recommend reinstalling your system using an eabi rootfs, its simply the better and cleaner solution (you can reuse your smb.conf and /var/lib/samba and so on, so its pretty easy).

Is there a well-documented/recommended way of doing this? I installed what I have now using the Freelink wiki pages for the base install (which is OABI, correct?), then this thread to update to a 2.6.16 kernel.

At this point I'm thinking I'll just hold off for a few months until Debian Lenny armel is released...I'm hoping that someone will do a full setup guide on the wiki pages, and will include a kernel with a really good selection of modules installed.

Congratulations on getting a USB rootdisk going! :up: That's pretty much what I was hoping to see (except for needing to put in an arbitrary delay, of course!). Any chance you might feel confident enough in your solution to put up a wiki page anytime soon? Also, I presume that I'll need a serial cable to do the necessary bootloader "setenv" commands, correct? And can this be done with the stock Buffalo bootloader, or does it require one of the modified ones?


Top
   
PostPosted: Tue Jul 29, 2008 8:02 am 
Offline
Regular Member
User avatar

Joined: Tue Oct 09, 2007 9:01 am
Posts: 117
ahagge wrote:
Is there a well-documented/recommended way of doing this? I installed what I have now using the Freelink wiki pages for the base install (which is OABI, correct?), then this thread to update to a 2.6.16 kernel.

viewtopic.php?f=18&t=5736&st=0&sk=t&sd=a&start=60
In the middle of the page ;).

ahagge wrote:
Any chance you might feel confident enough in your solution to put up a wiki page anytime soon?

Well, my work is keeping me busy, but you could to the job ;).

ahagge wrote:
Also, I presume that I'll need a serial cable to do the necessary bootloader "setenv" commands, correct?

Yes.

ahagge wrote:
And can this be done with the stock Buffalo bootloader, or does it require one of the modified ones?

It works with the stock one (which i use,too).

As a next step i will put /boot/ on /dev/mtdblock4 (works on KuroPro's only), boot the kernel from there and the rootfs from usb, so the harddisk doesnt need to spin up.

The biggest problem i got by in the whole process is, if you dont cleanly unmount/shutdown the system, it wont boot from the usb-stick the next time, because the booting process doesnt wait long enough for the mount process to recover the partition.

So, if it doesnt boot, start from somewhere else (sda,mtdblock), fsck (or simply mount) the usb-stick and try again. This could also be done with an initrd and a following pivot_root but i dont have time for that right now.


Top
   
PostPosted: Sat Jan 24, 2009 3:56 pm 
Offline
Total Newbie

Joined: Sat Jan 24, 2009 1:40 am
Posts: 1
Is anybody using this approach on their "production" systems. I'm in exactly the same boat, trading up from a slug to a linkstation, mostly for extra performance/memory over the slug. I was a bit dismayed (poor research) to find the linkstation runs the HD 24/7, so I was keen to move the rootfs over to usb flash. [The ultimate would be to get the linkstation up to debian lenny, and then pop the external root out of the slug and plug it into the linkstation !]


Top
   
PostPosted: Wed Feb 04, 2009 4:49 pm 
Offline
Newbie

Joined: Tue Jul 17, 2007 2:47 pm
Posts: 64
Hey,

let me shortly introduce you a solution that is used with the kathrein ufs-910 sat-receiver:

- people wanted to boot enigma2 from USB-drive. The problem is, that
the original U-Boot doesn't support booting from USB. You can't advice thousands of users to
flash a new bootloader :o So what?

The solution was the usage of a 2nd Stage bootloader with USB-Support. Since that
"invention" all you have to do is to flash an Image with a kernel with 2nd stage bl included.

So the first BL loads the 2nd and the 2nd loads "whatever you want". Nowadays I have to press
a button to boot from USB. Without button I boot from flash 8-)

This image maybe explains a bit more precisely what I was trying to tell you :D

click me hard, baby

I didn't developed anything regarding this topic. Just wanted to show what else can be done to boot from USB...

Regard ares

_________________
LSProV2::Debian Lenny by davy_gravy::Kernel 2.6.32 with CESA by balou1974::Webmin::Fuppes UPNP Server::SFTP with MySecureShell


Top
   
PostPosted: Wed Apr 15, 2009 6:01 am 
Offline
Newbie

Joined: Fri Jul 18, 2008 3:35 am
Posts: 22
I finally had a chance to try this on my Linkstation Live v2, and it worked just fine. I found I only had to change a single environment variable at boot time:
Code:
setenv bootargs_root 'root=/dev/sdb3 rw; rootdelay=10'
and it Just Worked(tm). Of course, my root partition was on /dev/sdb3 (partition #3 of my USB stick)

Many thanks to stjopa for figuring this out. Now to figure out everything that's still writing to the internal HD and turn it off... :|

Oh, also, I'm pretty sure
Code:
sg_start --stop  /dev/sda
will spin down the internal HD. The program is in the sg3-utils Debian package.

_________________
Linkstation Live v2 running: pvr on Hauppauge HVR-950, apache, nfs v4, samba, cups, streamripper, Nikon webcam, weather station (via open 2300)


Last edited by ahagge on Sun Apr 19, 2009 5:31 am, edited 1 time in total.

Top
   
PostPosted: Wed Apr 15, 2009 6:49 am 
Offline
Site Admin
User avatar

Joined: Tue Jul 12, 2005 11:26 am
Posts: 3701
Location: JAPAN
I have used pivot root before in the initrd and it worked okay. I was going to add this in as a feature a few years ago but there was never a need for it. Mindbender was up for it but I did not get any other post requests so did not implement it.

_________________
LS used as PVR and streaming source


Top
   
PostPosted: Wed May 20, 2009 10:43 pm 
Offline
Newbie

Joined: Fri Sep 07, 2007 6:12 pm
Posts: 30
Location: Cologne, Germany
Hi @all,

i have a big problem with my linkstation. I compiled a new kernel for freelink but it do not work. The problem is I have only an laptop and no chance to disconnect the HD and plug it into another PC.

So the Idea: Install the davycravy armel version on a usb stick and update Uboot with the arguments that ahagge posted. The question is now, can i do this in the EM Mode and it is possible ;-)

Thx for your help.

Greetz Moon

P.S. I have no serial cable

_________________
LSPro, Freelink, 2.6.22
Meine Tutorials auf deutsch


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 31 posts ]  Go to page Previous 1 2 3 Next

All times are UTC+01:00


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:
Powered by phpBB® Forum Software © phpBB Limited