Pages - Menu

Showing posts with label fedora. Show all posts
Showing posts with label fedora. Show all posts

Sunday, June 1, 2014

kernel panic scsi_wait_scan on elrepo kernel-ml

Browsing around ELRepo, you can see they have the elrepo-kernel repository which contains the long-life kernel-lt (currently 3.10) and mainline kernel-ml (currently 3.14) packages.

I'd always been curious about these, so I spun up a test VM and did a CentOS 6 Basic Server install, then added ELRepo and installed them.

kernel-lt works fine first time.

However, kernel-ml will not boot, and simply repeats:
FATAL: Module scsi_wait_scan not found.

Thursday, November 21, 2013

yum grouplist doesn't display all groups

I've noticed in Fedora that the yum grouplist command doesn't actually display all the groups:

# yum grouplist | grep Virt
# yum grouplist | grep Virt | wc -l
0

However you can still see a group with groupinfo:
# yum groupinfo Virtualization
Loaded plugins: langpacks, list-data, presto, refresh-packagekit
Group: Virtualization
 Group-Id: virtualization
 Description: These packages provide a virtualization environment.

Apparently there can be a "hidden" tag on groups, as reported in this Bugzilla entry:

Bug 986531 - unhide all groups from yum grouplist

You can see all the groups with the yum grouplist hidden command:

# yum grouplist | wc -l
39
# yum grouplist hidden | wc -l
126

Tuesday, July 9, 2013

akg perception 120 usb mic works on linux

I recently bought an AKG Perception 120 USB microphone to do some voiceover work with.

I couldn't find any reliable source which confirmed whether this works on Linux or not, so hopefully this post will help someone out.

This microphone works great on Linux.

Not only that, it works great full stop. I was using a cheap headset before, and the difference in sound quality is incredible. I'm not any sort of audio expert or audiophile, though I can tell you the constant "hiss" that my old headset produced is eliminated with this new microphone.

I tested using Fedora 18 with kernel 3.9.6-200 which worked fine.
I also tried Ubuntu 13.04 with kernel 3.8.0-19 and that worked too.
However, Ubuntu 12.04.3 with kernel 3.8.0-29 didn't work. It recognised the device but would not pick up sound.

If you wonder about any specific distro, preferably one with a LiveCD, just leave a comment and I'll give it a try if I can.

Here is the output of lsusb on F18 with the device connected:

Bus 001 Device 027: ID 074d:3556 Micronas GmbH Composite USB-Device

Here is the output of dmesg on F18 as the device is connected:

usb 1-1.2: new full-speed USB device number 27 using ehci-pci
usb 1-1.2: New USB device found, idVendor=074d, idProduct=3556
usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-1.2: Product: AKG Perception 120 USB
usb 1-1.2: Manufacturer: AKG Acoustics
ALSA sound/usb/clock.c:243 current rate 0 is different from the runtime rate 48000
ALSA sound/usb/clock.c:243 current rate 0 is different from the runtime rate 48000
usbcore: registered new interface driver snd-usb-audio
ALSA sound/usb/clock.c:243 current rate 48000 is different from the runtime rate 44100
ALSA sound/usb/clock.c:243 current rate 48000 is different from the runtime rate 44100

Wednesday, January 16, 2013

how to network jumbo frames to a kvm guest

Getting a jumbo frame to a KVM guest is not something which works out of the box, but can be configured to work quite easily.

One way get jumbo frames to a KVM guest is to directly pass the guest a physical NIC through PCI Passthrough, or a Virtual Function through SR-IOV.

Another way is to use the traditional libvirt bridge. Create a bridge on the host, and bridge the guest's NICs into this. The reason this doesn't work by default is all the interfaces are created with the default Ethernet MTU of 1500 bytes.

You can set MTU of the physical NIC, the bridge, and the guest interface with the network-scripts, but you cannot automatically set the MTU of the tap interface with the network-scripts. The tap interface is how the virtual network interface connects to the "real world". You'll see these tap devices with names like "vnet0" in your bridge.

So how do we do this?

