LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - Installation
User Name
Password
Slackware - Installation This forum is for the discussion of installation issues with Slackware.

Notices


Reply
  Search this Thread
Old 01-31-2008, 12:22 PM   #16
Erik_FL
Member
 
Registered: Sep 2005
Location: Boynton Beach, FL
Distribution: Slackware
Posts: 821

Rep: Reputation: 258Reputation: 258Reputation: 258

I should warn you that I spent over three days installing Slackware to boot from my RAID array because I had to do a lot of manual steps and create files ahead of time on another Slackware system.

Since "dmraid" doesn't come as a standard part of Slackware, you have to compile it ahead of time on an existing Slackware system (the same version of Slackware that you want to install to RAID). It helps if you can also compile and install GRUB ahead of time and make a GRUB boot floppy or CD containing all the required GRUB files. You may find "VirtualBox" or another virtual machine program useful for running Slackware and building the required files under some other OS (Windows, etc.)

You can't compile "dmraid" during installation of Slackware. You have to compile "dmraid" ahead of time. In order to compile grub or a kernel during the actual installation to RAID, you have to use "chroot" after booting the Slackware installation CD.
  1. Boot from the Slackware Installation/Boot CD
  2. Copy the "dmraid" and "libdevmapper" files to the RAM disk /sbin and /lib
  3. Run "dmraid" to detect the RAID array
  4. Use the "setup" program on the Slackware CD to install Linux (skip LILO setup)
  5. Mount the new root partition.
  6. Copy the "dmraid" and "libdevmapper" files to the new Linux root partition (/sbin and /lib).
  7. Use "chroot" to change to the new root partition.
  8. Use "mount -t proc proc /proc" and "mount -t sysfs sys /sys"
  9. Compile the Linux kernel if necessary and install it
  10. Install GRUB sources and compile, or copy from another system
  11. Create the required devices for the root and swap, EX: /dev/sdr1 /dev/sdr2
  12. Create the rules file for "udev" under "/etc/udev/rules.d"
  13. Copy the modified "init" file and the script (below) to a temporary directory
  14. Use the script (below) to create the "initrd" image.
  15. Create the required "map" file for GRUB to find devices.
  16. Set up GRUB to boot from the MBR or Linux root partition boot sector.
  17. Alternatively you can create a GRUB boot floppy and install GRUB using that.
  18. Test booting of the system. If you have a problem, boot the Slackware CD again, run "dmraid" and use "chroot", etc.

Here is a script that I used to create the "initrd" after I installed the "dmraid" and "libdevmapper" files to the Linux root.

Code:
ROOTDEVNAME="/dev/sdr3"		# Name of root device
LINUXVER="2.6.21.5"		# Linux modules version
CLIBVER="2.5"			# C library version
ROOTDIR="/boot/initrd-tree"	# Location of root filesystm
# Get most of the needed programs from the normal mkinitrd
mkinitrd -k $LINUXVER -c -r "$ROOTDEVNAME" -f ext3
# Create directories
for dir in \
   "bin" "dev" "etc" "mnt" "proc" "sbin" "sys" "usr" \
   "tmp" "var" "var/lock" "var/log" "var/run" "var/tmp"
   do
   if [ ! -d "$ROOTDIR/$dir" ] ; then
      mkdir -p "$ROOTDIR/$dir"
   fi
done
# Create devices
pushd "$ROOTDIR/dev" > /dev/null
# Remove existing devices
rm -Rf *
# Create root device name
cp -dpPR "$ROOTDEVNAME" .
chmod u=rw,g=rw,o= "$ROOTDIR$ROOTDEVNAME" 
# Device mapper for "dmraid"
mkdir mapper
chmod u=rwx,g=rx,o=rx mapper
chown root:root mapper
mknod -m u=rw,g=rw,o= mapper/control c 10 63
chown root:root mapper/control
# Required devices
mknod -m u=rw,g=,o= console c 5 1
chown root:tty console 
mknod -m u=rw,g=rw,o= ram0 b 1 0
chown root:disk ram0 
mknod -m u=rw,g=r,o= mem c 1 1
chown root:kmem mem 
mknod -m u=rw,g=r,o= kmem c 1 2
chown root:kmem kmem 
mknod -m u=rw,g=rw,o=rw null c 1 3
chown root:root null 
mknod -m u=rw,g=rw,o=rw zero c 1 5
chown root:root zero 
mkdir vc
chmod u=rwx,g=rx,o=rx vc
chown root:root vc
mknod -m u=rw,g=rw,o= vc/1 c 4 1
chown root:tty vc/1 
ln -s vc/1 tty1
# IDE Disks (up to 20) max 64 partitions per disk
drives=4
partitions=9
if [ $drives -gt 0 ] ; then
   majors=( 3 22 33 34 56 57 88 89 90 91)
   for drv in `seq 0 $(($drives-1))` ; do
      dev="abcdefghijklmnopqrst"
      dev=hd${dev:$drv:1} 
      major=${majors[$(($drv/2))]}  
      minor=$(( ($drv%2) * 64 ))
      mknod -m u=rw,g=rw,o= $dev b $major $minor
      chown root:disk $dev
      if [ $partitions -gt 0 ] ; then 
         for i in `seq 1 $partitions` ; do
            mknod -m u=rw,g=rw,o= $dev$i b $major $(($minor+$i)) 
            chown root:disk $dev$i
         done
      fi
   done
fi
# SCSI Disks (0 to 127) max 16 partitions per disk
drives=4
partitions=9
if [ $drives -gt 0 ] ; then
   majors=( 8 65 66 67 68 69 70 71)
   for drv in `seq 0 $(($drives-1))` ; do
      dev="abcdefghijklmnopqrstuvwxyz"
      if [ $drv -lt 26 ] ; then
         dev=sd${dev:$drv:1}
      else
         dev=sd${dev:$(($drv/26-1)):1}${dev:$(($drv%26)):1}
      fi
      major=${majors[$(($drv/16))]}  
      minor=$(( ($drv%16) * 16 ))
      mknod -m u=rw,g=rw,o= $dev b $major $minor
      chown root:disk $dev
      if [ $partitions -gt 0 ] ; then 
         for i in `seq 1 $partitions` ; do
            mknod -m u=rw,g=rw,o= $dev$i b $major $(($minor+$i)) 
            chown root:disk $dev$i
         done
      fi
   done
fi
# Floppy disks A and B
for i in `seq 0 1` ; do
   mknod -m u=rw,g=rw,o= fd$i b 2 $i 
   chown root:floppy fd$i
