CentOS 7 – resizing the root partition

Recently, I ran out of space on the root partition on one of my virtual CentOS 7 machines. So, I just had to extend it – which took me longer than expected, to figure out.
So, in case someone else is struggling to do this, I wan’t to make a quick guide. When having the right commands and tools, it’s not that big an issue, but if you’re used to CentOS 6 (and below), there’s some minor differences.

First of all, the disk needed to be resized in my virtualbox – I assume you’re able to do that, it’s quite easy.

But then the partition need to be resized to use the new available space, which was the start of a small journey for me, as it was the root partition and I wanted to keep all my data.

1. Find the names of the disks

We need to know what the disks are called:

# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root centos -wi-ao---- 3,92g
swap centos -wi-ao---- 412,00m

In my case, I want to resize my root partition, that is logical volume “root”.

2. Creating a new logical volume

We need to have some logical volume, that we can extend from. So we’ll have to create a new one, using fdisk:

(my disk is called sda, replace with the name of your disk…)

# fdisk /dev/sda
Command (m for help): n
Command action
e   extended
p   primary partition (X)
p
Partition number (X-Y): 3
First sector (XXXX-XXXX, default XXXX):
Using default value XXXX
Last sector, +sectors or +size{K,M,G} (XXXX-XXXX, default XXXX):
Using default value XXXX
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.

(I’ve replaced all values with X’s, to avoid confusion)

First, “n” for new
It will suggest some default values, which are fine if you want to extend to all the free space:
Partision: the first available partition number it prints. In my case it was “3″.
First sector: use the default value. It will suggest the first available sector, which is what we want.
Last sector: use the defualt value. It will suggest the last available sector, which is also what we want.

A new command prompt will be displayed, and you enter “w” to write the changes and quit fdisk.

3. Creating a new physical volume

You now have a new logical volume. That’s great, but you can’t use it yet – we need a physical volumen to extend from.

Use fdisk -l to see the new volume and its name. You should see something like:

/dev/sda3 8388608 51199999 21405696 83 Linux

(If there are multiple, you should be able to regognize it on the size – normally it’s the last on the list called “/dev/sdaX”, as the number is just incremented.)

In mys case, it’s called “/dev/sda3″.

Now, we can create the new physical volume, using pvcreate:

pvcreate /dev/sda3

4. Extending the root partition

Now we have a new, unused logical volume, that we can use for the root partition – and we’re ready to extend the root partition.

But first we need to get the name of the root partition. You can find it using the good ol’ dh. Find the filesystem mounted on “/”:

# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 24G 2,9G 21G 13% /
devtmpfs 236M 0 236M 0% /dev
tmpfs 245M 0 245M 0% /dev/shm
tmpfs 245M 4,3M 241M 2% /run
tmpfs 245M 0 245M 0% /sys/fs/cgroup
/dev/sda1 497M 158M 340M 32% /boot
tmpfs 49M 0 49M 0% /run/user/1000

So, the name of the root partition is “/dev/mapper/centos-root”. And the name of the new volume we created earlier is “/dev/sda3″.

That’s all we need to know. Let’s extend it:

vgextend /dev/mapper/centos-root /dev/sda3

5. Extending the filesystem

The last thing we need to do, is to extend the filesystem, so it’s actually using the new amount of space.

It’s very easy, using the command “xfs_growfs”:

xfs_growfs -d /

(the -d option tell the command to use the maximum amount of available space on the underlaying partition)

If you get and error, telling that you don’t have the xfs_growfs command, you’ll have to install it, but it’s very easy:

yum install xfsprogs

You should now be able to see the new, resize partition, using df -l.

6. Summary and conclusion

Resizing the root partition is not something you just do from the command line. Using gparted or similar makes it a bit easier, but the underlaying mecanism is the same.
But when you know the commands, it’s not that difficult.

Vstarcam C7824WIP

I’ve just bought myself an IP camera, just to play with. I went for the cheapest I could find, to see if it was worth anything.

So I bought a Vstarcam C7824WIP.

It’s a wireless camera, 720p, IR/nightvision, 2-way sound, tilt/pan, motion detection, micro-sd slot for recordings and much more.

First, let me say that this is a chinese product. I didn’t expect much, but at a price of less that 50$, it seemed a fun place to start.

The web interface

The camera has a built-in web interface, from where you can see live video and setup the camera. The interface is a little slow, due to the slow hardware in the camera – I’ll get back to that. On the index page, there’s several options how to access the main interface, as there are different options depending on which browser you are using. I’m using Firefox, which limits some features, but I still got all the basic functionality, like enable/disable IR, pan/tilt and so on. You are able to control it and view the live video.