First, some requirements:
  • A physical interface which supports jumbo frames.
    The Linux bridge code will only allow the bridge to change to the smallest MTU of all its interfaces.
  • A bridge with the larger required MTU
    Technically a jumbo frame covers MTU from 1501 to 9000, but almost everyone just wants to set 9000
  • virtio-net or Intel e1000 network interface inside the guest
    The real-life Realtek 8139 does not support an MTU of 9000, therefore there is no driver support for large MTU in the emulated version either.
Our first step is to make all tap interfaces on the host have an MTU of 9000. We do this by adding a udev rule to the top of the network device creation as follows:

/etc/udev/rules.d/70-persistent-net.rules (on host)
SUBSYSTEM=="net", ACTION=="add", KERNEL=="vnet*", ATTR{mtu}="9000"
Then set your physical interface MTU to 9000:

/etc/sysconfig/network-scripts/ifcfg-eth0 (on host):
DEVICE=eth0
HWADDR=[physical MAC address]
TYPE=Ethernet
ONBOOT=yes
BRIDGE=br0
MTU=9000
And do the same inside the bridge:

/etc/sysconfig/network-scripts/ifcfg-br0 (on host)
DEVICE=br0
TYPE=Bridge
ONBOOT=yes
DELAY=0
MTU=9000
Now inside your guest, set your virtio or e1000 interface to also have the larger MTU:

/etc/sysconfig/network-scripts/ifcfg-eth0 (in guest)
DEVICE=eth0
HWADDR=[guest MAC address]
TYPE=Ethernet
ONBOOT=yes
MTU=9000
You'll need to perform a "service network restart" on the host, or at least bring the bridge and eth interfaces down and up. Start your guest and confirm all interfaces have been made with the correct MTU:
# ip link
2: eth0: mtu 9000 qdisc pfifo_fast state UP qlen 1000
    link/ether 01:23:45:67:89:0A brd ff:ff:ff:ff:ff:ff
3: br0: mtu 9000 qdisc noqueue state UNKNOWN
    link/ether 01:23:45:67:89:0A brd ff:ff:ff:ff:ff:ff
4: vnet0: mtu 9000 qdisc pfifo_fast state UNKNOWN qlen 500
    link/ether fe:54:00:01:23:45 brd ff:ff:ff:ff:ff:ff
This should be enough to send a "Do Not Fragment" 9000 byte frame over the network. Let's test with a ping:
# ping -c 4 -s 8972 -M do 172.16.0.2
PING 172.16.0.2 (172.16.0.2) 8972(9000) bytes of data.
8980 bytes from 172.16.0.2: icmp_seq=1 ttl=64 time=1.27 ms
8980 bytes from 172.16.0.2: icmp_seq=2 ttl=64 time=0.284 ms
8980 bytes from 172.16.0.2: icmp_seq=3 ttl=64 time=0.202 ms
8980 bytes from 172.16.0.2: icmp_seq=4 ttl=64 time=0.260 ms
Success!

Wednesday, June 20, 2012

grub2 usb keyboard not working

I installed the newly released Fedora 17 this week, only to find I could no longer control the GRUB2 screen to get into Windows to play some games. The keyboard and mouse work perfectly in BIOS, and in Linux once USB drivers are loaded, just not at the GRUB2 screen.

Many forum threads exist for this, most pointing towards the "USB Legacy" or similar option in the BIOS. I had this turned on, however turning it off made no difference either.

GRUB2 can load some driver modules, so perhaps it wasn't loading the USB modules. Adding GRUB_PRELOAD_MODULES="usb usb_keyboard ehci ohci uhci" to /etc/default/grub and then rebuilding the config files with grub2-mkconfig -o /boot/grub2/grub.cfg didn't change anything either.

At this point I started coming across articles mentioning UEFI support for GRUB2. UEFI is the "new BIOS" standard coming out on new motherboards. My motherboard is a fairly new model, so it does have EFI firmware.

Turns out the solution is to install a version of GRUB2 with EFI support. This was done with yum install grub2-efi to install the package, then grub2-efi-install /dev/sda to install the EFI-supporting bootloader onto my hard drive. I regenerated a new config with grub2-efi-mkconfig -o /boot/grub2/grub.cfg while I was at it.

Now my USB keyboard works perfectly in GRUB2.

Thursday, April 26, 2012

su to root without a password

