Smokes your problems, coughs fresh air.

Author: halfgaar (Page 17 of 26)

Halfgaar is Wiebe. Wiebe is a contributing author on this weblog. He also has a lot of stuff (such as long, in-depth articles) on his personal website.

Wiebe's day job is as a senior software developer and system administrator at YTEC.

In his free time, he built the free, open-source FlashMQ software. Together with Jeroen and Rowan, he is now building a managed MQTT hosting business around his open masterpiece.

Installing Arch Linux on RAID+LVM

I just installed Arch Linux on a RAID1+LVM, which involved some work. There already is a nice article about it, but I wanted to summarize for myself.

Arch has no GUI or menu for you to do this. So, when the installer has started, just go to another VT and create the RAID+LVM.

In my first attempt, I created one RAID partition with LVM, from which I intended to boot using Grub2, since it understands LVM and RAID. However, the grub installer kept saying there was no mapping for /dev/mapper/lvmroot or something, so I decided to make two partitions: one boot and one rest, which was meant as physical volume for the LVM. The advantage of linux software raid (when you store the superblock at the end of the partition, at least), is that grub can access it like a normal disk; it doesn’t need to know RAID).

After the array was made using something like:

mdadm --create /dev/md0 -l 1 -n 2 -x 0 -e 1.0 /dev/sda1 /dev/sdb1
mdadm --create /dev/md1 -l 1 -n 2 -x 0 -e 1.0 /dev/sda2 /dev/sdb2

It was time to create the LVM. So, I ran (don’t know the exact syntax, so this is an abstraction):

pvcreate /dev/md1
 
# In my research for my initial lvm problem, I found people who had 
# problems with dashes in the volume group name, so I don't 
# use those anymore...
vgcreate lvmonraid /dev/md1
 
lvcreate -n root -l [wanted size/extentsize] lvmonraid
lvcreate -n home -l [wanted size/extentsize] lvmonraid
lvcreate -n swap -l [wanted size/extentsize] lvmonraid

Extent size is normally 4 MB, so a 40MB partition would have “-l 10”. You can also supply sizes in bytes, but that is not only inprecise because it gets rounded to the extent size, but I also noticed bugs in what metric and binary units were supposed to be; it seemed like the command line options don’t differentiate between G and g, for instance, and they’re all GiBi, whereas the –units option does.

When this is done, you can configure the block devices in arch to assign the purpose.

When the installation is almost done, it asks to modify some configuration files. This is important, otherwise the initramfs won’t load the LVM. You need to:

  • Make an mdadm.conf in /etc (of the live CD) with “mdadm –examine –scan > /etc/mdadm.conf”.
  • Add the raid1 and dm_mod module to the MODULES list in /etc/mkinitcpio.conf.
  • Add the mdadm and lvm2 hook to the HOOKS list in /etc/mkinitcpio.conf, before ‘filesystems’
  • Edit your /etc/rc.conf, and set the USELVM parameter to “yes”

Then it will create the ramdisk. The next thing is installing Grub. The config file it makes is fine, except you need to add (hd0,0) after the empty “root” directive, twice. Installing grub fails because of the RAID, so you have to do that by hand:

# grub
grub> root (hd0,0)
grub> setup(hd0)
grub> root (hd1,0)
grub> setup (hd1)

That should be it, basically. I actually did a lot more because of my new Western Digital WD15EARS disk with 4 kB sectors, but I’ll write about that soon.

Disabling Intellipark on the WD15EARS

I just got two Western Digital 1.5TB WD15EARS disks. This drive has a feature called intellipark, which parks the head after the disk is not used for a while. This is supposedly a power saving feature. But, as someone explains, it can also severely decrease the lifetime of your drive.

To disable, download wdidle and disable it. This needs to be done from a dos environment. Dos bootdisks should be available for download.

USAGE:
WDIDLE3 [/S[<Timer>]] [/D] [/R] [/?]
where:
/S[<Timer>] Set timer, units in seconds. Default=8.0 (8.0 seconds).
Resolution is 0.1 seconds from 0.1 to 12.7 seconds.
Resolution is 30 seconds from 30 seconds to 300000 seconds.
Note, times between 12.8 and 30 seconds will be set to 30 seconds.
/D          Disable timer.
/R          Report current timer.
/?          This help info.

Disabling it actually causes it to go even more beserk. In a few hours, SMART logged 5000 load_cycles, and the drive was making very funny noises all the time. Instead, I set it to 300 seconds, which effectively disables it.

Someone also made a boot CD with the tool available (wgetting it works, clicking doesn’t). I don’t think the link will be there forever though. (can I attach zips to a blog post?)

The forum post I linked to also has info about TLER, which I’ll get back to.

Upgrading Samba from Lenny-backports

For some reason, after upgrading to the Samba version from Lenny-backports I needed to support Windows 7 profiles, the workstations suffered from severe problems. The entire profile seemed to be read-only, even though they weren’t on disk. I couldn’t change any setting and reverting profile configuration from backups didn’t help. In the end, the only thing that fixed it was recreating the user profile, both server and client side. This was an upgrade from 3.2.5 to 3.4.7.

Another issue I had is that the user database got a new backend and all the users were gone. You can import your existing smbpasswd file with pdbedit.

So, when doing this again, be sure to make workstation and server backups.

Adding a virtual network interface on Debian

When clustering machines, you make it possible for a failover node to be accessible on the same address as the primary node by having a virtual network interface. In Debian, you can add one like this:

iface eth0:0 inet static
    address 192.168.1.75
    network 192.168.1.0
    broadcast 192.168.1.255
    netmask 255.255.255.0
    gateway 192.168.1.251

By leaving out the auto eth0:0, I prevent the interface from becoming active automatically. I can do “ifup eth0:0” to enable it. This can also be left to clustering software, but clustering software can also get in the way, so often you just want to do it by hand.

Preventing the creation of $RECYCLE.BIN on Samba shares by Windows 7

Windows 7 kept creating a $RECYCLE.BIN dir on the network share. This in itself is merely annoying, but there were also errors resulting from it. Whenever a file would be deleted, this message would appear (translated from dutch): “The recycle bin is damaged, do you want to delete the contents?” Everything froze until that question was answered.

Samba has an option “veto files” which can be used to stop the creation of that directory. Put this in each share’s section in your smb.conf:

veto files = /*$RECYCLE.BIN/ 

The slashes are not directory separators in this case. Also, I don’t know if the preceeding * is necessary, but it does no harm.

Configuring Thunderbird to have newest mails at the top by default

Thunderbird sorts its mails in such a way that the newest mails are at the bottom of the list by default. You can change it, but you have to change it for each folder separately, which sucks.

The solution is to set the order option with the advanced config editor before you open the folders (before you let Thunderbird create the index):

mailnews.default_sort_order = 2

Migrating user accounts when upgrading from samba 3.2 to 3.3 or 3.4

Because I wanted to be able to give Windows 7 machines access to our domain controller, I needed to upgrade samba to 3.4 from lenny-backports. Because the database backend changed, a consequence of this was that the user database was empty; it didn’t migrate it.

pdbedit has an option to import the old smbpasswd file:

pdbedit -i smbpasswd:/etc/samba/smbpasswd

That should take care of it. I didn’t test it this way though, because I already fiddled with the user database by creating new users by hand. I imported one user with which I still had problems correctly this way, but I don’t know if importing this database from the start would have prevented all my errors.

Console commands for Unreal Tournament

This site has a comprehensive list of Unreal Tournament 99 console commands. Some necessary ones (for some you have to do adminlogin first, provided you’re playing on a dedicated server):

Restart mapadmin servertravel restart
Change mapadmin switchlevel (or servertravel) [map name]
Kick playeradmin kick [player]
Kick and ban playeradmin kickban [player name]
Remove all botsadmin killall Bot
Screenshotshot
Show player ip’sshowips
Show player id’sshowid
kick player with IDkickid [id]
kick and ban player with IDbanid [id]
« Older posts Newer posts »

© 2024 BigSmoke

Theme by Anders NorenUp ↑