VME-CPU: Difference between revisions

From DaqWiki
Jump to navigation Jump to search
Line 39: Line 39:
** install master boot loader: cd /mnt/tmp/boot; dd if=mbr.bin of=/dev/sdX (NOTE: ***NOT** /dev/sdX1)
** install master boot loader: cd /mnt/tmp/boot; dd if=mbr.bin of=/dev/sdX (NOTE: ***NOT** /dev/sdX1)
** install extlinux boot loader: cd /mnt/tmp/boot; ./extlinux -i . (NOTE: notice the "./" - make sure to run the extlinux executable from .../boot, NOT the one installed in the system)
** install extlinux boot loader: cd /mnt/tmp/boot; ./extlinux -i . (NOTE: notice the "./" - make sure to run the extlinux executable from .../boot, NOT the one installed in the system)
* install GRUB boot loader (SL6)
* install GRUB boot loader (SL6) --- (NOTE: in the line below, remember to replace "/dev/sdX" with the disk name)
** echo -e "device (hd0) /dev/sdX\nroot (hd0,0)\nsetup (hd0)\n" | grub --batch --no-floppy
** echo -e "device (hd0) /dev/sdX\nroot (hd0,0)\nsetup (hd0)\n" | grub --batch --no-floppy
* update boot disk UUID (SL6)
* update boot disk UUID (SL6) --- (NOTE: dumpe2fs prints the UUID of the new disk, cut-and-paste this UUID into the sed commands below)
** dumpe2fs /dev/sdX1 | grep UUID
** dumpe2fs /dev/sdX1 | grep UUID
** edit grub.conf: sed 's/UUID=\S*/UUID=ddc00d49-1c17-4803-ac0b-d6eb89d9e729/' -i /mnt/tmp/boot/grub/grub.conf
** edit grub.conf: sed 's/UUID=\S*/UUID=ddc00d49-1c17-4803-ac0b-d6eb89d9e729/' -i /mnt/tmp/boot/grub/grub.conf

Revision as of 19:32, 20 August 2011

VME CPU information

Cloning USB and CF Flash boot cards

The V7805 VME CPU can run Linux from USB flash memory, V7865 VME CPU can run Linux from CompactFlash or USB flash memory. Disk size 8 GB or bigger is recommended for running SL5.5 Linux. Highest available speed grade devices should be used: 266X or better for CompactFlash, 200X or "30MB read/15MB write" for USB Flash. Also be aware that some CompactFlash and USB Flash devices have been observed to corrupt Linux filesystems within a few days of use. The specific flash memory brands and models we presently use do not see to have this problem.

When working CompactFlash memory, attach it to a USB-CF adapter and treat it as USB flash memory in the following instructions.

  • attach USB flash to the computer to be cloned (or any computer - we will use rsync to copy the data)
  • become root
  • check that correct device appears in the device list: fdisk -l
  • assume new device is /dev/sdX, original boot disk is /dev/sda.
  • repartition the device:
    • fdisk -H 224 -S 56 /dev/sdX
    • create one partition covering the whole device
    • set partition type 83 (Linux)
    • set bootable flag (command "a")
    • result should look like this:
[root@lxdaq09 ~]# fdisk -l

