New IT forum
25 July 2014, 09:03:01 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: PiHub now in stock.
 
   Home   SHOP Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: preconfigured Debian SD cards  (Read 14291 times)
NewIT_Marcus
Hero Member
*****
Posts: 960


« on: 15 February 2010, 07:56:47 am »

Some information about the SD cards that we sell that are pre-loaded with Debian Lenny.

We use debootstrap as detailed in a thread on the plug computer forum.

The process runs on a Sheevaplug from start to finish and involves:

  • Installing debootstrap and other pre-requisites
  • Using deboostrap to download packages into a rootfs
  • Manipulating files within the rootfs
  • Compressing that rootfs to rootfs.tar.gz
  • Running the installer with this rootfs instead of the original Ubuntu rootfs that is included with the installer download, with the target being an SD card

We make only minor changes to the script provided from the forum:

Install nano

Added to the bottom of /etc/sysctl.conf:

Code:
# New IT added 2009-12-05:
# See: http://plugcomputer.org/plugwiki/index.php/Reduce_Flash_Writes
vm.swappiness=0
vm.laptop_mode=5
vm.dirty_writeback_centisecs=1500
vm.dirty_expire_centisecs=1500

We use kernel version 2.6.30.2, the same version that we supply with our Ubuntu / UBIFS configurations.

These 2 changes define our version 1.1 for white sheevaplugs.

Note that we did not use mknod during the build process, therefore in order to make a USB stick available you should manually enter (this only needs to be done once):

Code:
mknod /dev/sda b 8 0
mknod /dev/sda1 b 8 1
for more partitions on a USB device:

Code:
mknod /dev/sda2 b 8 2
mknod /dev/sda3 b 8 3
mknod /dev/sda4 b 8 4
mknod /dev/sda5 b 8 5
mknod /dev/sda6 b 8 6
mknod /dev/sda7 b 8 7
mknod /dev/sda8 b 8 8

This rootfs was prepared in early December and as at the time of writing, apt-get upgrade will offer several updates since this time.

Note that this procedure can be applied to both Debian Lenny and Debian Squeeze, and if a rootfs is available for another O/S, the latter steps in this procedure can be used to prepare that O/S (ie Fedora 12).

« Last Edit: 15 February 2010, 07:19:30 pm by NewIT_Marcus » Logged
NewIT_Marcus
Hero Member
*****
Posts: 960


« Reply #1 on: 15 February 2010, 07:40:28 pm »

For the eSATA plugs, we rebuilt the rootfs for Debian Squeeze with a few changes. This is version 1.2. We do not have Debian Lenny working the way we would like right now ... we see some (module) error messages during boot and we want to figure out what's going on before offering a Lenny configuration.

The eSATA port appears as /dev/sda and the USB port as /dev/sdb. (On the non-eSATA plugs, /dev/sda is the USB port).

This time we created the /dev/sda nodes as above, plus 8 for /dev/sdb:

Code:
mknod /dev/sdb b 8 16
mknod /dev/sdb1 b 8 17
mknod /dev/sdb2 b 8 18
mknod /dev/sdb3 b 8 19
mknod /dev/sdb4 b 8 20
mknod /dev/sdb5 b 8 21
mknod /dev/sdb6 b 8 22
mknod /dev/sdb7 b 8 23
mknod /dev/sdb8 b 8 24

We also updated the packages so that they are completely up to date as of Sunday 14th February 2010 (and probably, at the time of posting 1 day later, no longer up-to-date).

We also created /etc/sysctl.d/10-process-security.conf with contents:

Code:
vm.mmap_min_addr = 32768

(See plugcomputer wiki for why).

And, although it's not related to the rootfs, we compiled an eSATA-compatible kernel version 2.6.32.7, and modules. We used patches from sheeva.with-linux.com, plus a small number of additional patches specific to eSATA. In general, the compile options are the same as those available in the non-eSATA sheeva.with-linux.com version.

I'll provide more details about how to (cross) compile in another post.
Logged
NewIT_Marcus
Hero Member
*****
Posts: 960


« Reply #2 on: 22 February 2010, 09:56:02 pm »

From a security point of view, using ssh keys that already exist on a preconfigured plug is not a good idea. You don't know how or when those keys were generated, or who may have had access to those keys. In some cases (it happens on our Fedora SD card, and I'm not sure if it happens on the Debian cards), the keys are generated at the time of first boot. You could look into that, and attempt to verify it, and decide whether or not you believed that this was as secure as you would like.

Or you could just go straight ahead with generating new keys (which is what we would recommend, as good security practice):

Code:
ssh-keygen -q -f /etc/ssh/ssh_host_key -N '' -t rsa1
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa
ssh-keygen -f /etc/ssh/ssh_host_dsa_key -N '' -t dsa

See also http://www.softec.st/en/OpenSource/DevelopersCorner/HowToRegenerateNewSsh.html

2010-10-24: Modified to correct parameter in ssh commands
« Last Edit: 24 October 2010, 10:05:37 pm by NewIT_Marcus » Logged
obergix
Newbie
*
Posts: 6


« Reply #3 on: 14 March 2010, 07:25:33 am »

See also this :
http://www.newit.co.uk/forum/index.php/topic,50.0.html for list of tested cards.
Logged
ursus
Newbie
*
Posts: 9


« Reply #4 on: 06 May 2010, 09:09:42 am »

I bought a sheevaplug with multiboot debian 5.0 on sd card. My goal is build a mini-server connecting a usb hd 320 gb as home directory. I've managed  /etc/fstab  and insert this line /dev/sda1 /home defaults 0 0
But don't work. If I try with fdisk /dev/sda the answer is "cannot open device". I think that is the real problem. When I try removing sd card with debian and start up ubuntu I can see my usb hd with fdisk.
What I can do?
Thanks

Logged
peter a
Full Member
***
Posts: 162


« Reply #5 on: 06 May 2010, 10:45:54 am »

are you booting from the SD card and adding the mounting the hard drive

or

booting from the hard drive ?

try just mounting the drive or fdisk /dev/sda and seeing if the drive is there !!!!
Logged
ursus
Newbie
*
Posts: 9


« Reply #6 on: 06 May 2010, 01:10:44 pm »

I'm booting from sd card. Connecting hd after booting fdisk /dev/sda answer "cannot open device"
Logged
NewIT_Marcus
Hero Member
*****
Posts: 960


« Reply #7 on: 06 May 2010, 04:50:47 pm »

I'm booting from sd card. Connecting hd after booting fdisk /dev/sda answer "cannot open device"

Try the mknod commands listed above.
Logged
ursus
Newbie
*
Posts: 9


« Reply #8 on: 06 May 2010, 09:10:11 pm »

I'm booting from sd card. Connecting hd after booting fdisk /dev/sda answer "cannot open device"

Try the mknod commands listed above.
Thank you for reply. I'd tryed "mknod /dev/sda b 8 16" but obtain "Unable to open /dev/sda" with hd usb and 2 different usb sticks
Booting from flash ubuntu os I can see hd and sticks with fdisk command as already said . You can see the print screen follow

debian:~# mknod /dev/sdab b 8 16
debian:~# fdisk /dev/sda

Unable to open /dev/sda


and lsusb

debian:~# lsusb
Bus 001 Device 005: ID 1e68:0017 TrekStor GmbH & Co. KG
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub





« Last Edit: 06 May 2010, 09:16:00 pm by ursus » Logged
peter a
Full Member
***
Posts: 162


« Reply #9 on: 06 May 2010, 09:27:46 pm »

whats syslog showing ?

I`m getting :-

kernel: usb 1-1.1: new high speed USB device using orion-ehci and address 14
kernel: scsi3 : usb-storage 1-1.1:1.0
kernel: scsi 3:0:0:0: Direct-Access     Kingston DataTraveler 2.0 1.00 PQ: 0 ANSI: 2
kernel: sd 3:0:0:0: Attached scsi generic sg0 type 0
kernel: sd 3:0:0:0: [sda] 31506432 512-byte logical blocks: (16.1 GB/15.0 GiB)
kernel: sd 3:0:0:0: [sda] Write Protect is off
kernel: sd 3:0:0:0: [sda] Mode Sense: 23 00 00 00
kernel: sd 3:0:0:0: [sda] Assuming drive cache: write through
kernel: sd 3:0:0:0: [sda] Assuming drive cache: write through
kernel: sda: sda1
kernel: sd 3:0:0:0: [sda] Assuming drive cache: write through
kernel: sd 3:0:0:0: [sda] Attached SCSI removable disk
Logged
ursus
Newbie
*
Posts: 9


« Reply #10 on: 06 May 2010, 09:36:33 pm »

whats syslog showing ?

I`m getting :-

kernel: usb 1-1.1: new high speed USB device using orion-ehci and address 14
kernel: scsi3 : usb-storage 1-1.1:1.0
kernel: scsi 3:0:0:0: Direct-Access     Kingston DataTraveler 2.0 1.00 PQ: 0 ANSI: 2
kernel: sd 3:0:0:0: Attached scsi generic sg0 type 0
kernel: sd 3:0:0:0: [sda] 31506432 512-byte logical blocks: (16.1 GB/15.0 GiB)
kernel: sd 3:0:0:0: [sda] Write Protect is off
kernel: sd 3:0:0:0: [sda] Mode Sense: 23 00 00 00
kernel: sd 3:0:0:0: [sda] Assuming drive cache: write through
kernel: sd 3:0:0:0: [sda] Assuming drive cache: write through
kernel: sda: sda1
kernel: sd 3:0:0:0: [sda] Assuming drive cache: write through
kernel: sd 3:0:0:0: [sda] Attached SCSI removable disk