I'm sick of typing the root password every time I want to su - on Fedora to become the root user. I know how to allow sudo access without a password, but I don't want to use sudo, I want to be able to just type su - and become root.

I couldn't find a good answer for this on Google, so I read the man pages of pam (Pluggable Authentication Modules) until I figured it out.

In the file /etc/pam.d/su put this as the second line:

auth            sufficient      pam_permit.so

This is incredibly insecure as it lets literally anyone at all with a login become root.

To restrict this just to your username, use this line instead, replace the yourusername with your actual username:

auth            sufficient      pam_succeed_if.so use_uid user = yourusername

You can also restrict this to a group, here the group allowedpeople can su without a password:

auth            sufficient      pam_succeed_if.so use_uid user ingroup allowedpeople

Saturday, April 21, 2012

starting rtorrent on system startup

rTorrent is a curses-based bittorrent client for Linux.

It's very light on system resources but has great features such as monitoring of a directory for .torrent files, auto-move based on status (incoming, seeding, complete, etc), categories, magnet link handling and RSS capabilities.

I have a headless system where I seed some (legal) torrents and wanted rTorrent to start up when the system did. There are some examples of init scripts on the rTorrent site but I didn't like how these ran, specifically the su constantly needing a password and the odd way it started GNU Screen.

Download
Installation
  • Put it at /etc/init.d/bittorrent and make it executable
    chmod +x /etc/init.d/bittorrent
  • Add to chkconfig
    chkconfig --add bittorrent
  • Set to start on system startup
    chkconfig bittorrent on
  • If you want non-root users to be able to control it, put this in your visudo, replace "username" with your non-priveledged username
    username localhost=NOPASSWD:/etc/init.d/bittorrent*
  • Setup an alias to the script in the user's ~/.bashrc
    alias bittorrent='/etc/init.d/bittorrent'
    alias bt='bittorrent'
Requirements
  • CentOS 6 or Fedora 12-14. Probably also works on CentOS 5.
  • screen and rtorrent
  • A non-priveledged user to run rtorrent, this can either be a new user just to run torrents, or an existing user
  • Absolute session path in the .rtorrent.rc file
    session = /home/rtorrent/.session  ## this is good
    session = ~/.session               ## this will break
    session = .session                 ## so will this
  • Paths for other actions such as monitoring directories for .torrent files and auto-moving complete downloads don't have to be absolute.
Usage
  • Control the daemon withbittorrent start, bittorent stop, bittorrent restart
  • Get information about the daemon with
    bittorrent status, bittorrent info
  • Connect to the screen session with
    bittorrent connect
    (press ctrl+a then d to disconnect)
Licensing

starting minecraft server on system startup

This is an initscript to run a Minecraft or CraftBukkit server on CentOS, Fedora, and Ubuntu.

Features
  • Start, stop, restart CraftBukkit as a system service
  • Automatic (via cron) and manual logfile rotation
  • Automatic (via cron) and manual backups
  • Backup compression and rotation (keeps 7 days worth of backups)
  • Check latest Recommended Build and update to it if required
  • Information display including Java path, current memory usage, current TCP connections
  • Able to run multiple separate instances of the server at once
Supported Distributions
  • CentOS 6, CentOS 5, Fedora 14
    (probably works on Fedora Core 6 and later, untested)
  • Ubuntu Server 12.04 LTS
Other distros which use SysV Init or Upstart (Debian, Mint) will probably work.
Distros using systemd (Fedora 15+, Arch Linux, etc) will not work.

Get the script, view Requirements, Installation, Backups, Multiple Instances, and Usage
License

Released under GNU GPL v3 - http://www.gnu.org/licenses/

Credits

Thanks to these people whose work I have used in the making of this

The State of the Linux

It's been a while since I've posted but I'm still around. I started this blog as a sharing of tips and fixes I which used and couldn't find anywhere else. I've easily found most things I've wanted to do in the last few years so I haven't had the need to make much noise.

Today I'm here to write about the state of desktop Linux as I see it, compared to when this blog started in 2008 and I was obviously using Ubuntu.

These days I am a Fedora user. This was mostly brought about by starting to use RHEL at work and the need to become familiar with regular use of the RPM-based distro. I've also changed all my own servers over to CentOS.