Configuration options

There’s not much to play with, except the basic stuff; you can set up the wifi settings, the motion detection, timezone, e-mail, etc. but nothing fancy.

Motion detection

They have actually made some OK motion detection. You can chose the sensibility on a scale from 1-10 (I’m currently using level 7), chose to send an e-mail on motions, upload to FTP and record on the SD card. And you can enable the motion detection with 15 minutes precision through a week.

However, the send to e-mail feature isn’t brilliant, as it only sends 6 images in the mail and no video. In most cases the result is that you receive an e-mail with some pictures of things that are about to happen or is already ended.

I haven’t used the upload to FTP setting yet, but it should be able to upload the actual videos and not just images.

Image quality

The image isn’t brilliant, but OK – I am able to see some details and if you use it for surveillance, the records is good enough for face detection.

The built-in web interface has a live video preview, but the quality is rubbish. You can only chose video in 320×180 or 640×360 and it’s quite blurry. I don’t understand that, it must be compressed a lot, because the recordings are in a way better quality – higher resolution and much more crisp.

Security

The web interface requires you to log in. The default login is admin/888888 and of course it can be changed. However, in the firmware I’m running right now – the latest version – provides a link for streaming video. And no login is required on that file, which is a bit risky. I’m don’t care with my use of the camera, but having it in the house could lead to some concerns. I hope they change that in a later firmware version.

In my router I noticed that the camera is sending something to 6-8 foreign IP addresses, some of which are from Japan. Perhaps I’m paranoid, but the amount of data doesn’t lead my thought to simple firmware update checks. It’s not enough for it to be a stream of video, but I’m wondering what it’s sending and to whom. But I haven’t looked at the traffic yet, so I’m not sure what it is. Again, if anyone are watching my camera, I doesn’t revile anything important, but it’s a bit worrying, in many cases.

The fun part: accessing the file system

It didn’t take me long to find out that the camera can be access via telnet. And neither took it long to find you that root/123456 gives you access to the system.

And there it is: the camera is running some sort of Linux:

Linux (none) 3.0.8 #30 Tue May 27 21:58:10 CST 2014 armv5tejl GNU/Linux

The file system is read-only per default although it says it isn’t:

# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 6.1M 6.1M 0 100% /
tmpfs 15.9M 4.0K 15.9M 0% /dev
/dev/mtdblock3 5.0M 2.3M 2.7M 46% /system
none 3.0M 48.0K 3.0M 2% /tmp
/dev/mmcblk0p1 29.7G 2.5G 27.2G 8% /mnt/sda0

The web interface can be found in /system/www/
The recording on the SD card can be found in /mnt/sda0

I have disabled the auto firmware updater, by simply out commenting it in /system/init/ipcam.sh (/system is read-write)

I’ve also noticed that it has some GPIOs, that can be turned on/off from the web interface. But there’s no visible pins outside it, so perhaps I need to take it apart and see what’s inside.

Conclusion

Don’t buy this camera, if you’re looking for a surveillance solution. The security is way to weak, the origins way to risky and the quality isn’t good enough in my opinion.

But if you just wanna play around, it’s actually surprisingly nice. Honestly, my expectations was that the camera was at least able to take poor pictures, the pan/tilt not working etc. But at less than 50$, it does a nice job.

KDE 4.13.4 tested and the results are…

KDE logo

Let me introduce by telling that I’m a dedicated Ubuntu user and I’m using Unity on daily basis. But now and then I try KDE to see how it works, as it’s released in new version with new features. It haven’t been able to convert my view on Gnome/Unity as first choice when it comes to desktop environments, but it deserve some time now and then, to see how it works and if the user experience is getting better.

So, once more I thought I would give KDE a chance, now the Plasma 5 interface has been on the marked for some time, and most of the bugs should have been fixed.

let’s jump right into it…

Look’n’feel

This topic is one of the most important arguments for the KDE users. KDE have from day one had a high intension of being a customizable desktop, where the GUI isn’t just some dictated experience. The user have all kind of choices to change the way it looks and works.

The default interface that meet you right after installing and booting it the first time, is actually quite nice. You do sense that there have been a lot of focus on make it look different – in a good way that is.

Notification area

Notification area

There’s a nice fade in/fade out effect on the loading panel, the background is colorful and it have what you expects: a start menu in the bottom left corner (beat that, Windows 8!), some launchers (shortcuts) next to it a bar where icons of the open windows are located, and some notification/info/system icons in the right side, from where you can see/adjust the sound volume, network, Dropbox (in my case), keyboard settings, clock etc. etc.

