LaitrKeiows wrote:
As for flashing without disassembly... I will check if it is possible and report back then.
There is a way to "unstock" Mini without disassembly.
There is a possibility that you could brick your NAS with these instructions. Please make sure that you read the entire page carefully. It is easy to recover your bricked LS Mini, but you have to disassemble it. Disassembling may void your warranty or cause severe damage of the hardware!You will have only one chance to make it. Take time, it will take about hour or more.
If you were unsuccessful, don't get upset: you can go "via disassembly".
First of all you need to get telnet access to your LS Mini:
http://buffalo.nas-central.org/index.ph ... k_FirmwareWhen in, you need to kill all unneeded processes with help of
killall and
ps.
You must come to a state similar to this:
Code:
root@LS-WSGL:~# ps | grep -v SW
PID Uid VmSize Stat Command
1 root 572 S init
1012 root 200 S /sbin/dhcpcd -L /etc/dhcpc -h LS-WSGL -t 15 -x -y -z
1048 root 652 S syslogd -m 0
1050 root 380 S klogd
1054 root 676 S /usr/sbin/inetd
1865 root 620 S /sbin/getty -L ttyS0 115200 vt100
2201 root 384 S telnetd
2203 root 1256 S -sh
3682 root 720 R ps
Now check that you have same RAID configuration as I had:
Code:
root@LS-WSGL:~# cat /proc/mdstat
Personalities : [raid0] [raid1]
md1 : active raid1 sdb2[1] sda2[0]
5004160 blocks [2/2] [UU]
md10 : active raid1 sda5[0] sdb5[1]
1003904 blocks [2/2] [UU]
md0 : active raid1 sda1[0] sdb1[1]
1003904 blocks [2/2] [UU]
unused devices: <none>
(probably you will need to stop one of arrays absent here with
mdadm -S)
In the next step we will free /dev/sdb from stock firmware: LS Mini uses it as a boot drive.
Stock firmware cannot be reverted after this step!Code:
root@LS-WSGL:~# mdadm -f /dev/md1 /dev/sdb2
mdadm: set /dev/sdb2 faulty in /dev/md1
root@LS-WSGL:~# mdadm -f /dev/md10 /dev/sdb5
mdadm: set /dev/sdb5 faulty in /dev/md10
root@LS-WSGL:~# mdadm -f /dev/md0 /dev/sdb1
mdadm: set /dev/sdb1 faulty in /dev/md0
root@LS-WSGL:~# mdadm -r /dev/md1 /dev/sdb2
mdadm: hot removed /dev/sdb2
root@LS-WSGL:~# mdadm -r /dev/md10 /dev/sdb5
mdadm: hot removed /dev/sdb5
root@LS-WSGL:~# mdadm -r /dev/md0 /dev/sdb1
mdadm: hot removed /dev/sdb1
root@LS-WSGL:~# umount /mnt/*
umount: /mnt/array1: not mounted
Now we need to repartition /dev/sdb:
Code:
root@LS-WSGL:~# if hdparm -z /dev/sdb > /dev/null; then echo; echo DRIVE READY; echo; fdisk /dev/sdb;\
else grep sdb /proc/mounts /proc/mdstat; echo Please check that sdb is not in use; fi;
DRIVE READY
The number of cylinders for this disk is set to 60801.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): p
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 125 1004031 83 Linux
/dev/sdb2 126 748 5004247+ 83 Linux
/dev/sdb4 749 60801 482375722+ 5 Extended
/dev/sdb5 749 873 1004031 82 Linux swap
/dev/sdb6 874 60690 480480021 83 Linux
Command (m for help): d
Partition number (1-6): 1
Command (m for help): d
Partition number (1-6): 2
Command (m for help): d
Partition number (1-6): 3
Warning: partition 3 has empty type
Command (m for help): d
Partition number (1-6): 4
Command (m for help): d
No partition is defined yet!
Command (m for help): p
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-60801, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-60801, default 60801): +64M
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (10-60801, default 10):
Using default value 10
Last cylinder or +size or +sizeM or +sizeK (10-60801, default 60801): +128M
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (27-60801, default 27):
Using default value 27
Last cylinder or +size or +sizeM or +sizeK (27-60801, default 60801): +2G
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Selected partition 4
First cylinder (271-60801, default 271):
Using default value 271
Last cylinder or +size or +sizeM or +sizeK (271-60801, default 60801):
Using default value 60801
Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): fd
Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 82
Changed system type of partition 2 to 82 (Linux swap)
Command (m for help): t
Partition number (1-4): 3
Hex code (type L to list codes): fd
Changed system type of partition 3 to fd (Linux raid autodetect)
Command (m for help): t
Partition number (1-4): 4
Hex code (type L to list codes): fd
Changed system type of partition 4 to fd (Linux raid autodetect)
Now check that everything is right and write new partition table:
Code:
Command (m for help): p
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 9 72261 fd Linux raid autodetect
/dev/sdb2 10 26 136552+ 82 Linux swap
/dev/sdb3 27 270 1959930 fd Linux raid autodetect
/dev/sdb4 271 60801 486215257+ fd Linux raid autodetect
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
Create RAID1 arrays for new system:
Code:
root@LS-WSGL:~# for i in 1 3 4; do echo y | mdadm --create --verbose /dev/md$(($i+10)) --level=1 --raid-devices=2 /dev/sdb$i missing; done;
mdadm: /dev/sdb1 appears to contain an ext2fs file system
size=1003904K mtime=Thu Oct 9 10:13:37 2008
mdadm: size set to 72192K
Continue creating array? mdadm: array /dev/md11 started.
mdadm: size set to 1959808K
mdadm: array /dev/md13 started.
mdadm: size set to 486215168K
mdadm: array /dev/md14 started.
root@LS-WSGL:~# cat /proc/mdstat | grep md1[1234]
md14 : active raid1 sdb4[0]
md13 : active raid1 sdb3[0]
md11 : active raid1 sdb1[0]
Prepare filesystems and swap, it will take some time:
Code:
root@LS-WSGL:~# for i in 11 13 14; do mkfs.ext3 -F /dev/md$i; done;
<skip>
This filesystem will be automatically checked every 21 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
root@LS-WSGL:~# mkswap /dev/sdb2
Install bzip2:
Code:
root@LS-WSGL:~# cd /
root@LS-WSGL:/# wget http://buffalo.jpfast.net/bzip2.bin.arm.tgz
root@LS-WSGL:/# tar xvzf bzip2.bin.arm.tgz
Create and mount root of your new firmware:
Code:
root@LS-WSGL:~# mkdir /mnt/genlink/
root@LS-WSGL:~# mount /dev/md13 /mnt/genlink/
root@LS-WSGL:~# mkdir /mnt/genlink/boot/
root@LS-WSGL:~# mount /dev/md11 /mnt/genlink/boot/
root@LS-WSGL:~# cd /mnt/genlink/
root@LS-WSGL:/mnt/genlink#
Download and extract latest
Genlink rootfs image:
Code:
root@LS-WSGL:/mnt/genlink# wget http://buffalo.nas-central.org/*/GenLink-stage3.1_arm9-*.tar.bz2
root@LS-WSGL:/mnt/genlink# tar xvjpf ./GenLink-stage3.1*.tar.bz2
Now chroot into you fresh Gentoo:
Code:
root@LS-WSGL:/mnt/genlink# mount -t proc proc proc/
root@LS-WSGL:/mnt/genlink# cp /etc/resolv.conf etc/resolv.conf
root@LS-WSGL:/mnt/genlink# chroot .
Install kernel and proper initrd:
Code:
sh-3.2# pwd
/
sh-3.2# wget http://buffalo.jpfast.net/LS-Mini-Minimal-2.6.27-rc6lsmini.tbz2
sh-3.2# tar xvjf LS-Mini-Minimal-2.6.27-rc6lsmini.tbz2
sh-3.2# wget http://buffalo.jpfast.net/initrd-md13.tbz2
sh-3.2# tar xvjf initrd-md13.tbz2
Edit fstab to match your disks:
Code:
nano -w /etc/fstab
Code:
/dev/md13 / ext3 defaults,noatime,errors=remount-ro 0 1
/dev/md11 /boot ext3 defaults,noatime,errors=remount-ro,noauto 0 2
/dev/sdb2 none swap sw,pri=1 0 0
#/dev/sda2 none swap sw,pri=1 0 0
tmpfs /tmp tmpfs size=5m,mode=1777 0 0
shm /dev/shm tmpfs nodev,nosuid,noexec 0 0
(you can create mountpoint for /dev/md14 later)
Now recheck everything and reboot your Linkstation Mini into a fresh Genlink install:
Code:
sh-3.2# exit
exit
root@LS-WSGL:/mnt/genlink# umount proc/
root@LS-WSGL:/mnt/genlink# cd /
root@LS-WSGL:/# umount -a
root@LS-WSGL:/# reboot; logout
Wait 3-5 minutes, blue power led should shut off:

Wait a couple minutes more, and then ssh to the Mini:
Code:
user@host ~ $ ssh root@<ip-address-here>
Password: lspro
Hello, welcome to GenLSPro, running
.
.vir. d$b
.d$$$$$$b. .cd$$b. .d$$b. d$$$$$$$$$$$b .d$$b. .d$$b.
$$$$( )$$$b d$$$()$$$. d$$$$$$$b Q$$$$$$$P$$$P.$$$$$$$b. .$$$$$$$b.
Q$$$$$$$$$$B$$$$$$$$P" d$$$PQ$$$$b. $$$$. .$$$P` `$$$ .$$$P` `$$$
"$$$$$$$P Q$$$$$$$b d$$$P Q$$$$b $$$$b $$$$b..d$$$ $$$$b..d$$$
d$$$$$$P" "$$$$$$$$ Q$$$ Q$$$$ $$$$$ `Q$$$$$$$P `Q$$$$$$$P
$$$$$$$P `""""" "" "" Q$$$P "Q$$$P" "Q$$$P"
`Q$$P" """
Linux armv5tel 2.6.27-rc6lsmini (compiled #81 Wed Oct 8 23:16:47 JST 2008)
Processor : Feroceon rev 0 (v5l)
BogoMIPS : 266.24
RAM : 123 MB
Swap : 133 MB
Uptime : 13:04:20 up 3 min, 1 user, load average: 0.49, 0.34, 0.14
Logged on as : root on /dev/pts/0 since Thu Oct 9 12:54:20 JST 2008
Users logged in : root # users=1
Now you can update your arrays:
Code:
GenLSPro ~ # cat /proc/mdstat
Personalities : [raid1]
md11 : active raid1 sdb1[0]
72192 blocks [2/1] [U_]
md13 : active raid1 sdb3[0]
1959808 blocks [2/1] [U_]
md14 : active raid1 sdb4[0]
486215168 blocks [2/1] [U_]
unused devices: <none>
GenLSPro ~ # sfdisk -d /dev/sdb | sfdisk /dev/sda
Checking that no-one is using this disk right now ...
OK
Disk /dev/sda: 60801 cylinders, 255 heads, 63 sectors/track
Old situation:
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System
/dev/sda1 0+ 124 125- 1004031 83 Linux
/dev/sda2 125 747 623 5004247+ 83 Linux
/dev/sda3 0 - 0 0 0 Empty
/dev/sda4 748 60800 60053 482375722+ 5 Extended
/dev/sda5 748+ 872 125- 1004031 82 Linux swap / Solaris
/dev/sda6 873+ 60689 59817- 480480021 83 Linux
New situation:
Units = sectors of 512 bytes, counting from 0
Device Boot Start End #sectors Id System
/dev/sda1 63 144584 144522 fd Linux raid autodetect
/dev/sda2 144585 417689 273105 82 Linux swap / Solaris
/dev/sda3 417690 4337549 3919860 fd Linux raid autodetect
/dev/sda4 4337550 976768064 972430515 fd Linux raid autodetect
Warning: no primary partition is marked bootable (active)
This does not matter for LILO, but the DOS MBR will not boot this disk.
Successfully wrote the new partition table
Re-reading the partition table ...
If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)
GenLSPro / # wget http://buffalo.jpfast.net/mdadm-arm-v2.6.7.tbz2
GenLSPro / # tar xvjf mdadm-arm-v2.6.7.tbz2
sbin/mdadm
GenLSPro / # for i in 1 3 4; do mdadm --add /dev/md$(($i+10)) /dev/sda$i; done;
mdadm: added /dev/sda1
mdadm: added /dev/sda3
mdadm: added /dev/sda4
GenLSPro / # cat /proc/mdstat
Personalities : [raid1]
md11 : active raid1 sda1[1] sdb1[0]
72192 blocks [2/2] [UU]
md13 : active raid1 sda3[2] sdb3[0]
1959808 blocks [2/1] [U_]
resync=DELAYED
md14 : active raid1 sda4[2] sdb4[0]
486215168 blocks [2/1] [U_]
[>....................] recovery = 0.1% (606272/486215168) finish=120.1min speed=67363K/sec
unused devices: <none>
Further reading:
http://buffalo.nas-central.org/index.ph ... k_for_ARM9http://www.gentoo.org/doc/en/handbook/index.xmlhttp://www.gentoo.org/doc/en/distcc.xmlhttp://www.gentoo.org/doc/en/cross-compiling-distcc.xmlfind /sys/class/leds