Wednesday, November 12, 2008

Removing a RAID partition

To remove a RAID device that consists of 2 partitions (sda7 and sdb7) that has an LVM2 VG on top:
- lvremove to remove all LVs
- vgremove to remove all VGs
- pvremove to remove all PVs
- mdadm --stop to stop the device
- mdadm --remove to remove the device
- mdadm --zero-superblock to erase the md superblock on each of the 2 partitions
- update /etc/mdadm.conf to remove the md device

Migrating /tmp to another partition

I decided to remove the 80G RAID-0 partition in my PC, and migrate the data inside to other LVM partitions. Currently, the partition has 1 LVM2 vg which contains 3 lvs. One of them contains files I downloaded and the other 2 are /tmp filesystems in my Slackware and Ubuntu installations respectively. I simply copied the files in the first lv to another lv (non-RAID LVM). For /tmp filesystems, I did the following steps for each of them:

- Create a new lv (RAID-1 LVM) of 4G. (lvcreate)
- Format it as reiserfs. (mkfs.reiserfs)
- Mount it to a temporary mount point.
- Copy files in /tmp over using rsync -av
- Go to single user mode and unmount /tmp
- Edit /etc/fstab to change /tmp to use the new lv.
- Remount /tmp and go into multi-user mode.

Note: the device to be put into fstab should be /dev/<vg>/<lv>, not /dev/mapper/<vg>-<lv>.

Wednesday, May 14, 2008

Slackware RAID HOWTO 指南 (Chinese Translaction)

Slackware RAID HOWTO
Slackware RAID 指南

Version 1.00

by Amritpal Bath


- Introduction
- Warnings
- Planning
- Setup
- Using the generic kernel
- Troubleshooting
- Appendices
- Acknowledgements/References


This document explains how to install Slackware 12.1 (and beyond) on a
software RAID root filesystem. It is meant to cover only software raid.
If you are using a RAID expansion card, or the RAID functionality that came
with your motherboard, this document will not be useful for you.
本文解释了如何在一个基于软件RAID(廉价磁盘冗余阵列)的根文件系统上安装Slackware 12.1。本文只涵盖软件RAID。如果你使用RAID扩展卡,或者你的主板带有RAID功能,本文将不会对你有帮助。

In order to follow this document, your computer must have two or more empty
hard drives. While it is possible to be creative and create RAID arrays on
drives that already contain data, it can be error prone, so it is not
covered in this document.


If you perform the following instructions on hard drives with data on them,

If you wish to perform these operations on hard drives that hold data of
any importance, you MUST BACKUP YOUR DATA. The procedure below will
destroy all of the data on your hard drives, so any important data will
need to be restored from your backups.


If you don't backup your data and end up losing it, it will be your fault.
There is nothing I can do to help you in that case.

Now, on with the show... :)
好了,我们开始吧... :)


The first step is to determine which RAID level you want to use.

It is recommended that you familiarize yourself with basic RAID concepts,
such as the various RAID levels that are available to you. You can read
about these in various places - consult your favorite search engine about
"raid levels", or see the References section.
建议你先搞清楚RAID的基本概念,比如你可以使用的各个RAID级。你可以在很多地方找到这方面的信息 - 用你喜爱的搜索引擎查一查"raid levels"。或者看本文的“参考书目”一节。

Here's a quick summary of the more common RAID levels:

- RAID 0: Requires 2 drives, can use more. Offers no redundancy, but
improves performance by "striping", or interleaving, data between all
drives. This RAID level does not help protect your data at all.
If you lose one drive, all of your data will be lost.

- RAID 0: 需要两个或者更多的设备。不支持冗余,但“striping",或者说interleaving(数据交替储存?),可以提高读写的性能。这个级别不能够保护你的数据。如果一个设备坏了,你所有的(在这个RAID设备上的)数据都会丢失。

- RAID 1: Requires 2 drives, can use more. Offers data redundancy by
mirroring data across all drives. This RAID level is the simplest way
to protect your data, but is not the most space-efficient method. For
example, if you use 3 drives in a RAID 1 array, you gain redundancy, but
you still have only 1 disk's worth of space available for use.
- RAID 1: 需要两个或者更多的设备。使用数据在各个设备上的镜像来提供冗余。这个级别是最简单的一种保护你的数据的方法。

- RAID 5: Requires 3 drives, can use more. Offers data redundancy by
storing parity data on each drive. Exactly one disk's worth of space
will be used to hold parity data, so while this RAID level is heaviest
on the CPU, it is also the most space efficient way of protecting your
data. For example, if you use 5 drives to create a RAID 5 array, you
will only lose 1 disk's worth of space (unlike RAID 1), so you will
end up with 4 disk's worth of space available for use. While simple to
setup, this level is not quite as straightforward as setting up RAID 1.
- RAID 5: 需要三个或者更多的设备。通过在每个设备上储存的奇偶数据来提供冗余。正好整一个设备大小的空间会用来储存奇偶数据,虽然这个RAID级用最多的CPU,但是他也是最有效率利用存储空间的保护数据的方法。比方说,如果你用5个设备来建立一个RAID 5阵列,你只失去了一个设备大小的空间(不像RAID 1),所以你可以有4个设备大小的空间用来存放数据。虽然设置起来简单,但是这个级别不象设置RAID 1那么容易。


=== Partition hard drives ===

Once you have booted the Slackware installer CD, the first step is to
partition the hard drives that will be used in the RAID array(s).

I will assume that your first RAID hard drive is /dev/sda. If it is
/dev/hda or something similar, adjust the following commands appropriately.

You can see your drives by running: cat /proc/partitions
你可以运行这个来看你的硬盘:cat /proc/partitions

- /boot: RAID 0 and RAID 5 users will require a separate boot partition, as
the computer's BIOS will not understand striped devices. For
simplicity's sake, we will make /boot a small RAID 1 (mirror) array.
This means that in the case of RAID 0, it will not matter which drive
your BIOS attempts to boot, and in the case of RAID 5, losing one drive
will not result in losing your /boot partition.

- /boot: RAID 0 和 RAID 5 的使用者需要一个独立的引导分区,这是因为电脑的BIOS不能识别数据交替储存的设备。为简单起见,我们把/boot做成一个小的RAID 1阵列。这就是说,在RAID 0下面,你的BIOS可以用(这个RAID 1阵列里的)任何一个设备来引导。在RAID 5 下面,失去一个设备不会导致你失去/boot分区。

I recommend at least 30MB for this partition, to give yourself room to
play with multiple kernels in the future, should the need arise. I tend
to use 100MB, so I can put all sorts of bootable images on the partition,
such as MemTest86, for example.

Go ahead and create a small boot partition now on /dev/sda, via cfdisk
(or fdisk, if you prefer).

Ensure that the partition type is Linux RAID Autodetect (type FD).
确保分区类型是Linux RAID Autodetect (type FD)。

- /: Every setup will require a root partition. :) You will likely want to
create a partition takes up most of the rest of the drive. Unless you
are using LVM (not covered in this document), remember to save some space
after this partition for your swap partition! (see below)
- /:每个配置多需要一个根分区。:) 你很可能想要然这个分区占掉硬盘上的大部分空间。除非你用LVM(不在本文范围内),否则记得留些空间给交换分区(见下)!

If you are not creating a swap partition, I recommend leaving 100MB of
unused space at the end of the drive. (see "safety" for explanation)
- 如果你不打算建交换分区,我建议在硬盘的末端留100MB空间。(解释见“安全性”一节)。

Go ahead and create your main partition now on /dev/sda, via cfdisk
(or fdisk, if you prefer).

Ensure that the partition type is Linux RAID Autodetect (type FD).
确保分区类型是Linux RAID Autodetect (type FD)。

- swap: Swap space is where Linux stores data when you're running low on
available RAM. For fairly obvious reasons, building this on RAID 0 could
be painful (if that array develops a bad sector, for example), so I tend
to build swap on RAID 1 as well. If you understand the danger and still
want to build swap on RAID 0 to eke out as much performance as possible,
go for it.
- swap: 交换空间是Linux在内存不够的时候存放数据的地方。显而易见的,把它建在RAID 0上可能会很糟糕(比如说,那个阵列出了一个坏扇区),所以我一般也把它建在RAID 1上。如果你明白其中的危险性,但是还是想把它建在RAID 0上以尽可能多的提升性能,也是可以。

For RAID 1 swap, create a partition that is the exact size that you want
your swap space to be (for example, 2GB, if you can't decide).
对于RAID 1 交换分区,你想要多大,就建一个多大的分区。(如果你不能决定,就放2GB)

For RAID 0 swap (not recommended), create a partition that is equivalent
to the swap size you want, divided by the number of drives that will be
in the array.
对于RAID 1 交换分区,建一个大小为你想要的大小除以设备的数目的分区。

For example, 2GB / 3 drives = 683MB swap partition on /dev/sda.
比如说,2GB / 3个硬盘 = 683MB 交换分区 在/dev/sda上。

Ensure that the partition type is Linux RAID Autodetect (type FD).
确保分区类型是Linux RAID Autodetect (type FD)。

I recommend leaving 100MB of unused space at the end of the drive.
(see "safety" for explanation)

See also: Appendix A - Striping swap space without RAID 0.
又见:附录A - 不用RAID 0来交替储存交换空间。

- safety! I highly recommend leaving 100MB of unpartitioned space at the
end of each drive that will be used in the RAID array(s).
- 安全性!我极力推荐在每个RAID阵列设备的末端留100MB为分区的空间。

In the event that you need to replace one of the drives in the array,
there is no guarantee that the new drive will be exactly the same size as
the drive that you are replacing. For example, even if both drives are
750GB, they may be different revisions or manufacturers, and thus have a
size difference of some small number of megabytes.

This is, however, enough to throw a wrench in your drive-replacement
plans - you cannot replace a failed RAID drive with one of a smaller size,
for obvious reasons. Having that small 100MB buffer just may save your

=== Copy and review partitions ===

Now that /dev/sda is partitioned as appropriate, copy the partitions to all
the other drives to be used in your RAID arrays.

An easy way to do this is:
sfdisk -d /dev/sda | sfdisk /dev/sdb

This will destroy all partitions on /dev/sdb, and replicate /dev/sda's
partition setup onto it.

After this, your partitions should look something like the following:

- RAID 0:
/dev/sda1 30MB /dev/sdb1 30MB
/dev/sda2 100GB /dev/sdb2 100GB
/dev/sda3 2GB /dev/sdb3 2GB

- RAID 1:
/dev/sda1 100GB /dev/sdb1 100GB
/dev/sda2 2GB /dev/sdb2 2GB

- RAID 5:
/dev/sda1 30MB /dev/sdb1 30MB /dev/sdc1 30MB
/dev/sda2 100GB /dev/sdb2 100GB /dev/sdc2 100GB
/dev/sda3 2GB /dev/sdb3 2GB /dev/sdc3 2GB

All partition types should be Linux RAID Autodetect (type fd).
所有分区类型都应该是Linux RAID Autodetect (type FD)。

=== Create RAID arrays ===

Now it's time to create the actual RAID arrays based on the partitions that
were created.

The parameters for each of these RAID commands specifies, in order:
- the RAID device node to create (--create /dev/mdX)
- 要建立的RAID设备节点 (--create /dev/mdX)
- the RAID level to use for this array (--level X)
- 要使用的RAID级 (--level X)
- how many devices (partitions) to use in the array (--raid-devices X)
- 在这个阵列里有多少个设备(分区)(--raid-devices X)
- the actual list of devices (/dev/sdaX /dev/sdbX /dev/sdcX)
- 实际设备列单 (/dev/sdaX /dev/sdbX /dev/sdcX)

Start by creating the RAID array for your root filesystem.

- RAID 0:
mdadm --create /dev/md0 --level 0 --raid-devices 2 \
/dev/sda2 /dev/sdb2

- RAID 1:
mdadm --create /dev/md0 --level 1 --raid-devices 2 \
/dev/sda1 /dev/sdb1

- RAID 5:
mdadm --create /dev/md0 --level 5 --raid-devices 3 \
/dev/sda2 /dev/sdb2 /dev/sdc2

Next, let's create the array for the swap partition. This will be RAID 1
regardless of which RAID level your root filesystem uses, but given our
partition layouts, each command will still be slightly different.
其次,建立交换分区阵列。不论你的根文件系统用哪个RAID级,这个都是RAID 1。但是因为我们不同的分区分布,每个命令还是会有一点不同。

- RAID 0:
mdadm --create /dev/md1 --level 1 --raid-devices 2 \
/dev/sda3 /dev/sdb3

- RAID 1:
mdadm --create /dev/md1 --level 1 --raid-devices 2 \
/dev/sda2 /dev/sdb2

- RAID 5:
mdadm --create /dev/md1 --level 1 --raid-devices 3 \
/dev/sda3 /dev/sdb3 /dev/sdc3

Finally, RAID 0 and RAID 5 users will need to create their /boot array.
RAID 1 users do not need to do this.
最后,RAID 0 和 RAID 5 用户需要建立/boot 阵列。RAID 1用户不需要。

- RAID 0:
mdadm --create /dev/md2 --level 1 --raid-devices 2 \
/dev/sda1 /dev/sdb1

- RAID 5:
mdadm --create /dev/md2 --level 1 --raid-devices 3 \
/dev/sda1 /dev/sdb1 /dev/sdc1

We're all done creating our arrays! Yay!

=== Run Slackware setup ===

First, let's format our swap array, so the installer recognizes it:
mkswap /dev/md1

Now run 'setup' as normal.

When you choose to setup your swap partitions, /dev/md1 will show up.
Continue with this selected.

When asked for the target partition, choose the root array (/dev/md0).

You may choose the format method and filesystem of your choice.

RAID 0 and RAID 5 users must also setup /boot. When asked about setting up
extra partitions, choose /dev/md2. When asked where to mount this device,
enter "/boot".
RAID 0 和 RAID 5 用户必须设置/boot。当然你设置额外的分区时,选/dev/md2。当问你挂载到哪里时,输入/boot。

After this, continue installation as normal.

For LILO configuration:
- When asked about LILO, choose the "simple" setup.
- When asked about additional "append=" parameters, RAID 0 and
RAID 5 users should type in "root=/dev/md0", to ensure that the proper
array is mounted on / at bootup.
- When asked about where to install LILO, choose MBR.
- 当问你LILO设置时,选“simple”设置。
- 当问你附加的"append="参数时,RAID 0 和 RAID 5 用户要输入"root=/dev/md0" 以确保引导时正确的阵列会被挂载到/上。
- 当问你把LILO安装到哪里时,选MBR。

You may see some warnings scroll by. This is OK.

=== Finishing touches ===

After exiting the installer, we have just a few settings to tweak.

Start by switching into your actual installation directory:
- chroot /mnt

Let's make sure LILO boots from the RAID arrays properly. Using your
favorite editor (vim/nano/pico), edit /etc/lilo.conf:
- add a new line (add it anywhere, but don't indent it):
- 加入一行(随便哪里,但是不要缩进):
raid-extra-boot = mbr-only
- You will need to change the following line:
- 修改这一行:
boot =
RAID 0 and RAID 5 users, change it to:
RAID 0 和 RAID 5 用户改成:
boot = /dev/md2
RAID 1 users, change it to:
RAID 1 用户改成:
boot = /dev/md0

- Save the file and exit your editor.
- 保存文件,推出编辑器。
- run "lilo".
- 运行“lilo”。

When that's done, let's exit the installation and reboot:
- exit
- reboot


Using the generic kernel

The official Slackware recommendation is to switch to the "generic"
Slackware kernel after installation has been completed. If you wish to use
the generic kernel, you must create an initrd. This section gives a quick
example of booting a RAID system in this fashion.

If you require more information on initrds, please read /boot/README.initrd.

Typically, a user switches to a generic kernel by booting the system, and
afterwards running the following:
- cd /boot
- rm vmlinuz config
- ln -s vmlinuz-generic-smp-* vmlinuz
- ln -s*
- ln -s config-generic-smp-* config

Don't run lilo yet, we'll do that soon.

Next, edit (create, if necessary) /etc/mkinitrd.conf and add:
其次,编辑(如有必要,创建)/etc/mkinitrd.conf 并加入:

Obviously, this assumes that you are using the EXT3 filesystem. If you are
using another filesystem, adjust the module appropriately (reiserfs or xfs,
for example). If you wish to read more about the MODULE_LIST variable,
consult "man mkinitrd.conf".
显然,这里假设你用EXT3文件系统。如果你用其他的文件系统,适当修改模块行(比如reiserfs,xfs)。如果你要了解更多关于MODULE_LIST变量,参考"man mkinitrd.conf"。

Note: If the module for your hard drive controller is not compiled into the
generic kernel, you will want to add that module to the MODULE_LIST variable
in mkinitrd.conf. For example, my controller requires the mptspi module, so
my /etc/mkinitrd.conf looks like:

We're almost done.

Edit /etc/lilo.conf, and find the line at the very end that says:
image = /boot/vmlinuz

Add a new line after it that says:
initrd = /boot/initrd.gz

In this case, be sure to indent the line you've added!

Next, create the initrd based on the config file created earlier.
mkinitrd -F

Finally, run "lilo" to make the new settings take effect, give yourself a
pat on the back, and reboot your finished system. :)


Any number of typos can result in a system that does not boot on its own,
but all is not lost. Put the rubber chicken and the lemon away...
无论多少的打字错误都可能导致你的系统不能启动。不过这并不意味着全完了。(下一句不会 :P)

Booting your Slackware media (DVD, for example) can make it very easy to
switch into your installed system and make repairs:

- Boot Slackware CD/DVD.
- 启动Slackware CD/DVD。
- Login to installer as normal.
- 如常登录进安装程序。
- Scan for, and then assemble the RAID arrays:
- 扫描并组装RAID阵列:
mdadm -Es > /etc/mdadm.conf
mdadm -As
- Mount root partition:
- 挂载根分区:
mount /dev/md0 /mnt
- Switch to installed OS:
- 切换到安装好的系统:
chroot /mnt
- Mount remaining filesystems:
- 挂载其他的文件系统:
mount /boot (RAID 0 and RAID 5 users only)
mount /proc
mount sys /sys -t sysfs

At this point, you can bring up your favorite editor, tweak config files,
re-run mkinitrd/lilo/etc as you wish, or anything else you need to do to
make your system bootable again.
When you're finished making your changes, rebooting is simple:
- cd /
- umount boot proc sys
- exit
- reboot

If you are having issues that you're unable to resolve, shoot me an email.
Perhaps the answer will make it into this section. :)


=== Appendix A: Striping swap space without RAID 0 ===
附录A:不用RAID 0来交替储存交换空间

For completeness' sake, I should mention that swap space can be striped to
improve performance without creating a RAID 0 array.
为了完整性,我应该阐明不需要RAID 0阵列也可以做到交替储存交换空间。

To accomplish this, start by forgetting about any instructions having to do
with /dev/md1, which would be our swap array - create the swap partitions on
the hard drives, but do not create this particular array.
为了做到这点,先不要管关于/dev/md1(我们的交换阵列)的指令 - 在硬盘上建立交换分区,但是不要建立这个阵列。

When creating the swap partitions, ensure that the partition type is set to
Linux Swap (type 82).
当建立交换分区时,确保分区类型是Linux Swap (type 82)。

During setup, the installer will recognize the swap partitions. Ensure that
all of them are selected, and continue as normal.

After installation is complete, go ahead and boot your system - we can
finish this once the system is booted, in the interest of simplicity.
安装完成后,重启系统 - 重启后我们就可以完成安装了。

When the system boots, edit /etc/fstab with your favorite editor. Find the
lines that describe your swap partitions - they say "swap" in the second
系统启动后,编辑/etc/fstab。找到描述你的交换分区的那些行 - 第二列是"swap"的哪些。

Each of these lines says "default" in the fourth column. Simply change that
to "default,pri=0" for each line.

After saving the file, either reboot, or simply run:
swapoff -a
swapon -a

To confirm that the setting has taken effect, you can run:
swapon -s

Verify that the Priority column reads 0 for each partition, and we're done!


- In depth explanation of RAID levels:
"LasCon Storage - Different types of RAID"

- Thanks to John Jenkins (mrgoblin) for some tips in:
"Installing with Raid on Slackware 12.0+"

- Thanks to Karl Magnus Kolst?(karlmag) for his original writeup on
Slackware and RAID, ages ago!
RAID level 0 DEVICE"

- Of course, thanks to Patrick "The Man" Volkerding for creating Slackware!

- Also thanks to the rest of the guys that proofread, tested, and suggested!
Eric Hameleers (alienBOB), Robby Workman, Alan Hicks,
Piter Punk, Erik Jan Tromp (alphageek)...

- My contact info:
Primary email:
Secondary email:
On certain IRC networks: "amrit" (or some variation :) )

- This latest version of this document can be found at:

Sunday, May 11, 2008



Friday, May 9, 2008

Slackware 12.0 to 12.1 Upgrade HOWTO Chinese Translation

Slackware 12.0 to 12.1 Upgrade HOWTO
Slackware 12.0 到 12.1 升级指南

This document explains how to upgrade from Slackware 12.0 to Slackware 12.1.
这篇文章是Slackware 12.0 到 12.1的升级说明。

For details of important changes from Slackware 12.0 to 12.1, see the file
'CHANGES_AND_HINTS.TXT'. Thanks to Robby Workman for help with this.
关于从Slackware 12.0 到 12.1的重大变化,请参考CHANGES_AND_HINTS.TXT。感谢Robby Workman在这上的帮助。

Before you begin, I would strongly recommend making a backup of your
system, or, if not the entire system, at least the /etc directory. You
might find that you need to refer to a few things after the upgrade
process is complete. Back it up, or take your chances.

OK, now that everything is safely backed up, let's proceed. :-)

To do this, you'll need the Slackware 12.1 packages. If these are on a CD,
create a new directory to mount the CD on so that it doesn't get in the way
during the upgrade:
升级需要Slackware 12.1 的软件包。如果它们在CD上,建一个新目录来挂载CD,以免它们在升级过程中碍事。

mkdir /packages
mount /dev/cdrom /packages

The packages don't have to be on a CD-ROM, as an alternative you could
copy the slackware directory (the one with the various package
subdirectories in it, basically the "slackware" directory from the install
CD) to someplace like /root/slackware/. The important thing is that you
know where the slackware packages directory is. We'll use /root/slackware
in the following examples.

0. Put your machine in single-user mode:
0. 让你的机器进单用户模式:
telinit 1

1. Upgrade your glibc shared libraries. This is important, or things
might go haywire during the first part of the upgrade:
1. 升级glibc共享库。这很重要。不然的话第一部分的升级会搞糟:
upgradepkg /root/slackware/a/glibc-solibs-*.tgz

2. Upgrade your package utilities:
2. 升级软件包管理工具:
upgradepkg /root/slackware/a/pkgtools-*.tgz