Window with blue glow

The windows have some blue glow around it, which makes it easy to find the active window, and all-in-all it seems nice.

When you start using it, you’ll quickly notice there’s some default effects as well; minimize/maximize animations, transparent background in the windows when you drag them and the things behind the windows is blurry, the start menu does some fancy sliding when changing between the sections etc.

Window “geany” minimizing effect

Notice the graphic on the snapshot of the minimize effect. It’s not that good looking, and although the effect duration is very small and the effect is quickly over, you’ll still notice the bad rendering, which it a pain in the eyes.

Each of the individual effects are okay, but combined it quickly gets a little too much and messy. You can’t touch anything without some special effect starts doing stuff.

Start menu

Start menu

The start menu comes in two variants: the default (mentioned as “Application Launcher style”) and a classic style menu (looks a bit like the old menu in Gnome <3). At first glance, the default menu is smart, since it’s a set of tabs, each representing a category containing related icons. When hovering a tab, then category-frame nicely slides into the selected category.

It’s all very nice, but at the end of the day, I think many will think it’s a bit too much.

Of cause look’n’feel if a matter of subjective opinions, and my view of it isn’t the final, overruling judgment. But as a person that uses a computer many hours a day, I think my view does represent a lot of people. :-)

Performance

Everything seems to run smooth, I haven’t discovered any lag in the graphics and opening programs is quite fast.

Of cause this depends on the machine you’re using. Mine is a i7, SSD disk, 16GB RAM and NVIDIA GTX-770, so I wouldn’t expect the UI/OS itself to be slow and challenging. But the lack of good rendering of the animation makes me think that it will ruin fine on slower computers as well.

Applications and extensibility

You will not run low on programs with KDE! There’s a lot… The default installation contains everything you need – and a lot you don’t need. Is that good or bad? Well, I prefer a selection of often-used programs in visible parts of the menu, and not-so-often-used programs reachable with a quick search function.

In the (default) start menu, there’s a nice search-as-you-type search function, that allows you to search quickly in programs. However, it seems that it only searches in the selected category, which is a bit annoying, since you then need to know in which category the program is located.

One of the first things I noticed is the content of the categories in the start menu. Theres a lot of programs you will never use, and many programs for each use: There’s two image viewers, two browsers, two video players, etc.

It seems like the developers wanted to have everything that every user want to use. The result is chaotic in my opinion.

Extending the OS with new programs are easy, using the KDE software installer. Theres a huge amount of programs that are supported in KDE – I bet you’ll find everything you need, even specialized programs for scientific use, educational use, etc.

Conclusion

I’m still not impressed. I really tried to give it a chance and look at it with objective eyes, but I cannot see the reason to choose KDE. I’m not saying that Gnome/Unity is the only good desktop environment, there’s a lot to choose from, but as a “normal” user, that need a good, solid, intuitive UI, I still prefer Gnome/Unity, and KDE has a long way to go, before it can compete against it.

I have been trying to find uses and person groups, for whom KDE would be a good choice, but I really can’t. Perhaps the new Linux user, that want to play around with some customization and have fun, but I’ll bet it will get too much and it will be replaced by Gnome/Unity.

Should you give KDE a try? No.

Raspberry PI – Edimax wifi kept shutting down

So, I got myself an Edimax EW-7811Un 802.11n WIFI adapter for my Respberry PI 2 B+. I was told that it should be rock stable on a Raspberry PI with Raspbian.
At first glance it seemed to be true, the installation was straight forward and configuration was only a few changes and it was up running.

But after some hours, the PI went offline – it didn’t shut down, it just lost the connection. Since I don’t have a monitor and keyboard connected to it, I restarted it and it was online again for a few hours and then it was offline again. I repeated this many time, trying to trace the error, but no logfile said anything about what was wrong.

After some searching on the Internet, I found out that I wasn’t the only one having this problem. However, despite many great ideas, none of them worked for me.

But then… I one thread, someone suggested a power management setting – why didn’t I think of that!? There was a couple of suggestions how to disable it, but this one did the trick in my case:

I simply added the file /etc/modprobe.d/8192cu.conf with this content:

# Disable power management
options 8192cu rtw_power_mgnt=0 rtw_enusbss=0

And then reboot.

You can check that the power management has been disabled, by running this command:
cat /sys/module/8192cu/parameters/rtw_power_mgnt

It will write a 0 (zero) if the power management is disabled.

So, if you are experiencing the same problem, you can try this solution – I hope it helps! :-)

New track: Summer Night

Now and then I tend to mess around in the world of electronic music.
To be honost, most of it is crap, but now and then I finish a track. But I just keep it and then it’s lost over time, due to harddisk failures etc

So why not post the tracks here, when I’ve come up with something I think is okay?

Here’s the first track, finished today and I think it’s pretty nice, actually :-)

NVIDIA on openSUSE? Naaaah

After only a few hours of use, I wanted to install the latest driver from NVIDIA for my GTX770. That became a huge problem; installing it required a lot of packages that did not exist and finally it complained about the kernel, which it didn’t like.

Then I looked for an alternative and it turned out that openSUSE does have original drivers from NVIDIA, compiled for openSUSE. Great!

Installation went well, but after a reboot and after I logged in to Gnome I only got a white screen. Actually two, both my monitors was completely white. Now and then some graphic errors turned up and drawed some lines in the screen. So, that didn’t work very well.

I’ve now decided that I don’t wanna use any more time trying to rescue the installation. I’m now waiting for Fedora to finish downloading – I’ll give that a go. It just has to support the official NVIDIA driver, that’s all I ask. CentOS did that very well, so I believe it’s possible for other RPM based systems.

And if Fedora also turns me down, that’s it – then I’m going for Ubuntu. I think Ubuntu has got too commercial and I don’t like it. But if that’s the only distro that works, I can live with it, I will just modify a couple of things.

Oh, the Fedora-download just finished – I will try it out right away…

Cheers.

openSUSE first boot

I’ve now got openSUSE 13.1 x86_64 installed. I took me a while; first my PC wouldn’t boot from the USB I made – it turned out it was formatted as NTFS. Then I used UNetbootin, which I’ve always used. But it failed writing the menu correct, so when I selected to only menu-item in the UNetbootin startup list, it just returned to the menu.

So I used openSUSE ImageWriter instead and that worked.

But the ethernet card wasn’t present in the network list (ifconfig only showed the lo interface).

After a quick Google search, I found out I had to go to YaST->Network Devices->Network Settings and enable the ethernet card. It had one enabled, but it seems to be some dummy – it doesn’t have any MAC address and it isn’t activated.

But after I enabled the ethernet card, everything seems to work.

I’ll run openSUSE for some time and get back with a short review ;-)

So, CentOS didn’t work for me

Not long ago, I decided to install CentOS on my PC. CentOS isn’t quite made for desktop purposes, but it’s stability still drawed me to install it with Gnome 2 (I really hate Gnome 3).

After setting up the OS and installing the latest driver for my NVIDIA GTX770, it ran absolutely beautiful. But…

I decided that I would give Steam a try on Centos. Actually it’s not officially builded for RHEL, but deb package could be converted into an working RPM. So far so good. The only problem was – and this is where CentOS comes to its limits as Desktop OS – the Steam RPM required glibc > 2.15 and CentOS only comes with 2.12. But why should that stop me? I searched for some RPM’s containing a newer glibc, but I couldn’t find anyone that I would rely on. So, I decided to get the source and compile it myself.

I downloaded glibc 2.19 – currently the latest version – and began my adventure. Actually everything went very well, I got it configured and installed. However, it created a new librt.so in /lib64 but it didn’t change the symbolic link /lib64/librt.so.1 to the new version. And this is where I did a fatal mistake.

Instead of re-creating the symbolic link, I (perhaps I was too tired?) moved the existing /lib64/librt.so.1 to /tmp. This doesn’t seem that fatal, does it? Do yourself a big favor and DON’T try to do so.

As sonn it was moved, I couldn’t do anything. And I mean anything. No commands was working, I couldn’t even do ls, ln or anything. I closed the terminal to go online and read about the file and what to do. But Google Chrome wouldn’t open. Now I began to realize how fatal it was. I then tried to open the terminal again. No luck.

Okay, but I could change to another shell by pressing <ALT>+F1 (or something). As supposed, I now got another shell and was asked to authenticate myself. But after entering the username, I was just promted for login again.

I now decided to reboot, which resultet in a kernel crash while booting. Luckely I still got my Windows 8 partition, which I started up. From Windows I was able – via some program – to mount and edit the partition where CentOS was located. Since it was a symbolic link I moved to /tmp, I couldn’t copy/paste it to /lib64 again. And I couldn’t make a new symbolic link.

So I decided to copy the new librt-2.19.so to librt.so.1 – that should work, I thought.

Well, the kernel panic was solved, but now CentOS complained about multiple other errors. That’s it, I don’t wanna use anymore time on it, I’m going for a new install.

But this time I try openSUSE instead. That should give me some more updated packages to play with. :-)