install Debian on a thumb drive on my Buffalo Terrastation fails, on HDD OK.
DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
install Debian on a thumb drive on my Buffalo Terrastation fails, on HDD OK.
I've installed Debian on the hard drive of my Nas. This works OK, but I want to run Debian from a thumb drive, so the hard drives in the NAS can stay idle while the NAS waits for requests for files from the network.
My NAS first boots from it's ROM. Next it looks in the first partition of the first hard drive, and then it loads initrd.buffalo and uImage.buffalo. Finally initrd/uImage mount /dev/sda3 as the root file system, and the rest of the system is booted from there.
I've copied the root filesystem on a flash drive (Using dd to preserve the UUID), and removed that partition from the hard drive. This causes the NAS to not find the root filesystem. (I can see it loading the kernel, and at the moment it should load from the root filesystem, the NAS reboots).
Next I've tried to extract initrd.buffalo, modify it to find the flash drive, but I could not generate an initrd.buffalo that was bootable.
How can I make the Debian installer to see the flash drive, and create the root partition on it?
How can I unpack / edit / repack initrd.buffalo?
How can I modify initrd.buffalo to mount the flash drive as the root partition?
My NAS:
Code:
Buffalo Terrastation Pro TS-HTGL/R5 TS-H4.0TGL/R5 BUF-TS-HTGLR5(A)
Debian 10.7
Linux debian 4.12.13 #4 Tue Nov 3 14:18:55 CST 2020 armv5tel GNU/Linu
Layout of the first hard drive: (Second hard drive is blank)
Code:
Device Boot Start End Sectors Size Id Type
/dev/sda1 2048 1050623 1048576 512M 83 Linux
/dev/sda2 1050624 3147775 2097152 1G 82 Linux swap / Solaris
/dev/sda3 3147776 24119295 20971520 10G 83 Linux
cat /boot/initrd.buffalo | cpio -i
cpio: Malformed number MN�N/�9
cpio: Malformed number N�N/�9�
cpio: Malformed number N�N/�9��
cpio: Malformed number �N/�9���
cpio: Malformed number N/�9����
cpio: Malformed number /�9���ԧ
cpio: Malformed number �9���ԧE
cpio: Malformed number 9���ԧE
cpio: Malformed number ���ԧE�
cpio: Malformed number ��ԧEƦ
cpio: Malformed number �ԧEƦ�
cpio: Malformed number ԧEƦ��
cpio: Malformed number �EƦ��D
cpio: Malformed number EƦ��D�
cpio: Malformed number Ʀ��D�1
cpio: Malformed number Ʀ��D�1�
Code:
# lsinitramfs /boot/initrd.buffalo
cpio: premature end of archive
I was able to unpack /boot/initrd.buffalo like this, but i was unable to pack it again:
Code:
# tail -c+65 < /boot/initrd.buffalo > out
# pax -z -r < out
# ls -l
# ls -l
total 6440
lrwxrwxrwx 1 root root 7 Dec 9 11:30 bin -> usr/bin
drwxr-xr-x 9 root root 4096 Dec 28 05:42 boot-temp
drwxr-xr-x 3 root root 4096 Dec 9 11:30 conf
drwxr-xr-x 5 root root 4096 Dec 9 11:31 etc
-rwxr-xr-x 1 root root 6338 Aug 22 2019 init
lrwxrwxrwx 1 root root 7 Dec 9 11:30 lib -> usr/lib
-rw-r--r-- 1 root root 6550969 Dec 28 09:43 out
drwxr-xr-x 2 root root 4096 Dec 9 11:30 run
lrwxrwxrwx 1 root root 8 Dec 9 11:30 sbin -> usr/sbin
drwxr-xr-x 5 root root 4096 Dec 9 11:30 scripts
drwxr-xr-x 2 root root 4096 Dec 9 09:39 sdb1
drwxr-xr-x 2 root root 4096 Dec 9 09:39 sdb3
drwxr-xr-x 5 root root 4096 Dec 9 11:30 usr
# apt-get update
Get:1 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB]
Hit:2 http://http.us.debian.org/debian buster InRelease
Get:3 http://http.us.debian.org/debian buster-updates InRelease [51.9 kB]
Get:4 https://raw.githubusercontent.com/1000001101000/Debian_on_Buffalo/master/PPA buster InRelease [1,651 B]
Get:5 http://security.debian.org/debian-security buster/updates/main Sources [159 kB]
Get:6 http://security.debian.org/debian-security buster/updates/main armel Packages [232 kB]
Get:7 http://security.debian.org/debian-security buster/updates/main Translation-en [141 kB]
Get:8 http://http.us.debian.org/debian buster-updates/main Sources.diff/Index [4,672 B]
Get:9 http://http.us.debian.org/debian buster-updates/main armel Packages.diff/Index [4,672 B]
Get:10 http://http.us.debian.org/debian buster-updates/main Sources 2020-12-24-1401.30.pdiff [415 B]
Get:10 http://http.us.debian.org/debian buster-updates/main Sources 2020-12-24-1401.30.pdiff [415 B]
Get:11 http://http.us.debian.org/debian buster-updates/main armel Packages 2020-12-24-1401.30.pdiff [286 B]
Get:11 http://http.us.debian.org/debian buster-updates/main armel Packages 2020-12-24-1401.30.pdiff [286 B]
Fetched 661 kB in 12s (56.8 kB/s)
Reading package lists... Done
# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
apt apt-transport-https apt-utils libapt-inst2.0 libapt-pkg5.0 python-apt-common python3-apt tzdata
8 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 3,489 kB of archives.
After this operation, 2,048 B of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://security.debian.org/debian-security buster/updates/main armel libapt-pkg5.0 armel 1.8.2.2 [855 kB]
Get:2 http://http.us.debian.org/debian buster-updates/main armel tzdata all 2020e-0+deb10u1 [266 kB]
Get:3 http://security.debian.org/debian-security buster/updates/main armel libapt-inst2.0 armel 1.8.2.2 [200 kB]
Get:4 http://security.debian.org/debian-security buster/updates/main armel apt armel 1.8.2.2 [1,354 kB]
Get:5 http://security.debian.org/debian-security buster/updates/main armel apt-utils armel 1.8.2.2 [402 kB]
Get:6 http://security.debian.org/debian-security buster/updates/main armel apt-transport-https all 1.8.2.2 [149 kB]
Get:7 http://security.debian.org/debian-security buster/updates/main armel python-apt-common all 1.8.4.3 [96.3 kB]
Get:8 http://security.debian.org/debian-security buster/updates/main armel python3-apt armel 1.8.4.3 [167 kB]
Fetched 3,489 kB in 1s (2,429 kB/s)
Reading changelogs... Done
Preconfiguring packages ...
(Reading database ... 27554 files and directories currently installed.)
Preparing to unpack .../libapt-pkg5.0_1.8.2.2_armel.deb ...
Unpacking libapt-pkg5.0:armel (1.8.2.2) over (1.8.2.1) ...
Setting up libapt-pkg5.0:armel (1.8.2.2) ...
(Reading database ... 27554 files and directories currently installed.)
Preparing to unpack .../libapt-inst2.0_1.8.2.2_armel.deb ...
Unpacking libapt-inst2.0:armel (1.8.2.2) over (1.8.2.1) ...
Preparing to unpack .../archives/apt_1.8.2.2_armel.deb ...
Unpacking apt (1.8.2.2) over (1.8.2.1) ...
Setting up apt (1.8.2.2) ...
(Reading database ... 27554 files and directories currently installed.)
Preparing to unpack .../apt-utils_1.8.2.2_armel.deb ...
Unpacking apt-utils (1.8.2.2) over (1.8.2.1) ...
Preparing to unpack .../tzdata_2020e-0+deb10u1_all.deb ...
Unpacking tzdata (2020e-0+deb10u1) over (2020d-0+deb10u1) ...
Preparing to unpack .../apt-transport-https_1.8.2.2_all.deb ...
Unpacking apt-transport-https (1.8.2.2) over (1.8.2.1) ...
Preparing to unpack .../python-apt-common_1.8.4.3_all.deb ...
Unpacking python-apt-common (1.8.4.3) over (1.8.4.1) ...
Preparing to unpack .../python3-apt_1.8.4.3_armel.deb ...
Unpacking python3-apt (1.8.4.3) over (1.8.4.1) ...
Setting up apt-transport-https (1.8.2.2) ...
Setting up libapt-inst2.0:armel (1.8.2.2) ...
Setting up tzdata (2020e-0+deb10u1) ...
Current default time zone: 'America/New_York'
Local time is now: Mon Dec 28 09:51:12 EST 2020.
Universal Time is now: Mon Dec 28 14:51:12 UTC 2020.
Run 'dpkg-reconfigure tzdata' if you wish to change it.
Setting up python-apt-common (1.8.4.3) ...
Setting up apt-utils (1.8.2.2) ...
Setting up python3-apt (1.8.4.3) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for ntp (1:4.2.8p12+dfsg-4) ...
Processing triggers for libc-bin (2.28-10) ...
Finally I've re-installed the kernel (and by extension regenerated uImage.buffalo and initrd.buffalo)
Code:
# apt-get reinstall linux-image-4.12.13
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 22.2 MB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 https://raw.githubusercontent.com/1000001101000/Debian_on_Buffalo/master/PPA buster/main armel linux-image-4.12.13 armel 4.12.13-4 [22.2 MB]
Fetched 22.2 MB in 15s (1,495 kB/s)
(Reading database ... 27554 files and directories currently installed.)
Preparing to unpack .../linux-image-4.12.13_4.12.13-4_armel.deb ...
Unpacking linux-image-4.12.13 (4.12.13-4) over (4.12.13-4) ...
Setting up linux-image-4.12.13 (4.12.13-4) ...
update-initramfs: Generating /boot/initrd.img-4.12.13
I: The initramfs will attempt to resume from /dev/sda2
I: (UUID=a4ebb9fd-00ba-46ff-a448-165d6e21a7b8)
I: Set the RESUME variable to override this.
flash-kernel: deferring update (trigger activated)
flash-kernel: deferring update (trigger activated)
Processing triggers for flash-kernel (3.99) ...
flash-kernel: installing version 4.12.13
Generating kernel u-boot image... done.
Taking backup of uImage.buffalo.
Installing new uImage.buffalo.
Generating initramfs u-boot image... done.
Taking backup of initrd.buffalo.
Installing new initrd.buffalo.
I notice initrd.buffalo is now way bigger:
Code:
# ls -l /boot/
total 44140
-rw-r--r-- 1 root root 164677 Nov 3 15:19 config-4.12.13
drwxr-xr-x 2 root root 4096 Dec 28 08:56 hidden
-rw-r--r-- 1 root root 15327846 Dec 28 10:07 initrd.buffalo
-rw-r--r-- 1 root root 6551033 Dec 9 11:32 initrd.buffalo.bak
-rw-r--r-- 1 root root 15327782 Dec 28 10:07 initrd.img-4.12.13
drwx------ 2 root root 16384 Dec 9 05:50 lost+found
-rw-r--r-- 1 root root 1549426 Nov 3 15:19 System.map-4.12.13
-rw-r--r-- 1 root root 2055672 Dec 28 10:07 uImage.buffalo
-rw-r--r-- 1 root root 2055672 Dec 9 11:32 uImage.buffalo.bak
-rwxr-xr-x 1 root root 2055600 Nov 3 15:19 vmlinuz-4.12.13
I've installed Debian on the hard drive of my Nas. This works OK, but I want to run Debian from a thumb drive, so the hard drives in the NAS can stay idle while the NAS waits for requests for files from the network.
I think there are 2 issues here - but I may be wrong.
1. You have an issue with Debian 10 installed on your Buffalo NAS desktop computer with a 1TB hard disk drive.
2. You want to install Debian 10 on a usb.
Have I got this right? Sorry if my question is elementary.
I think there are 2 issues here - but I may be wrong.
1. You have an issue with Debian 10 installed on your Buffalo NAS desktop computer with a 1TB hard disk drive.
2. You want to install Debian 10 on a usb.
Have I got this right? Sorry if my question is elementary.
Thank you for your reaction. I have solved the problem. It turns out I needed to add usb drivers to the initrd. This process is described in more detail here: https://github.com/1000001101000/Deb...falo/issues/72
To answer your questions:
1. Almost. The Buffalo Terrastation Pro TS-HTGL/R5 TS-H4.0TGL/R5 BUF-TS-HTGLR5(A) is not a desktop computer. This is a embedded system with an arm processor, and 4 sata ports. Therefore the mechanism for booting is very different compared to a standard PC. It does have 2 1TB hard drives though.
2. I do want to install Debian 10 to a memory stick, but the Buffalo Terrastation has to boot from it. This is not possible, but it is possible to use the memory stick as the root file system.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.