Disk /dev/sda: 8011 MB, 8011120640 bytes
224 heads, 56 sectors/track, 1247 cylinders
Units = cylinders of 12544 * 512 = 6422528 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1247     7821156   83  Linux
  • /usr/bin/time mke2fs -j /dev/sdX1 (should take about 30 seconds)
  • tune2fs -i0 -c0 /dev/sdX1
  • mkdir -p /mnt/tmp
  • mount /dev/sdX1 /mnt/tmp
  • CLONE CURRENT BOOT DISK: cd /; rsync -ax . /mnt/tmp; cd /dev; rsync -a . /mnt/tmp/dev
  • CLONE lxdaq08 32-bit boot image (V7805, V7865): cd /ladd/data1/root/lxdaq08; rsync -ax --delete-after . /mnt/tmp
  • CLONE ANOTHER FLASH DISK: cd /another/flash/disk; /usr/bin/time rsync -ax . /mnt/tmp
  • check result: run "df", new filesystem should be about as full as the original one
  • sync; cd /; umount /dev/sdX1; mount /dev/sdX1 /mnt/tmp
  • install SYSLINUX/EXTLINUX boot loader (SL5)
    • install master boot loader: cd /mnt/tmp/boot; dd if=mbr.bin of=/dev/sdX (NOTE: ***NOT** /dev/sdX1)
    • install extlinux boot loader: cd /mnt/tmp/boot; ./extlinux -i . (NOTE: notice the "./" - make sure to run the extlinux executable from .../boot, NOT the one installed in the system)
  • install GRUB boot loader (SL6) --- (NOTE: in the line below, remember to replace "/dev/sdX" with the disk name)
    • echo -e "device (hd0) /dev/sdX\nroot (hd0,0)\nsetup (hd0)\n" | grub --batch --no-floppy
  • update boot disk UUID (SL6) --- (NOTE: dumpe2fs prints the UUID of the new disk, cut-and-paste this UUID into the sed commands below)
    • dumpe2fs /dev/sdX1 | grep UUID
    • edit grub.conf: sed 's/UUID=\S*/UUID=ddc00d49-1c17-4803-ac0b-d6eb89d9e729/' -i /mnt/tmp/boot/grub/grub.conf
    • edit fstab: sed 's/UUID=\S*/UUID=ddc00d49-1c17-4803-ac0b-d6eb89d9e729/' -i /mnt/tmp/etc/fstab
  • cd /; umount /dev/sdX1
  • disconnect the new boot disk, try to boot from it.

Extlinux boot file

DEFAULT menu.c32
PROMPT 0
TIMEOUT 50

MENU TITLE TRIUMF DAQ USB BOOT32 ver K.O. 2011feb03

LABEL automatic
  MENU DEFAULT
  com32 ifcpu.c32
  append debug multicore -- linux-V7865-32 -- linux-V7805

LABEL linux-V7865-32
  kernel vmlinuz-2.6.18-194.32.1.el5
  append initrd=initrd-2.6.18-194.32.1.el5.img panic=60 ro rootdelay=5 rootwait ro root=/dev/sda1

LABEL linux-V7865-32-old
  kernel vmlinuz-2.6.18-194.8.1.el5
  append initrd=initrd-2.6.18-194.8.1.el5-32-usbboot.img panic=60 ro rootdelay=5 rootwait ro root=/dev/sda1

LABEL linux-V7865-64
  kernel vmlinuz-2.6.18-194.11.1.el5
  append initrd=initrd-2.6.18-194.11.1.el5.V7865.img panic=60 ro rootdelay=5 rootwait ro root=/dev/sda1

LABEL linux-V7805
  kernel vmlinuz-2.6.34.1-32-v7805
  append panic=60 rootdelay=5 rootwait ro root=/dev/sda1

LABEL memtest
  kernel memtest86+-1.65

#label linux
#  kernel vmlinuz-2.6.34.1-32-v7805
#  append panic=60 rootdelay=5 rootwait ro root=/dev/sda1
#label linux
#  kernel vmlinuz-2.6.34.1-32-v7805
#  append panic=60 root=/dev/nfs nfsroot=142.90.111.60:/home1/laddvme05.triumf.ca,nfsvers=3,tcp,rsize=32768,wsize=32768 ip=::::::dhcp console=ttyS0,115200n8

Updating Linux kernel

Updating Linux kernel on USB/CF flash boot disks

  • install latest kernel: yum update
  • identify latest kernel files:
    • ls -ltr /boot | grep vmlinuz | tail -1
    • ls -ltr /boot | grep initrd | tail -1
  • edit /boot/extlinux.conf
    • duplicate the entry marked "MENU DEFAULT"
    • change file names for the first entry according to the newly installed kernel
    • remove "MENU DEFAULT" from all entries except the new one
  • reboot into the new kernel

V7865 BIOS Settings

  • enter BIOS by pressing "DEL" during power up
  • Boot->Boot setting "Wait for F1" set to "Disabled"
  • Chipset->South Bridge "USB 2.0 Controller" set to "Enabled"
  • Advanced->IDE configuration set to "Disabled" (unless using CompactFlash boot disk)
  • Advanced->Remote access set to "Disabled"
  • Advanced->USB->"USB 2.0 Controller Mode" set to "HiSpeed"
  • Exit-> "Save changes and Exit"