done
# Done with devices
popd > /dev/null
# Copy scripts and programs
cp -p init "$ROOTDIR"
chmod u=rwx,g=rx,o=rx "$ROOTDIR/init"
cp -p /sbin/dmraid "$ROOTDIR/sbin"
cp -p /bin/cut "$ROOTDIR/bin"
for lib in \
   "libdevmapper.so" "libdevmapper.so.1.02" \
   "libc.so.6" "ld-linux.so.2" \
   "ld-$CLIBVER.so" "libc-$CLIBVER.so"
   do
   if [ -e "/lib/$lib" ] ; then
      cp -Pp "/lib/$lib" "$ROOTDIR/lib/$lib"
   else
      echo "Library file not found \"/lib/$lib\""
      exit 1
   fi
done
# Make the compressed image file
mkinitrd
When you use the script, it's important to create the root device ahead of time under "/dev". For example, create "/dev/sdr3" with the correct major and minor unit number corresponding to the mapper device. Also, make sure that you have copied the files for "dmraid" and "libdevmapper" to the root partition before using the script. Change the symbols at the top of the script file for the correct root device name and Linux software versions.

Unless I missed something, here are the things that you need ahead of time.
  • dmraid program
  • libdevmapper files
  • grub sources or compiled grub files to install
  • A modified "init" file (use mkinitrd and then edit "init" to run "dmraid")
  • A copy of the script to create the initrd
  • Slackware installation CD that you can boot

Last edited by Erik_FL; 01-31-2008 at 12:24 PM.
 
Old 02-01-2008, 12:35 PM   #17
wdk23411
LQ Newbie
 
Registered: Jan 2008
Posts: 9

Rep: Reputation: 0
Sorry, I have not read the reply clearly.Thanks.
 
Old 02-01-2008, 12:43 PM   #18
wdk23411
LQ Newbie
 
Registered: Jan 2008
Posts: 9

Rep: Reputation: 0
It works. I can boot from the raid0 array now. Thank you very much.

Oops,the system boots, but it is not the one installed on the raid0 array. I was just maked a mistake.

Last edited by wdk23411; 02-02-2008 at 01:05 AM.
 
Old 02-02-2008, 01:07 AM   #19
wdk23411
LQ Newbie
 
Registered: Jan 2008
Posts: 9

Rep: Reputation: 0
I've got another problem here. When I run the dmraid tool, i've got some device name showing duruing selecting the target partition like "/dev/dm-0p9" (ps:My linux partition start with the 5th partition on the raid0 array.) and could not be found in the "/dev" directory. After the installation finished, I want to mount the new root partition, but failed with a message like "There is no such file" . I mounted the /dev/mapper/... when I did that. Is there something I did wrong?
 
Old 02-02-2008, 02:03 AM   #20
wdk23411
LQ Newbie
 
Registered: Jan 2008
Posts: 9

Rep: Reputation: 0
I have installed again. I found that the installation system recorgnize the /dev/mapper/isw* like /dev/dm-0p*, and the installation was successful. But it seams that all the operation was be done in the ram. After the installation finished I remount the /dev/mapper/isw* and found nothing in it. (ps : This time I do the make.xfs myself and I could remount those partitions.) Why this happened?
 
Old 02-02-2008, 11:03 AM   #21
Erik_FL
Member
 
Registered: Sep 2005
Location: Boynton Beach, FL
Distribution: Slackware
Posts: 821

Rep: Reputation: 258Reputation: 258Reputation: 258
What are the device names created by "dmraid"? The version I used created names like "/dev/mapper/pdc_bbbffffihj3".

I had to use that name "/dev/mapper/pdc_bbbffffihj3" as the name for the partition to create the filesystem and assign as the root "/" partition during setup.

To use some other name, you have to find out the major and minor unit number.

ls -l /dev/mapper/pdc_bbbffffihj3

Then create a device name for the correct major and minor unit number.

mknod /dev/sdr3 b 253 5

Replace the "253" and "5" with the major and minor unit number shown by "ls -l".

Remember that the "/dev" directory is in the RAM disk until you use "chroot".

ls -l /dev/mapper/pdc_bbbffffihj3
mount /dev/mapper/pdc_bbbffffihj3 /mnt/tmp
chroot /mnt/tmp
mount -t proc proc /proc
mount -t sysfs sys /sys
mknod /dev/sdr3 b 253 5

If you want to create or copy files before using "chroot" then include the full path.

mount /dev/mapper/pdc_bbbffffihj3 /mnt/tmp
cp -Pp /dev/mapper/pdc_bbbffffihj3 /mnt/tmp/dev/sdr3
chroot /mnt/tmp
mount -t proc proc /proc
mount -t sysfs sys /sys

Every time that you boot, you have to run "dmraid" to detect the RAID arrays and configure the device mapper. There is also a device for the entire array, with a name such as "/dev/mapper/pdc_bbbffffihj". Notice that it has no partition number at the end.

If you still have problems, please post the exact commmands that you entered, and the messages that were displayed. Also, post the names of the devices and the information shown by "ls -l" for each device name.
 
Old 02-03-2008, 02:23 PM   #22
agentc0re
Member
 
Registered: Apr 2007
Location: SLC, UTAH
Distribution: Slackware
Posts: 200

Rep: Reputation: 34
Eric, I've been reading and rereading your directions on how you got your fakeraid made but i seem to be missing something or worst case something of mine is broken. i'd hope not since it's all new.

So the part that im stuck at is at the beginning. This is what i am doing.
I have a cd burning with dmraid and lib's you made.
1. boot slack12
2. mount dmraid cd and copy libs and dmraid over to /lib and /sbin
3. start dmraid by typing dmraid -ay
4. fdisk partition (first i kept doing dm-0 but i read you have to do the one in the /dev/mapper/nvidia_*******) /dev/mapper/nvidia_bhfdead
a. i create 2 partitions, 1400Gig linux(bootable) 100Gig windows
5. i run dmraid -ay again to resync the tables so i don't have to restart
6. now i have two partitions in /dev/mapper
7. i run fdisk on /dev/mapper/nvidia_bhfdead1 (linux parition). set all availiable space to 1st partition. i also make it bootable
7. run fdisk on /dev/mapper/nvidia_bhfdead2 (windows partition). same as above.
8. run setup