3. Upgrade everything else (and install new packages):
3. 升级其他所有的软件包 (包括安装新的软件包):
upgradepkg --install-new /root/slackware/*/*.tgz

If you wish to upgrade everything except for the KDEI language
packs for KDE (these take a lot of space and can be dealt with
after the main upgrade more quickly and easily), running this
script in the "slackware" directory will do the trick:

for dir in a ap d e f k kde l n t tcl x xap y ; do
( cd $dir ; upgradepkg --install-new *.tgz )

4. Make sure your system will boot. First, be sure your initrd is up
to date (if you use one). If you use LILO, make sure the paths in
/etc/lilo.conf point to a valid kernel and then type 'lilo' to
reinstall LILO. If you use a USB memory stick to boot, be sure to
copy the new kernel to it in place of the old one.
4. 确保你的系统可以引导进slackware。首先,确定你的initrd是最新的。如果你用LILO, 确保/etc/lilo.conf里的路径都指向有效的内核,然后打'lilo'重新安装LILO到引导区。如果你用USB闪存来引导,一定要把新内核拷贝过去覆盖旧的。

5. Remove obsolete packages. The CHANGES_AND_HINTS.TXT file should have a
list of these. You may also wish to go into /var/log/packages and take
a look at the package list:
5. 卸载已废弃的软件包。CHANGES_AND_HINTS.TXT里有一个列单。你也可以到/var/log/packages看一看:
ls -lt | less

You may spot some old, obsolete, or discontinued packages. If so,
you can remove these using 'removepkg'.

6. Fix your config files. Some of the config files in /etc are going to
need your attention. You'll find the new incoming config files on
your system with the ".new" extension. You may need to fill these in
with information from your old config files and then move them over.
6. 修正你的配置文件。需要注意/etc目录下的一些配置文件。新安装的配置文件以".new"为扩展名。你需要把旧的配置文件里的东西移到新的里面。

Feel brave? You can use this little script to install all of the
.new config files in /etc. If you've made any local changes you'll
need to add them to the newly installed files. Your old config files
will be copied to *.bak. Anyway, it might be an easier starting
point. Here it is:

cd /etc
find . -name "*.new" | while read configfile ; do
if [ ! "$configfile" = "./rc.d/" \
-a ! "$configfile" = "./" \
-a ! "$configfile" = "./" \
-a ! "$configfile" = "./" ]; then
cp -a $(echo $configfile | rev | cut -f 2- -d . | rev) \
$(echo $configfile | rev | cut -f 2- -d . | rev).bak 2> /dev/null
mv $configfile $(echo $configfile | rev | cut -f 2- -d . | rev)

7. If you use a non-en_US language pack for KDE and you already have it
installed, then you may upgrade it by moving into the slackware/kdei
directory and using this command:
7. 如果你已经安装使用了非美国英语的KDE语言包的话,可以进入slackware/kdei目录用下面这个命令升级它:
upgradepkg --install-new k**tgz

To have upgradepkg cycle through all of the available packages, and
see which ones need to be upgraded, use this in slakckare/kdei:
upgradepkg *tgz

If your language has been added to KDE since Slackware 12.0, you'll
need to install it using installpkg, or upgradepkg --install-new.
如果你的语言是Slackware 12.0后才加入的。你要用installpkg,或者upgradepkg --install-new来安装它。
Typically you'll need to make sure that you have installed the
slackware/kdei packages for kde, koffice, and k3b (if you use those).
通常你要保证安装了kde, koffice, 和k3b的语言包(如果你有用它们的话)。

8. Return to multi-user mode:
8. 回到多用户模式:
telinit 3

At this point you should be running Slackware 12.1. :-)
到这里有已经在运行Slackware 12.1了 :-)
I wish everyone good luck with this!

Patrick Volkerding

Sunday, May 4, 2008

Making initrd for Slackware 12.1 generic-smp kernel

Root Device: /dev/md0 (RAID-1)
Root FS: ext3

mkinitrd -c -k -m ext3 -f ext3 -R
add "-L" if LVM support is required.

Saturday, May 3, 2008

Extenting a Logical Volume (non-RAID)

Create a new partition. e.g. /dev/sda9. Set the partition type to 8E (Linux LVM)
May need to reboot.
pvcreate /dev/sda9
vgextend datastore_vg0 /dev/sda9
lvextend -L80G /dev/datastore_vg0/download #80G is the target total size, not incremental size
resize_reiserfs -f /dev/datastore_vg0/download

Thursday, May 1, 2008

Buring Files bigger than 4GB to DVD

Update2 (5 May 2009) - The issue below is fixed in k3b 1.63 (r948463) in slackware current and cdrtools-2.01.01a57.

Update - Issue: The DVDs burnt using K3B (and cdrtools) cannot be mounted with appropriate permissions using type udf. The permission is "d---------" when mounted. Mounting as iso9660 gives right permission.

After some trying, I finally managed to burn files bigger than 4GB to DVDs.

Required software:
cdrtools-2.01.01a38-i486-1 or later
k3b-1.0.4-i486-3 or later

From k3b 1.0.4 Annoucement:
K3b now silently allows the burning of files bigger than 4 GB if an appropriate version of genisoimage or mkisofs is installed ("silently" means that I did not introduce any new messages)

Before start burning DVD, change the Filesystem Settings as follows: (see screenshot below)

- Check "Generate UDF structures"
- Select "Level 3" under "ISO Level"

Note if the settings are not appropriate, k3b will still go ahead to burn the DVD, but happily leave out the file that is more than 4GB and close the DVD, effectively wasting the DVD.

Wednesday, March 5, 2008

Grub menu.lst

# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 15

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)

# Pretty colours
color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

# examples
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro

# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=1b579cb2-4e7b-4e97-8536-88595be8fb64 ro

## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,5)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## ## End Default Options ##


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Microsoft Windows XP Professional
root (hd0,0)
chainloader +1

# Slackware 12.0 Huge SMP
title Slackware 12.0 Huge SMP
root (hd0,6)
kernel /boot/vmlinuz root=/dev/md0 ro vga=773
#initrd /boot/initrd.gz

# Slackware 12.0 Generic SMP
#title Slackware 12.0 Generic SMP
#root (hd0,6)
#kernel /boot/vmlinuz-generic-smp- root=/dev/md0 ro vga=773
#initrd /boot/initrd.gz

title Ubuntu 8.04, kernel 2.6.24-16-generic
root (hd0,7)
kernel /boot/vmlinuz-2.6.24-16-generic root=/dev/md3 ro quiet splash
initrd /boot/initrd.img-2.6.24-16-generic

title Ubuntu 8.04, kernel 2.6.22-14-generic
root (hd0,7)
kernel /boot/vmlinuz-2.6.22-14-generic root=/dev/md3 ro quiet splash
initrd /boot/initrd.img-2.6.22-14-generic

title Ubuntu 8.04, kernel 2.6.22-14-generic (recovery mode)
root (hd0,7)
kernel /boot/vmlinuz-2.6.22-14-generic root=/dev/md3 ro single
initrd /boot/initrd.img-2.6.22-14-generic