Fedora's okay. Some people may deny this, but I think it's obviously a dumping ground for features Red Hat want to try, or to have the Fedora community crowdsource most of the initial testing and bugfixing before doing their own QA for inclusion in RHEL.

Fedora's near-bleeding-edge package cycles, still with a focus on stability, is both its strength and its weakness. It's great having the kernel or Wine updated in-distro within a week of new major upstream releases. It's frustrating having to deal with "latest and greatest" features I dislike such as GNOME 3 and systemd. I generally find Yum/rpm to be greatly messy and inferior compared to apt.

GNOME 3 is probably the largest thing to happen to desktop Linux in the last few years. It was met with such a hugely negative response and such polarising opinions that sites are still running polls about it. I think the developers made a mistake, sticking their head in the sand and telling users that the forced paradigm shift to Gnome Shell was what they wanted, despite the fact many people said they didn't.

Many Linux users appear to be seeking alternatives to Gnome Shell and all the competing Desktop Environments (KDE, XFCE, LXDE) have probably seen an increase in user base. Linux Mint listened to their users and pursued the MATE fork of GNOME 2, then created the Cinnamon Desktop. This fulfilling of majority demand has pushed them to the top of Distrowatch and kept them there. Kudos to the Mint Team for putting their money where their mouth is.

Ubuntu chose Unity over Gnome Shell. I've tried Unity several times and have been disgusted by it. It's so un-useable that I consider it just plain broken. I think it's pushing Ubuntu into irrelevance and their declining rating on Distrowatch tends to agree.

Mint used to be based on Ubuntu and have now started offering a re-base on Debian. CrunchBang also used to be based on Ubuntu and has switched to Debian altogether. Ubuntu's own variants Kubuntu and Xubuntu have fallen from sponsored releases to just "officially recognised" community projects.

I considered Ubuntu to be the king of Linux distros for a long time, but its reign is now well and truly over.

One interesting distro I saw on a magazine is Fuduntu. The name is ridiculous but the product itself is worth a look. It's a fork of Fedora 14 which has gone rolling-release. It still runs GTK2 and SysV Init but incorporates the latest 3.x kernel series. It has a smaller package set than Fedora and runs a Mac-like desktop environment based around a top-of-screen Gnome Panel and Avant Window Navigator.

My own desktop these days is Openbox with tint2 panel, a minimalist throwback from my days as an Arch Linux user.

Arch itself is a good distro with a great community, full of positive helpful people, few (if any) jerks, and little politics. However, I found myself spending around a quarter of my computer time just maintaining my system, rather than using the computer to do other things. Arch is something all Linux enthusiasts should do once for a period of time, the amount of tinkering and low-level micro-management required is educational and improves your Linux skills, but I feel it also is very much "using Linux for the sake of using Linux".

There seems to be a big paradigm shift happening all over desktops these days. Unity and GNOME 3 led for Linux and seem to have failed, Microsoft have shown their Metro interface which must be a bad joke. It's as if the development world has suddenly and unanimously decided the "menu and taskbar" interface which began with Windows 95 is no longer good enough, but nobody's come up with a suitable replacement, except perhaps Cinnamon.

Which desktop eventually wins out is still anyone's guess. Mint has shown that it's not necessarily the big corporate-backed developers who set the trend. Maybe we will never see one true new standard environment and modular personalised DEs will be the order of the day.

Sunday, March 11, 2012

mapping middle-click to a keyboard key under fedora

By far the most popular post on this blog was my old mapping middle-click to a keyboard key trick, which worked well under Ubuntu at the time.

Since then I've switched to Fedora which doesn't package old X11 tools like xkbset. However, this is such a useful thing to have on a laptop I've found a way.

We'll need the xdotool package, so yum install xdotool.

Then under the settings of your Window Manager, simply create a shortcut to xdotool click 2.

Under the default Gnome 3 desktop, this is in the Keyboard page of gnome-control-center.

Under Openbox, we'd add an entry to rc.xml like this
<keybind key="Menu">
  <action name="Execute">
    <command>xdotool click 2</command>
  </action>
</keybind>
And we're done!

xdotool can actually do a whole heap more than just emulate keyboard and mouse events, check out the author's webpage for more info!