Buffalo Forums

Products => Storage => : mas94 September 25, 2020, 04:06:48 PM

: Installing Debian on LS220D - manual method
: mas94 September 25, 2020, 04:06:48 PM
Hello,

I'd like to install 1000001101000's Debian_on_Buffalo (https://github.com/1000001101000/Debian_on_Buffalo) on my LS220D.  Rather than write over the Buffalo software, I would like to install it on a spare 500GB drive as a dry run and to give it a try.

The instructions (https://github.com/1000001101000/Debian_on_Buffalo/wiki/Preparing-Device-for-Debian-Install#option-2-load-files-onto-device-manually) for doing this are quite brief and I suspect I have done something wrong.

What I've done:
Formatted the disk with an MBR, added a single 1024MB partition, formatted it as ext3 (default settings from gparted), created a single directory /boot/ and written into it two files: initrd.buffalo (https://github.com/1000001101000/Debian_on_Buffalo/blob/master/Buster/installer_images/armhf_devices/initrd.buffalo) and uImage.buffalo (https://github.com/1000001101000/Debian_on_Buffalo/blob/master/Buster/installer_images/armhf_devices/uImage.buffalo.ls220d) from the locations as per the hyperlinks.

Powered off and removed both original drives from the unit.  Inserted my new drive in bay 1.  Powered on.  Light flashes white for a second or so, then red in groups of 7 flashes.  It does not respond to pings.  It does the same thing if I remove the drive altogether.  (If I replace the original drives, it works fine and boots back into the Buffalo software.)

What I've tried:All with no effect: white flashes, then 7 reds.

Am I on the right lines?  I am unsure whether it's getting as far as attempting to boot from the disk, but if it is, have I put on all the files I need, in the right places?

(I don't have a spare caddy for the spare disk, so it's possible it's not seating properly in the unit, although I think it is.))

Many thanks!
-Mark
: Re: Installing Debian on LS220D - manual method
: 1000001101000 September 25, 2020, 04:57:00 PM
It sounds like you're close.

The boot loader will look for the files as just uImage.buffalo and initrd.buffalo not /boot/uImage.buffalo and /boot/initrd.buffalo. If you remove the boot folder and place the files in the root of the filesystem that should help.

What you described sounds like proper partitioning but the blink codes concerns me somewhat. Usually if it is able to read the boot partition but not the boot files it gives 6 red instead of 7. 7 usually indicates failure to read the boot partition at all. Maybe it's the same code if the files aren't in the right place (not sure if I've tried that).

If you still have trouble let me know and we can look closer.

: Re: Installing Debian on LS220D - manual method
: mas94 September 27, 2020, 09:29:21 AM
Thanks very much for the quick reply! Putting the files in the root did indeed solve the problem and I've been able to run the installer, reboot into Debian and get a few tools installed.

If I make this a bit clearer in the instructions, are you interested in a pull request?

Debian-on-Buffalo looks like an excellent project -- thanks for making it available!
: Re: Installing Debian on LS220D - manual method
: 1000001101000 September 27, 2020, 11:11:20 AM
I’m always open to pull requests.

I’m not sure you can do PRs for wiki pages, but I’m always open to wiki content too!
: Re: Installing Debian on LS220D - manual method
: mas94 October 02, 2020, 03:48:57 PM
Why do the boot files have to be in the root directory for the manual install method, but in /boot/ when the device is running stock firmware, please?  Does the bootloader look in a different place for some reason?

Thanks!
: Re: Installing Debian on LS220D - manual method
: 1000001101000 October 02, 2020, 07:51:43 PM
The reason is that the bootloader and Linux access filesystems in different ways.

The rootfs and boot filesystems physically exist on separate disk partitions. When Linux starts it mounts the rootfs as "/" and then mounts the boot partition at "/boot". From within Linux this makes the boot file appear under /boot.

The boot loader is less sophisticated and just loads the files directly from the partition:
:
ext2load ide 0:1 0x1200000 /$kernel
I believe the boot loader is the main reason the boot files are stored in a separate partition. Older versions would crash if you tried to read partitions larger than ~768MB. I haven't explored the limits of the newer version but imagine they also have limits.

: Re: Installing Debian on LS220D - manual method
: mas94 October 05, 2020, 10:01:24 AM
Thanks -- that took me a while to get my little brain around.  Do I understand correctly then, that both methods require the files to be in the same place on the disk (i.e. in the first, small, partition) but because the first partition is mounted as /boot/ by the stock firmware, in order to get them to the right place, the files need to be placed in /boot/?
: Re: Installing Debian on LS220D - manual method
: 1000001101000 October 05, 2020, 11:06:22 AM
That is exactly correct.

The same setup is used within Debian. One of the things the installer does is make the necessary configuration changes required to have Debian automatically place its boot files in that same place whenever new ones are generated.
: Re: Installing Debian on LS220D - manual method
: mas94 November 03, 2020, 09:08:47 AM
Hello again,

At last I have some time to carry on with this.  The Debian installer is installed and running but I have a question about partitioning.

The three partitions for /boot, / and swap I am happy I have set up correctly, as follows:
* RAID1 device #0 1.0GB ext3 /boot
* RAID1 device #1 5.1GB ext3 /
* RAID1 device #2 1.0 GB swap swap

But the large partition, with all my data on it, I am not sure about.

It shows up in the installer as
RAID1 device #10 2.0TB xfs
I didn't check what format it was before running the installer, but I presume it has correctly detected it as xfs.
When I go to configure it, in the "How to use this partition" menu there is no xfs option.  (Options are Ext3, Ext3, Ex2, btrfs, JFS, FAT16, FAT32, swap area, physical volume for encryption, physical volume for LVM, do not use.)

I took a backup, of course (several in fact!) but if possible I would like to use the existing filesystem as-is.

What's the trick here please?
: Re: Installing Debian on LS220D - manual method
: 1000001101000 November 03, 2020, 09:17:45 AM
It should be safe to select the "do not use" option to prevent the installer from doing anything with it during the install. I've got instructions in the post-installation steps about how to set the existing array up when you boot into Debian.


I think there may be a missing xfs installer module, if so I'll try to add it next time I work on the installer.
: Re: Installing Debian on LS220D - manual method
: mas94 November 03, 2020, 11:07:38 AM
Thanks very much, that sorted it and the post-install instructions are good -- I'd read them previously but forgotten that was there  :-[

There's a small bug: /sbin/ is not in the path which means mdadm and update-initramfs don't work.  I've submitted an issue (#66) (https://github.com/1000001101000/Debian_on_Buffalo/issues/66).
: Re: Installing Debian on LS220D - manual method
: 1000001101000 November 03, 2020, 11:57:10 AM
I believe this was a deliberate change in Buster (I also think it was standard in other distros like RHEL):
https://wiki.debian.org/NewInBuster

I assume it has some sort of security benefit.
: Re: Installing Debian on LS220D - manual method
: mas94 November 10, 2020, 03:44:10 PM
Thanks. So it was. Any security benefit it has seems to be offset by the fact that it breaks everything :-/

My NAS is back up and running now, with Debian -- at last, proper NFS support. OpenMediaVault runs nicely (I tried Webmin, which worked and which I quite liked, but it was extremely slow -- took literally about 5 minutes to serve the front page).

Do you have any recommendations for a media server to replace Twonky in the original firmware?  I have put Gerbera (http://docs.gerbera.io/en/latest/index.html) on and it seems to work fine, but it's a little limited (no searching, no thumbnails).
: Re: Installing Debian on LS220D - manual method
: 1000001101000 November 10, 2020, 04:39:50 PM
I've never done anything with DLNA/etc personally. Really only vaguely aware of what they are to be honest.

You should be able to test out anything in the Debian repository or otherwise available for armhf devices. Let me know if you end up with a recommendation I should add to the wiki.
: Re: Installing Debian on LS220D - manual method
: mas94 November 22, 2020, 09:10:19 AM
I tried minidlna (https://wiki.debian.org/minidlna) and Gerbera (https://gerbera.io/), both from the archive.  Both worked fine, but for the time being I have settled on minidlna for two reasons: it supports searching (Gerbera does not); and I find its configuration method (config file in /etc/ rather than Gerbera's web interface) slightly easier to really understand what I'm getting, but that's a matter of taste.  Seems to serve video to my Samsung TV and audio to my Pure streaming devices fine.

Another question: do you know what sensible CPU temperature thresholds for fancontrol/pwmconfig are? I've got...
:
MINTEMP= hwmon1/pwm1=60
MAXTEMP= hwmon1/pwm1=75
(meaning the fan comes on at lowest speed at 60, and reaches highest speed at 75).  Perhaps that results in the fan being on a bit more than it used to be under stock firmware (sounds like it) but I don't have the stock firmware to compare to and naturally I don't want to cook the device.

Thanks once again!
: Re: Installing Debian on LS220D - manual method
: 1000001101000 November 22, 2020, 09:58:59 AM
Personally I usually just leave the fans on high on my devices, though I usually don't have them close enough to really hear. When I've used fan control it's usually been through trial and error, if the device started changing speeds constantly when idle I'd adjust the settings to make it stay at low/medium until under load.

I'd recommend setting it to run at least at low when the device is idle. Likewise, 60 is closer to a temperature where I'd set the fan to go to high rather than first turn on. The electronics may be able to handle more heat but you also want to keep an eye on the disk temperatures.
: Re: Installing Debian on LS220D - manual method
: navawong2 March 24, 2021, 02:01:53 PM
I tried to install Debian in my LS421DE but failed and stuck in boot loop after installation.  I put the NAS in recovery mode and use LSupdater to install the stock firmware 1.87-0.02.  No problem revoke back to stock but after revoke I cannot format HDD in webaccess kept getting error "Format failed. Make sure that the drive is not configured as read-only. Try rebooting the LinkStation."  I tried to user LSupdater debug to flash the HDD few times still doesnt work.  Check the HDD with USB dock station no problem with the HDD.  Did a Diskpart to clean all the partition didn't work.  I been using this WD Red 3TB few years no problem even before installing Debian I had no issue using this in stock firmware.  Please help thank you

Edit: fixed stupid me finally notice after Diskpart clean only showing 2TB free space.  Just needed to covert to GPT for the NAS to access 3TB.
: Re: Installing Debian on LS220D - manual method
: 1000001101000 March 24, 2021, 03:42:29 PM
a boot loop after debian install usually indicates that the /boot volume wasn't set up properly in the partitioning menu.

It's been a long time since I've added a disk via the stock firmware, I seem to remember needed to initialize before formatting or something of that nature. 

What I'd recommend is blanking both drives completely, then do a fresh install of the stock firmware which will also set up both disks. At that point you can make another attempt at a debian install.

If you do move forward with Debian you can post a screenshot of your partition layout to the github page before finishing that step, I can take a look and make sure it looks correct before you move forward.
: Re: Installing Debian on LS220D - manual method
: navawong2 March 26, 2021, 10:14:40 AM
Thanks for the reply.  I gave up on installing Debian its way to complicate for me.  I will just stick with installing Transmission in my LS421DE.
Side note I only use one HDD for my LS421DE, I have no need for 2 HDD or worry about losing my data.