This
May  6 23:13:11 debian kernel: usb 1-1: new high speed USB device using orion-ehci and address 4
May  6 23:13:11 debian kernel: usb 1-1: configuration #1 chosen from 1 choice
May  6 23:13:11 debian kernel: scsi1 : SCSI emulation for USB Mass Storage devices
May  6 23:13:11 debian kernel: usb-storage: device found at 4
May  6 23:13:11 debian kernel: usb-storage: waiting for device to settle before scanning
May  6 23:13:16 debian kernel: scsi 1:0:0:0: Direct-Access     ChipsBnk SD/MMCReader     4080 PQ: 0 ANSI: 2
May  6 23:13:16 debian kernel: sd 1:0:0:0: Attached scsi generic sg0 type 0
May  6 23:13:16 debian kernel: usb-storage: device scan complete
May  6 23:13:16 debian kernel: sd 1:0:0:0: [sda] 7744512 512-byte hardware sectors: (3.96 GB/3.69 GiB)
May  6 23:13:16 debian kernel: sd 1:0:0:0: [sda] Write Protect is off
May  6 23:13:16 debian kernel: sd 1:0:0:0: [sda] Mode Sense: 0b 00 00 08
May  6 23:13:16 debian kernel: sd 1:0:0:0: [sda] Assuming drive cache: write through
May  6 23:13:16 debian kernel: sd 1:0:0:0: [sda] Assuming drive cache: write through
May  6 23:13:16 debian kernel: sda: sda1 sda2
May  6 23:13:16 debian kernel: sd 1:0:0:0: [sda] Attached SCSI removable disk
May  6 23:14:00 debian kernel: usb 1-1: USB disconnect, address 4
May  6 23:14:07 debian kernel: usb 1-1: new high speed USB device using orion-ehci and address 5
May  6 23:14:07 debian kernel: usb 1-1: configuration #1 chosen from 1 choice
May  6 23:14:07 debian kernel: scsi2 : SCSI emulation for USB Mass Storage devices
May  6 23:14:07 debian kernel: usb-storage: device found at 5
May  6 23:14:07 debian kernel: usb-storage: waiting for device to settle before scanning
May  6 23:14:12 debian kernel: scsi 2:0:0:0: Direct-Access     TrekStor DS pocket g.u         PQ: 0 ANSI: 2 CCS
May  6 23:14:12 debian kernel: sd 2:0:0:0: Attached scsi generic sg0 type 0
May  6 23:14:12 debian kernel: usb-storage: device scan complete
Logged
NewIT_Marcus
Hero Member
*****
Posts: 960


« Reply #11 on: 07 May 2010, 07:40:05 am »

I'm booting from sd card. Connecting hd after booting fdisk /dev/sda answer "cannot open device"

Try the mknod commands listed above.
Thank you for reply. I'd tryed "mknod /dev/sda b 8 16" but obtain "Unable to open /dev/sda" with hd usb and 2 different usb sticks
Booting from flash ubuntu os I can see hd and sticks with fdisk command as already said . You can see the print screen follow

debian:~# mknod /dev/sdab b 8 16
debian:~# fdisk /dev/sda

Unable to open /dev/sda


and lsusb

debian:~# lsusb
Bus 001 Device 005: ID 1e68:0017 TrekStor GmbH & Co. KG
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


If you really did copy & paste into your post, you got the mknod command wrong. And you need as many nodes / files as you would have partitions on the device.
Logged
ursus
Newbie
*
Posts: 9


« Reply #12 on: 07 May 2010, 02:44:07 pm »

really I did copy & paste. I'm learning Linux and I don't know mknod command. My hd has only 1 partition
ext3 that I want to use as home directory on linux system.
Logged
NewIT_Marcus
Hero Member
*****
Posts: 960


« Reply #13 on: 07 May 2010, 04:26:01 pm »

really I did copy & paste. I'm learning Linux and I don't know mknod command. My hd has only 1 partition
ext3 that I want to use as home directory on linux system.

So
Code:
mknod /dev/sdab b 8 16
is incorrect, you see that, right?

Your USB-connected hdd should appear (only after you use mknod) as /dev/sda - that's the "device" as a whole, the first partition will be /dev/sda1.
Logged
ursus
Newbie
*
Posts: 9


« Reply #14 on: 07 May 2010, 05:59:49 pm »

really I did copy & paste. I'm learning Linux and I don't know mknod command. My hd has only 1 partition
ext3 that I want to use as home directory on linux system.

So
Code:
mknod /dev/sdab b 8 16
is incorrect, you see that, right?

Your USB-connected hdd should appear (only after you use mknod) as /dev/sda - that's the "device" as a whole, the first partition will be /dev/sda1.
Ok the right way is " mknod /dev/sda b 8 0 " and "mknod /dev/sda1 b 8 1"  Now what I ca do to use hd usb as /home system directory?
« Last Edit: 07 May 2010, 08:48:49 pm by ursus » Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!