When i run setup, i don't see /dev/mapper/nvidia_bhfdead*. depending if i have rebooted after it i see several things. If i don't reboot, i see the devices i see when i run fdisk -l. /dev/dm-0p0 and /dev/dm-0p1. i think 0p0 is from the partition i created from /dev/mapper/nvidia_bhfdead and 0p1 is from nvidia_bhfdead1. So logic told me to select 0p1 since it probably mapps to nvidia_bhfdead1 which later i will map to /dev/sdr1 (following your instructions assuming i can get that far). it formats okay (JFS) and i begin the install. first i wasn't selecting to install KDE. so it would get to mozilla package and freeze. if i select kde, it freezes some where in there (can't remember cuz i only did this once) I know my slack12 DVD is fine because i just installed it the other day before i started trying to do the fakeraid. I've been lucky enough to see an error saying something about kernel panic because it ran out of memory. so i got all paronoid about my mem and ran memtest. granted i didn't let it run longer than an hour on each pair but, i didn't get any errors. even with all 4 in, no errors. Sorry, little off topic.

Anyways, so if i restart and then copy the dmraid stuff over, start it. run setup, now i have 3 drives showing up that i could install too. it shows sda1, dm-0p0 & dm-0p1. sda and sdb are my two drives and in sda it also shows the partition info found in dm-0/nvidia_bhfdead when i run fdisk.

before running setup i also tried to do mknod /dev/sdr1 b 253 1 (which i get from ls -l /dev/mapper/nvidia_bhfdead1). after i tried running setup but it doesn't show that device either.

my guess is that it's installing everything in ram and it runs out of space on the install.

am i doing something wrong?


***Edit***
Sorry, a little screwup on my part. partitions are showing as follows
dm-0
dm-0p1 -linux
dm-0p2 -windows
dm-1
dm-1p1 - linux
dm-2
dm-2p1 - windows

Last edited by agentc0re; 02-03-2008 at 02:47 PM.
 
Old 02-04-2008, 10:52 AM   #23
Erik_FL
Member
 
Registered: Sep 2005
Location: Boynton Beach, FL
Distribution: Slackware
Posts: 821

Rep: Reputation: 258Reputation: 258Reputation: 258
I think the problem is that you should not do step 7. You use "fdisk" only once, to create the two partitions for "/dev/mapper/nvidia_bhfdead" (step 4). What you did with step 7 is create a second set of partitions inside the existing partitions. That is not necessary and probably results in the partition tables for the "dm-1" devices being written over later. The "dm-1" devices are not necessary and will cause problems if you use both "dm-1" and "dm-0".

The Slackware setup should do this, but the following would be correct in step 7.

mkfs -t ext3 /dev/mapper/nvidia_bhfdead1
mkfs -t vfat /dev/mapper/nvidia_bhfdead2

That will create a filesystem in each of the two partitions.
You should see something like this.

dm-0
dm-0p1 -linux
dm-0p2 -windows

You can then mount the filesystems to test them if you want.

mount -t ext3 /dev/mapper/nvidia_bhfdead1 /mnt/tmp
umount /mnt/tmp
mount -t vfat /dev/mapper/nvidia_bhfdead2 /mnt/tmp
umount /mnt/tmp

The Slackware setup should allow you to use the name "/dev/mapper/nvidia_bhfdead1" to refer to the Linux root partition.

I also noticed that you did not create a swap partition. You can create a logical partition for the swap partition and use the name "/dev/nvidia_bhfdead5".

dm-0
dm-0p1 -linux
dm-0p2 -windows
dm-0p5 -swap

The main reason that I used the names like "/dev/sdr3" is to make the init scripts for Linux work correctly. They have trouble using the names under "/dev/mapper" because the names start out as "/initrd/dev/mapper" and part way through the script become "/dev/mapper" later. You can use the names under "/dev/mapper" for the Linux setup and installation. Just create the other names like "/dev/sdr3" on the real Linux root partition before you try to boot from the hard disk. You may be able to use the "dm-0" device names. The important thing is that the names are the same before and after the init scripts in Linux run. The names created by UDEV must agree with those before UDEV starts. There is only one name for a partition in "/etc/fstab" and that name is used BEFORE and AFTER the init script runs. The "fstab" file is used first without UDEV and lastly with UDEV started. The contents of the Linux root partition "/dev" is first the real contents of the disk, and after UDEV it has the "pseudo" device names created by UDEV.

Last edited by Erik_FL; 02-04-2008 at 11:08 AM.
 
Old 02-04-2008, 11:03 AM   #24
Erik_FL
Member
 
Registered: Sep 2005
Location: Boynton Beach, FL
Distribution: Slackware
Posts: 821

Rep: Reputation: 258Reputation: 258Reputation: 258
I forgot to mention that you do not need to use "mkfs -t vfat" until you are actually ready to put some files in the Windows partition.

I had problems with Slackware because it was missing some required soft links for the "vfat" filesystem. You may need to do this before "mkfs" and "fsck" will work for "-t vfat".

cd /sbin
ln -s mkdosfs mkfs.vfat
ln -s dosfsck fsck.vfat

If you use the boot CD you need to create the soft links after every reboot. For Linux on the hard disk, just do the commands once and the links will remain.
 
Old 02-07-2008, 08:48 AM   #25
agentc0re
Member
 
Registered: Apr 2007
Location: SLC, UTAH
Distribution: Slackware
Posts: 200

Rep: Reputation: 34
Sorry it took a while for me to respond to this. Short story is that i got it to work. Long story is, well... as follows i guess

