General NAS-Central Forums

Welcome to the NAS community
It is currently Mon Nov 20, 2017 5:33 am

All times are UTC




Post new topic Reply to topic  [ 41 posts ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: Mon Sep 15, 2014 6:51 pm 
Offline

Joined: Sat Sep 13, 2014 8:25 am
Posts: 16
wicked wrote:
christiaan wrote:
...to create a partition on the disk. FYI the only thing I've got going on right now is the KD20 not booting up and hanging with just a blue light. And when I remove the disk it boots from the nand.
So I still have a long way ahead I guess, I've had trouble opening up the case otherwise I might have the stuff laying around to fix a serial cable.


and your disk has ms-dos or gpt partition table ?

ms-dos, its just a 160 GB drive for testing so I don't need gpt for now.


Top
 Profile  
 
PostPosted: Mon Sep 15, 2014 7:00 pm 
Offline

Joined: Tue May 21, 2013 10:49 pm
Posts: 79
christiaan wrote:
wicked wrote:
christiaan wrote:
...to create a partition on the disk. FYI the only thing I've got going on right now is the KD20 not booting up and hanging with just a blue light. And when I remove the disk it boots from the nand.
So I still have a long way ahead I guess, I've had trouble opening up the case otherwise I might have the stuff laying around to fix a serial cable.


and your disk has ms-dos or gpt partition table ?

ms-dos, its just a 160 GB drive for testing so I don't need gpt for now.


well, so Ive re-done the procedure, added those three command afterwards but no progress :/
Any ideas why ?


Top
 Profile  
 
PostPosted: Mon Sep 15, 2014 7:21 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6072
wicked, you write you edited /etc/rc. As far as I can find it's never called.

But to be honest, it's not clear to me how the boot procedure works. Initrd is loaded, and /linuxrc is executed.

Normally I'd expect it to mount the 'real rootfs', the ubifs in flash, in this case, and call switch_root, pivot_root or chroot to get that rootfs active, and in most cases /sbin/init in the new rootfs is called.

Another approach (seen in IomegaEMC and ZyXEL) is to keep the initrd, and mount the main part of the firmware on /usr, or something like that.

In this case /linuxrc seems to have as main function to update the firmware. And the script ends with:
Code:
echo "End of InitRD -- transfer to /sbin/init" 1>&2
umount /proc
umount /sys
# End of file
So apparently /sbin/init is expected to be called when /linuxrc ends. /sbin/init is a symlink to busybox, and the busybox init a light version of SystemV Init. There is no /etc/inittab, so it's perfectly possible that /etc/rc will be called. But I still can't find the ubifs being invoked anywhere.

What I *do* see, is that some network related modules are loaded, mii.ko and gmac.ko. But those modules are not available in initrd, only in the real rootfs!
BTW, I think the bootscripts are sloppy. It's hard to read, no functions are used, and it seems the same actions are repeated over and over.

In your case I would mount a partition early in /linuxrc, and redirect stderr and stdout:
Code:
mkdir -p /log
mount /dev/sda1 /log
exec >>/log/logfile 2>&1
set -x
echo "=== START of boot ==="
and maybe repeat that in /etc/rc.


Top
 Profile  
 
PostPosted: Mon Sep 15, 2014 7:31 pm 
Offline

Joined: Tue May 21, 2013 10:49 pm
Posts: 79
Mijzelf wrote:
In your case I would mount a partition early in /linuxrc, and redirect stderr and stdout:
Code:
mkdir -p /log
mount /dev/sda1 /log
exec >>/log/logfile 2>&1
set -x
echo "=== START of boot ==="
and maybe repeat that in /etc/rc.


ok, so this goes to /rclinux and /etc/rc
but how can I create ext2 partition after the whole procedure?
fdisk says:
Code:
/dev/sdb contains GPT signatures, indicating that it has a GPT table.  However, it does not have a valid fake msdos partition table, as it should.  Perhaps it was corrupted -- possibly by a program that doesn't understand GPT partition tables.  Or perhaps you deleted the GPT table, and are now using an msdos partition table.  Is this a GPT partition table?


Top
 Profile  
 
PostPosted: Mon Sep 15, 2014 7:48 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6072
Is that a >2TB disk? If not, just press 'no', create a new, empty partition table ('a', when I remember well, press 'm' for help), and create a new partition. But make sure it start well beyond 32MiB.

If yes, you can also press 'no', and hope fdisk will just ignore the beyond 2TB part. Or use parted to create the partition.


Top
 Profile  
 
PostPosted: Mon Sep 15, 2014 8:06 pm 
Offline

Joined: Tue May 21, 2013 10:49 pm
Posts: 79
Mijzelf wrote:
Is that a >2TB disk? If not, just press 'no', create a new, empty partition table ('a', when I remember well, press 'm' for help), and create a new partition. But make sure it start well beyond 32MiB.

If yes, you can also press 'no', and hope fdisk will just ignore the beyond 2TB part. Or use parted to create the partition.


arrgh this is really annoying ;)
no, the disk is not >2TB.
This is my whole procedure, maybe Ive messed something:

Code:
tail, mount and make changes as described (add logging to rclinux and stuff)
127  umount initrd.d
  128  sudo umount initrd.d
  129  gzip initrd
  130  mkimage -A ARM -O Linux -T RAMDisk -C gzip -a 61000000 -e 61000000 -d initrd.gz rdimg.gz.new
  131  history
  132  zcat Iomega-HMNHD-CE-1st-32M.img.gz | dd of=/dev/sdb bs=1M
  133  dd if=uImage of=/dev/sdb bs=512 seek=1290
  134  dd if=rdimg.gz.new of=/dev/sdb bs=512 seek=16674
  135  dd if=/dev/sdb of=sth bs=446 count=1
  136  sudo fdisk /dev/sdb #here write new msdos partition table (o and then w)
  138  dd if=sth of=/dev/sdb
  142  sudo fdisk /dev/sdb #here make partition, set type to 83, first sector at 65536
  143 sudo mke2fs /dev/sdb1
 144 sudo fdflush /dev/sdb1
disconnet the disk, put it on the nas

Nas without the disk: powerbutton constantly blinking, no ip from dhcp
Nas with prepared disk: powerbutton constantly lit, the nas does not get ip from dhcp, does not write anything to /dev/sda1 (/dev/sdb1 on my live distro). Ive observed that the NIC in the nas blinks for 10-15 secs and then goes off for 4 secs and the whole thing repeats itself. Maybe the nas is in looped reebot?


Top
 Profile  
 
PostPosted: Tue Sep 16, 2014 7:24 am 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6072
Nothing on sda1? So it's probably not mounted. Maybe it needs /proc, and/or a type specification:
Code:
mount -t proc proc /proc
mkdir -p /log
mount -t ext2 /dev/sda1 /log
exec >>/log/logfile 2>&1
set -x
echo "=== START of boot ==="
BTW, does the initrd have a /dev/sda1? Else you have to create one.

Your command sequence looks fine to me.

Quote:
Maybe the nas is in looped reebot?
Perfectly possible. The unchanged initrd has as ultimate goal to boot the ubifs rootfs. If that is damaged, it will fail. Who knows what init will do?


Top
 Profile  
 
PostPosted: Tue Sep 16, 2014 7:14 pm 
Offline

Joined: Tue May 21, 2013 10:49 pm
Posts: 79
Mijzelf wrote:
BTW, does the initrd have a /dev/sda1? Else you have to create one.


what do you mean ? what initrd ? within the gzipped rdimg ?


Top
 Profile  
 
PostPosted: Tue Sep 16, 2014 7:37 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6072
Yes. Initrd stands for 'Initial Ramdrive', and I guess rdimg for 'Ramdrive Image'.

Initrd a common name for a (simple) filesystem which is loaded in memory by the bootloader, together with the Linux kernel. The purpose is in most cases to provide scripts and tools to mount the real rootfs. (Very handy when the real rootfs is complicated, a raid array, an logical volume, an NFS share, a layered filesystem, ...)


Top
 Profile  
 
PostPosted: Thu Sep 18, 2014 5:29 am 
Offline

Joined: Tue May 21, 2013 10:49 pm
Posts: 79
ok so you mean mounting /dev/sda1 in some stript within rdimg.gz (for example linuxrc). Done that, however it did not help.


Top
 Profile  
 
PostPosted: Thu Sep 18, 2014 5:46 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6072
In that case I'm out of ideas. I guess it's something simple, but that is hard to debug.


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

All times are UTC


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