Steps I took to get it to work.
1. Before I started down the road i had made a grub boot cd using your example for my menu.lst. Which means I had to plan ahead a little. Tested to make sure it worked.
2. Copied over the dmraid/libs and create script to cd as well.
3. Boot slack12 cd
4. Mount dmraid cd and copy into /lib and /sbin
5. run dmraid -ay
6. fdisk /dev/mapper/*******(whatever fakeraid device you have)
7. After partitioning, rerun dmraid -ay
8. mkfs.***(ext3, jfs, xfs....) /dev/mapper/******X (X = number for the partition you created)
9. mount your "/" partition to /mnt. mount /dev/mapper/*****1 /mnt
10. mkswap /dev/mapper/*****2 swapon /dev/mappper/*****2
11. Run setup
12. When selecting the swap and target partition i selected the corrisponding dm-X (X being the number) to swap or / partition (we will have to edit fstab after install)
13. finished install
14. copy dmraid/lib's to /mnt/lib and /mnt/sbin and mv createinit to /mnt/tmp
15. ls -l /dev/mapper/*****1 and 2 (whatever you need to mknod) to get major/minor numbers
16. chroot /mnt
17. mount -t proc proc /proc
18. mount -t sysfs sys /sys
19. mknod /dev/sdr1 b 253 1 (whatever your major and minor #'s were)
20. edit fstab to correctly show / and swap to your /dev/sdr devices now
21. create udev rules
22. mkinitrd go into /boot/initrd-tree and run create initrd script in there. be sure to edit init and add dmraid -ay
23. mount slack CD and install grub.
24. create a menu.lst (i couldn't get grubconfig to work)
25. reboot insert grub boot cd, go to grub CLI and install grub to MBR.
a. root hd(0,0)
b. setup hd(0)
26. reboot and the menu.lst should boot with the one you made on your / partition, if not use CD to boot system.

I think thats about it.
Things i've noticed that are weird about a fakeraid are that when i do an fdisk -l, i only show my SDA and SDB dev's. not the dm-X anymore. i also don't see anything but my windows partition under /dev/mappper/nvidia_******

grubconfig still doesn't work. says i don't have files in the /boot/grub (ie stage1) but it is there. however grub does work when i boot up. It only install correctly when i installed it from grub CLI at boot.

There is some other stuff, but i'll post later. i gotta run I think it would be cool if we figured out what exactly works and created some script or way to add this to slack by default. Anyways, let me know what you think eric.
 
Old 06-04-2008, 06:28 PM   #26
m1bear
LQ Newbie
 
Registered: May 2008
Distribution: Slackware 14.1
Posts: 12

Rep: Reputation: 2
Wow I have read and reread all these posts. I have not gotten near that far yet I got slackware installed on a PATA hard drive /dev/hdb and I managed to get dmraid working thanks to you Erik FL, and I mounted my file systems using the long names (I simply looked into /dev/mapper and saw /dev/mapper/nvidia_ibddfecf of course there was three of them because there was two partitions made) I figured out that the one without the number at the end had to be the hard drive itself so I typed
“cfdisk /dev/mapper/navida_ibddfecf”
I then made two new partitions. My finger hung over the W key for a little bit (would it mess up my other partitions) it worked just fine.
Well that is the first step to installing now all I have to do is manage to get slackware to load dmraid before it installs,
I am using grub as the boot loader on /dev/hdb (where I have slackware installed right now) I am thinking that I may try to leave it there because I really don’t want to go through the trouble of reinstalling everything on my raid array if I can help it, anyhow it is just using it boot it shouldn’t make any performance difference right now if I tell my bios to boot from the pata hard drive it boots grub and if I tell it to boot to the raid array it boots windows. Does anyone see any problems with this?
Now I attempted to install dmraid on the setup using an usb disk with that .tar that Erik FL posted on it. Of course something had to go wrong I couldn’t mount my usb device for some reason so I am going to try that CD image next. I have been working on this for more than a week now and I keep making progress it is only today that I reread this thread enough to understand. My clue was that if I tried to mount the other file systems I got an error message at boot time talking about dmraid. Well I started to search and search for it and finally figured out that slackware didn’t come with it so I tried to install it from a rpm it actually installed with no errors but I couldn’t figure out how to use it, I think it really didn’t install because it works now just from putting those files in the correct folders.
I got dmraid on a CD and I managed to install it from the boot disk this is where I am stuck setup will not recognize the partitions on the raid array, I have gone over it again and again for some reason I am having a hard time running some of the code that was posted on this topic from the boot disk that is “chroot” and "mkfs" for example I can’t run form the boot disk I think this is the biggest thing that is holding me up.
I really am new to this so I am batting in the dark I have been working on this way too long to quit though and cfdisk did mess up the partition table on my raid array so the only way I can get into either of my operating systems is to go through grub installed on hdb right now
 
Old 06-04-2008, 08:09 PM   #27
agentc0re
Member
 
Registered: Apr 2007
Location: SLC, UTAH
Distribution: Slackware
Posts: 200

Rep: Reputation: 34
m1bear, i spent about a week before i got it up and running. Once i had it up and running i had problems with grub and eventually could not boot to my HD's... it's been a while so i don't remember the specifics.

My recommendation to you is to NOT setup your computer in this fashion. I would recommend setting it up in a LVM. I have my pc right now in a LVM with raid 0. it works wonderfully, no issues. I really recommend doing it this way. Biggest reason is that it will be a lot easier to recover if you have issues. Also, doing it this way is supported by all Distro's so you could access all your data on any distro very easy.. where as the other way you'd have to setup the dmraid again. very annoying.

http://www.redhat.com/magazine/009jul05/features/lvm2/

that link got me up and going the same day for this kind of setup.
the rest help me along the way to learn about a lot of different ways to do it and more about how it works.

(10:35:04 PM) Liz: http://slackware.osuosl.org/slackwar...README_LVM.TXT
(10:35:16 PM) Liz: http://www.linuxquestions.org/questi...?highlight=lvm
(10:35:29 PM) Liz: http://www.google.com/search?hl=en&c...FS&btnG=Search
(10:35:38 PM) Liz: http://gentoo-wiki.com/HOWTO_Install...swap_partition
(10:35:50 PM) Liz: http://slackwiki.org/Lilo
(10:35:59 PM) Liz: http://www.redhat.com/magazine/009jul05/features/lvm2/
(10:36:08 PM) Liz: http://docs.hp.com/en/B2355-90672/ch08s07.html
(10:36:18 PM) Liz: http://www.freeos.com/articles/3921/
(10:36:27 PM) Liz: http://userlocal.com/articles/raid1-slackware-12.php
(10:36:35 PM) Liz: http://unthought.net/Software-RAID.H....HOWTO-11.html
(10:36:44 PM) Liz: http://wiki.linuxquestions.org/wiki/...-partitions.3F
(10:36:58 PM) Liz: http://tldp.org/HOWTO/LVM-HOWTO/initdisks.html
(10:37:08 PM) Liz: http://www.linuxdevcenter.com/pub/a/...2/05/RAID.html
(10:37:16 PM) Liz: http://pumpump.blogspot.com/2007/07/...-on-linux.html

Let me know how it goes
 
Old 06-05-2008, 11:18 AM   #28
Erik_FL
Member
 
Registered: Sep 2005
Location: Boynton Beach, FL
Distribution: Slackware
Posts: 821

Rep: Reputation: 258Reputation: 258Reputation: 258
Slackware 12.1 dmraid

Slackware 12.1 made it easier to create an "initrd" with "dmraid". I just used "mkinitrd" once to get a copy of the "init" script to edit (see second example below). Then I used a much simpler script to add "dmraid" to the "initrd" (first example below).

I was not able to use the standard Slackware installation CD because it was missing the "mirror" device that I required for my RAID configuration. I had to create my own boot CD to install Slackware.

Script to create "initrd":

Code:
ROOTDEVNAME="/dev/sdr3"		# Name of root device
LINUXVER="2.6.24.5"		# Linux modules version
CLIBVER="2.7"			# C library version
ROOTDIR="/boot/initrd-tree"	# Location of root filesystm
# Get most of the needed programs from the normal mkinitrd
mkinitrd -k $LINUXVER -c -r "$ROOTDEVNAME" -f ext3
# Create root device
cp -a "$ROOTDEVNAME" "$ROOTDIR/dev"
# Copy scripts and programs
cp -p init "$ROOTDIR"
chmod u=rwx,g=rx,o=rx "$ROOTDIR/init"
cp -p /sbin/dmraid "$ROOTDIR/sbin"
for lib in \
   "libdevmapper.so.1.02" \
   "libc.so.6" "ld-linux.so.2" \
   "ld-$CLIBVER.so" "libc-$CLIBVER.so"
   do
   if [ -e "/lib/$lib" ] ; then
      cp -Pp "/lib/$lib" "$ROOTDIR/lib/$lib"
   else
      echo "Library file not found \"/lib/$lib\""
      exit 1
   fi
done
# Make the compressed image file
mkinitrd
Modified "init" script. Added lines in bold. Copy the modified script to the same directory as the script to make the "initrd" above.

Code:
#!/bin/ash
#
# /linuxrc:  init script to load kernel modules from an initramfs
#            This requires that your kernel supports initramfs!!!
#
# Copyright 2004  Slackware Linux, Inc., Concord, CA, USA
# Copyright 2007  Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


# With a generic kernel, you need to load the modules needed to mount the
# root partition.  This might mean a SCSI, RAID, or other drive controller
# module, as well as the module to support the root filesystem.  Once the
# root partition is mounted all the other modules will be available so you
# don't need to load them here.
#
# Config files used by this script:
#
# /rootdev   Contains the name of the root device, such as: /dev/hda1 
#
# /rootfs    Contains the root filesystem type, such as: xfs
#
# /initrd-name    Contains the name of the initrd file.
#
# Optional:
# /load_kernel_modules   A script that uses insmod to load the desired
#            modules.  If this file is not present, all the modules
#            in /lib/modules/`uname -r`/ will be loaded in the usual
#            sorted order.  If you need to load the modules in a
#            certain order, or if the modules need extra options,
#            then use a load_kernel_modules script.
#
#            There's an example in here.  To actually use it, you'll
#            need to make it executable:  
#
#                chmod 755 load_kernel_modules

INITRD=`cat /initrd-name`
ROOTDEV=`cat /rootdev`
ROOTFS=`cat /rootfs`
LUKSDEV=`cat /luksdev`
RESUMEDEV=`cat /resumedev`
WAIT=`cat /wait-for-root`
KEYMAP=`cat /keymap`

# Mount /proc and /sys:
mount -n proc /proc -t proc
mount -n sysfs /sys -t sysfs

# Parse command line
for ARG in `cat /proc/cmdline`; do
  case $ARG in
    rescue)
      RESCUE=1
    ;;
    root=/dev/*)
      ROOTDEV=`echo $ARG | cut -f2 -d=`
    ;;
    resume=*)
      RESUMEDEV=`echo $ARG | cut -f2 -d=`
    ;;
    0|1|2|3|4|5|6)
      RUNLEVEL=$ARG
    ;;
    single)
      RUNLEVEL=1
    ;;
  esac
done

# Load kernel modules:
if [ ! -d /lib/modules/`uname -r` ]; then
  echo "No kernel modules found for Linux `uname -r`."
elif [ -x ./load_kernel_modules ]; then # use load_kernel_modules script:
  echo "${INITRD}:  Loading kernel modules from initrd image:"
  . ./load_kernel_modules
else # load modules (if any) in order:
  if ls /lib/modules/`uname -r`/*.*o 1> /dev/null 2> /dev/null ; then
    echo "${INITRD}:  Loading kernel modules from initrd image:"
    for module in /lib/modules/`uname -r`/*.*o ; do
      insmod $module
    done
    unset module
  fi
fi

# Sometimes the devices needs extra time to be available.
# root on USB are good example of that.
sleep $WAIT

# Use mdev to read sysfs and generate the needed devices 
mdev -s

# Load a custom keyboard mapping:
if [ -n "$KEYMAP" ]; then
  echo "${INITRD}:  Loading '$KEYMAP' keyboard mapping:"
  tar xzOf /etc/keymaps.tar.gz ${KEYMAP}.bmap | loadkmap
fi

# Find any dmraid detectable partitions
dmraid -ay

if [ "$RESCUE" = "" ]; then 
  # Make encrypted root partition available:
  # The useable device will be under /dev/mapper/
  # Three scenarios for the commandline exist:
  # 1- ROOTDEV is on a LUKS volume, and LUKSDEV is a real block device
  # 2- ROOTDEV is on a LVM volume, and LUKSDEV is a real block device
  # 3- ROOTDEV is on a LUKS volume, and LUKSDEV is on a LVM volume
  # Case (3) will have to wait until we initialize the LVM.
  # Test if ROOTDEV is "/dev/someting" or just "something" - the first means
  # ROOTDEV is on a LVM volume (scenario 2) and we don't need to rewrite ROOTDEV.
  # The second means that ROOTDEV is on a LUKS volume (scenario 1).
  CRYPTDEV=""
  if [ -x /sbin/cryptsetup ]; then
    # If we find a LUKS device now, it is on a real block device: 
    if /sbin/cryptsetup isLuks ${LUKSDEV} 1>/dev/null 2>/dev/null ; then
      CRYPTDEV=$(basename $ROOTDEV)
      echo "Unlocking LUKS crypt volume '${CRYPTDEV}' on device '$LUKSDEV':"
      /sbin/cryptsetup luksOpen ${LUKSDEV} $CRYPTDEV </dev/systty >/dev/systty 2>&1
      if [ "$CRYPTDEV" == "$ROOTDEV" ]; then # scenario 1
        ROOTDEV="/dev/mapper/${CRYPTDEV}"
      fi
    fi
  fi

  # Initialize RAID:
  if [ -x /sbin/mdadm ]; then
    /sbin/mdadm -E -s >/etc/mdadm.conf
    /sbin/mdadm -A -s
  fi
  
  # Initialize LVM:
  if [ -x /sbin/vgscan ]; then
    /sbin/vgscan --mknodes --ignorelockingfailure
    sleep 10
    /sbin/vgchange -ay --ignorelockingfailure
  fi
  
  # Make encrypted root partition available (scenario 3):
  # We have to handle cases here where the LUKS volume is created on a LV
  if [ -x /sbin/cryptsetup ]; then
    if /sbin/cryptsetup isLuks ${LUKSDEV} 1>/dev/null 2>/dev/null ; then
      # Only act if we could not open the LUKS device before (i.e. is on a LV):
      if [ "x$CRYPTDEV" == "x" ]; then
        echo "Unlocking LUKS crypt volume '${ROOTDEV}' on device '$LUKSDEV':"
        /sbin/cryptsetup luksOpen ${LUKSDEV} $ROOTDEV </dev/systty >/dev/systty 2>&1
        ROOTDEV="/dev/mapper/${ROOTDEV}"
      fi
    fi
  fi

  # Resume state from swap
  if [ "$RESUMEDEV" != "" ]; then
    if ls -l $RESUMEDEV | grep -q "^l" ; then
      RESUMEDEV=`ls -l $RESUMEDEV | awk '{ print $NF }'`
    fi
    echo "Trying to resume from $RESUMEDEV"
    RESMAJMIN=`ls -l $RESUMEDEV | tr , : | awk '{ print $5$6 }'`
    echo $RESMAJMIN > /sys/power/resume
  fi
  
  # Switch to real root partition:
  echo 0x0100 > /proc/sys/kernel/real-root-dev
  mount -o ro -t $ROOTFS $ROOTDEV /mnt
  
  if [ ! -r /mnt/sbin/init ]; then
    echo "ERROR:  No /sbin/init found on rootdev (or not mounted).  Trouble ahead."
    echo "        You can try to fix it. Type 'exit' when things are done." 
    echo
    /bin/sh
  fi
  unset ERR
  umount /proc
  umount /sys
  echo "${INITRD}:  exiting"
  exec switch_root /mnt /sbin/init $RUNLEVEL
else
  echo "RESCUE mode"
  echo
  echo "        You can try to fix or rescue your system now. If you want"
  echo "        to boot into your fixed system, mount your root filesystem"
  echo "        read-only under /mnt:"
  echo
  echo "            # mount -o ro -t filesystem root_device /mnt"
  echo
  echo "        Type 'exit' when things are done."
  echo
  /bin/sh
  unset ERR
  umount /proc
  umount /sys
  echo "${INITRD}:  exiting"
  exec switch_root /mnt /sbin/init $RUNLEVEL
fi
 
Old 06-05-2008, 12:08 PM   #29
Erik_FL
Member
 
Registered: Sep 2005
Location: Boynton Beach, FL
Distribution: Slackware
Posts: 821

Rep: Reputation: 258Reputation: 258Reputation: 258
Slackware 12.1 boot CD with "dmraid"

Here is the script that I used to create a boot CD for Slackware 12.1 with "dmraid".

Code:
#!/bin/sh
#
# Script to create a bootable Linux CD
#
LINUXVER="2.6.21.5"		# Linux version (for CD boot image)
MODVER="${LINUXVER}CD"		# Modules version (for CD modules)
FSCOMP="./rootfs.gz"		# root filesystem compressed file
FSBIN="./rootfs.bin"		# root filesystem file
ROOTFS="./rootfs"		# Where root filesystem is mounted
OUTFILE="./bootcd.iso"		# Output file
CONFIG="./config"		# Location of configuration files
CDROOT="./cdroot"		# Where to store the CD files	
GRUBBIN="/usr/sbin"		# Location of grub binary files
GRUBLDR="/usr/lib/grub/i386-pc"	# Location of grub boot loader files
BOOTIMAGE="/usr/src/linux-$LINUXVER/arch/i386/boot/bzImage"
SYSTEMMAP="/usr/src/linux-$LINUXVER/System.map"
CLIBVER="2.7"			# C library version

# CD Layout
CDBOOT="boot"
CDGRUB="$CDBOOT/grub"

# If CD files already exist, clean them
if [ -d "$CDROOT" ] ; then
   rm -R "$CDROOT"
fi

# If root filesystem file exists, clean it
if [ -f "$FSBIN" ] ; then
   rm "$FSBIN"
fi

# Create the root filesystem file
dd if=/dev/zero of="$FSBIN" bs=1k count=32768
mke2fs -m 0 -N 2000 -F "$FSBIN"
tune2fs -c 0 -i 0 "$FSBIN"

# Mount the root filesystem
mount -t ext2 -o loop "$FSBIN" "$ROOTFS"

# Create directories
for dir in \
   "bin" "dev" "etc" "mnt" "proc" "sbin" "sys" "usr" \
   "tmp" "var" "var/log" "var/run" "var/tmp" "root"
   do
   if [ ! -d "$ROOTFS/$dir" ] ; then
      mkdir -p "$ROOTFS/$dir"
   fi
done

# Create devices
pushd "$ROOTFS/dev" > /dev/null
# Required devices
mknod -m u=rw,g=,o= console c 5 1
chown root:tty console 
mknod -m u=rw,g=rw,o= ram0 b 1 0
chown root:disk ram0 
mknod -m u=rw,g=r,o= mem c 1 1
chown root:kmem mem 
mknod -m u=rw,g=r,o= kmem c 1 2
chown root:kmem kmem 
mknod -m u=rw,g=rw,o=rw null c 1 3
chown root:root null 
mknod -m u=rw,g=rw,o=rw zero c 1 5
chown root:root zero 
mkdir vc
chmod u=rwx,g=rx,o=rx vc
chown root:root vc
mknod -m u=rw,g=rw,o= vc/1 c 4 1
chown root:tty vc/1 
ln -s vc/1 tty1
mknod -m u=rw,g=rw,o= loop0 b 7 0
chown root:disk loop0 
# IDE Disks (up to 20) max 64 partitions per disk
drives=4
partitions=9
if [ $drives -gt 0 ] ; then
   majors=( 3 22 33 34 56 57 88 89 90 91)
   for drv in `seq 0 $(($drives-1))` ; do
      dev="abcdefghijklmnopqrst"
      dev=hd${dev:$drv:1} 
      major=${majors[$(($drv/2))]}  
      minor=$(( ($drv%2) * 64 ))
      mknod -m u=rw,g=rw,o= $dev b $major $minor
      chown root:disk $dev
      if [ $partitions -gt 0 ] ; then 
         for i in `seq 1 $partitions` ; do
            mknod -m u=rw,g=rw,o= $dev$i b $major $(($minor+$i)) 
            chown root:disk $dev$i
         done
      fi
   done
fi
# SCSI Disks (0 to 127) max 16 partitions per disk
drives=4
partitions=9
if [ $drives -gt 0 ] ; then
   majors=( 8 65 66 67 68 69 70 71)
   for drv in `seq 0 $(($drives-1))` ; do
      dev="abcdefghijklmnopqrstuvwxyz"
      if [ $drv -lt 26 ] ; then
         dev=sd${dev:$drv:1}
      else
         dev=sd${dev:$(($drv/26-1)):1}${dev:$(($drv%26)):1}
      fi
      major=${majors[$(($drv/16))]}  
      minor=$(( ($drv%16) * 16 ))
      mknod -m u=rw,g=rw,o= $dev b $major $minor
      chown root:disk $dev
      if [ $partitions -gt 0 ] ; then 
         for i in `seq 1 $partitions` ; do
            mknod -m u=rw,g=rw,o= $dev$i b $major $(($minor+$i)) 
            chown root:disk $dev$i
         done
      fi
   done
fi
# Floppy disks A and B
for i in `seq 0 1` ; do
   mknod -m u=rw,g=rw,o= fd$i b 2 $i 
   chown root:floppy fd$i
done
# Device mapper for "dmraid"
mkdir mapper
chmod u=rwx,g=rx,o=rx mapper
chown root:root mapper
mknod -m u=rw,g=rw,o= mapper/control c 10 63
chown root:root mapper/control
# Done with devices
popd > /dev/null

# Copy the configuration files
for cfg in \
   "fstab" "group" "inittab" "passwd" "rc" "shadow" "securetty" \
   "termcap" "nsswitch.conf" "profile" "HOSTNAME" "hosts" \
   "DIR_COLORS"
   do
   cp "$CONFIG/etc/$cfg" "$ROOTFS/etc/$cfg"
done

# Copy programs
for prg in \
   "agetty" "basename" "bash" "cat" "chgrp" "chmod" "chown" "chroot" \
   "chvt" "clear" "cmp" "cp" "cut" "date" "dd" "df" "dirname" "dmesg" \
   "du" "echo" "env" "false" "fbset" "find" "free" "grep" \
   "gunzip" "gzip" "head" "hostname" "init" "ifconfig" "kill" "killall" \
   "ln" "login" "ls" "mkdir" "mknod" "more" "mount" "mv" "ps" "pwd" \
   "reboot" "rm" "rmdir" "sh" "shutdown" "sleep" "stty" "sulogin" \
   "sync" "syslogd" "tail" "tar" "tee" "test" "touch" "tr" "true" "tty" \
   "umount" "uname" "uptime" "yes" "zcat" "vi" "elvis" "sed" "sort" \
   "uniq" "insmod" "lsmod" "rmmod" "bzip2" \
   "modprobe" "fdisk" "cfdisk" "dmraid" "mkfs" "mkdosfs" "mke2fs" \
   "mkfs.ext2" "mkfs.ext3" "mkfs.msdos" "mkfs.cramfs" "mkfs.reiserfs" \
   "mkreiserfs" "reiserfstune" "tune2fs" \
   "fsck" "dosfsck" "e2fsck" "fsck.ext2" "fsck.ext3" "fsck.msdos" \
   "fsck.reiserfs" "fsck.umsdos" "reiserfsck" \
   "id" "dircolors" "shutdown" "telinit" "ldd"
   do
   found=false
   for dir in "sbin" "usr/sbin" "bin" "usr/bin" ; do
      if [ -e "/$dir/$prg" ] ; then
         found=true
         if [ ! -d `dirname "$ROOTFS/$dir/$prg"` ] ; then
            mkdir -p `dirname "$ROOTFS/$dir/$prg"`
         fi
         cp -Pp "/$dir/$prg" "$ROOTFS/$dir/$prg"
      fi
   done
   if [ $found != true ] ; then
      echo "Binary file not found \"$prg\""
      umount "$ROOTFS"
      exit 1
   fi
done

# Copy grub boot loader programs
dir="$ROOTFS$GRUBBIN"
if [ ! -d "$dir" ] ; then
   mkdir -p "$dir"
fi
cp -Pp $GRUBBIN/grub* "$dir"
# Copy grub boot loader files
dir="$ROOTFS$GRUBLDR"
if [ ! -d "$dir" ] ; then
   mkdir -p "$dir"
fi
cp -Pp $GRUBLDR/* "$dir"

# Copy libraries
for lib in \
   "ld-linux.so.2" "ld-$CLIBVER.so" "libc.so.6" "libc-$CLIBVER.so" \
   "libresolv.so.2" "libresolv-$CLIBVER.so" \
   "libacl.so.1" "libacl.so.1.1.0" "libattr.so.1" "libattr.so.1.1.0" \
   "libcrypt.so.1" "libcrypt-$CLIBVER.so" "libdl.so.2" "libdl-$CLIBVER.so" \
   "libtermcap.so.2" "libtermcap.so.2.0.8" "libblkid.so.1" "libblkid.so.1.0" \
   "libuuid.so.1" "libuuid.so.1.2" "libproc-3.2.7.so" "libnss_files.so.2" \
   "libnss_files-$CLIBVER.so" "libnss_compat.so.2" "libnss_compat-$CLIBVER.so" \
   "libnss_dns.so.2" "libnss_dns-$CLIBVER.so" "libnss_nis.so.2" \
   "libnss_nis-$CLIBVER.so" "librt.so.1" "librt-$CLIBVER.so" "libpthread.so.0" \
   "libpthread-$CLIBVER.so" "libpthread-$CLIBVER.so" "libe2p.so.2" "libe2p.so.2.3" \
   "libnsl.so.1" "libnsl-$CLIBVER.so" "libncurses.so.5" "libncurses.so.5.6" \
   "libncursesw.so.5" "libncursesw.so.5.6" "libgpm.so.1" "libgpm.so.1.19.0" \
   "libcom_err.so.2" "libcom_err.so.2.1" "libext2fs.so.2" "libext2fs.so.2.4" \
   "libm.so.6" "libm-$CLIBVER.so" "libdevmapper.so" "libdevmapper.so.1.02"
   do
   found=false
   for dir in "lib" "lib/tls" ; do
      if [ -e "/$dir/$lib" ] ; then
         found=true
         if [ ! -d `dirname "$ROOTFS/$dir/$lib"` ] ; then
            mkdir -p `dirname "$ROOTFS/$dir/$lib"`
         fi
         cp -Pp "/$dir/$lib" "$ROOTFS/$dir/$lib"
      fi
   done
   if [ $found != true ] ; then
      echo "Library file not found \"$lib\""
      umount "$ROOTFS"
      exit 1
   fi
done

# Copy modules
dir="lib/modules/$MODVER"
for module in \
   "LEAVE-THIS-HERE"
   do
   if [ "$module" != "LEAVE-THIS-HERE" ] ; then
      module="$dir/$module.ko"
      if [ -e "/$module" ] ; then
         if [ ! -d `dirname "$ROOTFS/$module"` ] ; then
            mkdir -p `dirname "$ROOTFS/$module"`
         fi
         cp -Pp "/$module" "$ROOTFS/$module"
      else
         echo "Module file not found \"/$module\""
         umount "$ROOTFS"
         exit 1
      fi
   fi
done

# Update module dependencies
if [ ! -d "$ROOTFS/$dir" ] ; then
   mkdir -p "$ROOTFS/$dir"
fi
depmod -b "$ROOTFS" -v "$MODVER" -F "$SYSTEMMAP"

# Copy terminal information files
dir="usr/share/terminfo"
for file in \
   "linux" "linux-m" "linux-nic" \
   "vt100" "vt100-am"
   do
   file="$dir/${file:0:1}/$file"
   if [ -e "/$file" ] ; then
      if [ ! -d `dirname "$ROOTFS/$file"` ] ; then
         mkdir -p `dirname "$ROOTFS/$file"`
      fi
      cp -Pp "/$dirl/$file" "$ROOTFS/$file"
   else
      echo "Terminal info file not found \"/$file\""
      umount "$ROOTFS"
      exit 1
   fi
done

# Copy other files
for file in \
   "usr/tmp" "etc/services" "usr/lib/libncurses.so" \
   "usr/lib/libncurses.so.5" "usr/lib/libncursesw.so" \
   "usr/lib/libncursesw.so.5"
   do
   if [ -e "/$file" ] ; then
      if [ ! -d `dirname "$ROOTFS/$file"` ] ; then
         mkdir -p `dirname "$ROOTFS/$file"`
      fi
      cp -Pp "/$file" "$ROOTFS/$file"
   else
      echo "File not found \"/$file\""
      umount "$ROOTFS"
      exit 1
   fi
done

# Create empty files
for file in \
   "var/log/wtmp" "var/run/utmp"
   do
   if [ ! -d `dirname "$ROOTFS/$file"` ] ; then
      mkdir -p `dirname "$ROOTFS/$file"`
   fi
   touch "$ROOTFS/$file"
done

# Unmount the root filesystem
umount "$ROOTFS"

# Create the compressed filesystem
dd if="$FSBIN" bs=1k | gzip -v9 > "$FSCOMP"

# Create CD directories
mkdir "$CDROOT" 
mkdir "$CDROOT/$CDBOOT"
mkdir "$CDROOT/$CDGRUB"

# Copy grub boot loader
cp $GRUBLDR/stage2_eltorito "$CDROOT/$CDGRUB"
cp "$CONFIG/grub/menu.lst" "$CDROOT/$CDGRUB"

# Copy boot image
cp "$BOOTIMAGE" "$CDROOT/$CDBOOT/vmlinuz"

# Copy the compressed root filesystem
cp "$FSCOMP" "$CDROOT/$CDBOOT/rootfs.gz"

# Copy scripts to create initrd
mkdir -p "$CDROOT/install/initrd"
cp /root/initrd/makeinitrd "$CDROOT/install/initrd"
cp /root/initrd/init "$CDROOT/install/initrd"

# Create the ISO image for the CD
mkisofs -o "$OUTFILE" -r \
   -b "$CDGRUB/stage2_eltorito" -no-emul-boot \
   -boot-load-size 4 -boot-info-table "$CDROOT"
inittab file required by script:

Code:
# These are the default runlevels in Slackware:
#   0 = halt
#   1 = single user mode
#   2 = unused (but configured the same as runlevel 3)
#   3 = multiuser mode (default Slackware runlevel)
#   4 = X11 with KDM/GDM/XDM (session managers)
#   5 = unused (but configured the same as runlevel 3)
#   6 = reboot

# Default runlevel. (Do not set to 0 or 6)
id:1:initdefault:

# System initialization (runs when system boots).
si::sysinit:/etc/rc

# These are the standard console login getties in multiuser mode:
c1:1235:respawn:/sbin/agetty 9600 tty1 linux
c2:23:respawn:/sbin/agetty 9600 tty2 linux

# End of /etc/inittab
rc file required by script:

Code:
#!/bin/sh
#
# /etc/rc:  System initialization script.

PATH=/sbin:/usr/sbin:/bin:/usr/bin

# Mount /proc right away:
/sbin/mount -v proc /proc -n -t proc

# Mount sysfs next, if the kernel supports it:
if [ -d /sys ]; then
  if cat /proc/filesystems | grep -w sysfs 1> /dev/null 2> /dev/null ; then
    if ! cat /proc/mounts | grep -w sysfs 1> /dev/null 2> /dev/null ; then
      /sbin/mount -v sysfs /sys -n -t sysfs
    fi
  fi
fi

# Set host name
/bin/hostname LinuxBootCD

# Remount the root filesystem in read-write mode
echo "Remounting root device with read-write enabled."
/sbin/mount -w -v -n -o remount /

# Any /etc/mtab that exists here is old, so we delete it to start over:
/bin/rm -f /etc/mtab*
# Remounting the / partition will initialize the new /etc/mtab:
/sbin/mount -w -o remount /

# Fix /etc/mtab to list sys and proc if they were not yet entered in
# /etc/mtab because / was still mounted read-only:
if [ -d /proc/sys ]; then
  /sbin/mount -f proc /proc -t proc
fi
if [ -d /sys/bus ]; then
  /sbin/mount -f sysfs /sys -t sysfs
fi
There are other files required by the script that you essentially have to copy (and possibly edit) such as "passwd" and "shadow". If you want my exact set of scripts and files I'll be happy to e-mail them.
 
Old 06-05-2008, 11:46 PM   #30
agentc0re
Member
 
Registered: Apr 2007
Location: SLC, UTAH
Distribution: Slackware
Posts: 200

Rep: Reputation: 34
I think you've done a great job at figuring things out for the dmraid Eric, but i still will side that the built in software raid is the better choice to go. (not trying to flame) /endflame
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux NUBE..cant install slack 12 on an Asus p5nd2-sli deluxe slpdave Slackware 14 08-01-2007 08:22 AM
LXer: ASUS P5N-E SLI on Linux LXer Syndicated Linux News 0 05-24-2007 07:16 PM
4GiB in Asus A8N-SLI Deluxe causes kernel panic gzunk Linux - Hardware 1 03-06-2007 11:52 AM
Asus M2N-SLI mb BIOS problem oldman Linux - Hardware 2 10-20-2006 11:56 AM
Mandrake 10.1 installation on Asus A8N SLI mobo aVIXk7 Mandriva 3 04-10-2006 01:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - Installation

All times are GMT -5. The time now is 06:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration