search
Categories
Archive
Blogroll

Microsoft PowerShell MVP

Cozumpark Bilisim Portali
AdvancedInstaller
Posted in Linux Server | No Comment | 244 views | 01/04/2013 17:15

If you need to extend your logical volume, do following first:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
distro=$(cat /etc/issue | head -n 2 | tr -d "\n" | tr "[:upper:]" "[:lower:]")
device=$(fdisk -l | grep -w 8e | head -n 1 | cut -c-8)
partcount=$(fdisk -l | grep $device | sed 1d | grep -c $device)
newpartnum=$(($partcount+1))
startsector=$(fdisk -l | grep -w 8e | tail -1 | tr " " "\n" | sed "/^$/d" | head -n 3 | tail -1)
newstartsector=$(($startsector+1))
endsector=$(fdisk -l | grep sectors | head -n 1 | tr " " "\n" | tail -2 | head -n 1)
newendsector=$(($endsector-1))
fdisk $device <<EOF
n
p
$newpartnum
$newstartsector
$newendsector
t
$newpartnum
8e
w
EOF

Then reboot your server!

After that, you should do following to extend LVM:

1
2
3
4
5
6
7
8
9
10
11
12
device=$(fdisk -l | grep -w 8e | head -n 1 | cut -c-8)
partnumber=$(fdisk -l | grep $device | sed 1d | grep -c $device)
pvcreate $device$partnumber
volgroupname=$(vgdisplay | grep -w "VG Name" | cut -b10- | tr -d " ")
vgextend $volgroupname $device$partnumber
volgroupchars=$(echo $volgroupname | wc --chars)
totalchars=$(($volgroupchars+13))
lvmname=$(df -h | grep -w $volgroupname | head -n 1 | cut -b$totalchars-)
set $lvmname
lvmname=$1
lvextend -l +100%FREE /dev/$volgroupname/$lvmname
resize2fs /dev/$volgroupname/$lvmname

You can control final size with this command:

df -h

You should see new disk size after this process.


Posted in Linux Server, Virtual Machine Manager | 4 Comments | 3,778 views | 26/03/2012 04:19

Ubuntu 12 is coming with Hyper-V drivers for the best integration and usability. Ubuntu 12 is still in Beta like Hyper-V v3 but results are promising. I’m posting some important screenshots from Ubuntu 12. You can also find benchmark results of new Ubuntu 12 on Hyper-V v3.

1. Ubuntu Login Screen and no “SMBus Base Address Uninitialized” warning anymore!

2. Ubuntu 12 recognizes Hyper-V synthetic network driver by default.

3. Let’s see installed Hyper-V modules.



Posted in Linux Server, Virtual Machine Manager, Windows Server | 13 Comments | 15,879 views | 28/01/2012 21:12

You installed CentOS 6.2 on Hyper-V and you want to install Linux Integration Services v3.2.
Let’s read documentation and see if we can.

So let’s do it on CentOS server.



Posted in Linux Server, Virtual Machine Manager | 1 Comment | 1,833 views | 28/01/2012 20:07

You may need to uninstall Hyper-V Linux Integration Services v3.2 due to some reasons.
Let’s read documentation and see if we can.

After my first look, i don’t see any difference between x86 and x64.
Lets check it on VM console and see if they are correct.



Posted in Linux Server | No Comment | 535 views | 27/12/2011 09:33

You can create MySQL database and user via command line.

1
2
3
4
CREATE DATABASE dbname;
CREATE USER 'dbusername'@'localhost';
SET PASSWORD FOR 'dbusername'@'localhost' = PASSWORD('PASSWORD');
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,ALTER,CREATE TEMPORARY TABLES,LOCK TABLES,REFERENCES ON dbname.* TO `dbusername`@`localhost` WITH GRANT OPTION;

That gives only localhost grant on MySQL server.


Posted in Linux Server | No Comment | 607 views | 27/12/2011 09:27

You can transfer data between two linux servers directly via SCP.

scp -r root@10.10.10.2:/var/www/html/production/common /var/www/html/production

It transfer common directory from 10.10.10.2 to under production directory.


Posted in Linux Server | No Comment | 676 views | 27/12/2011 09:21

You can mount NFS share on a Linux Server with following commands:

mount 10.10.10.2:/NFSName  /var/www/html

After that, you should also add that to fstab.

1
2
nano /etc/fstab
10.10.10.2:/NFSName /var/www/html nfs noacl,noatime,nodiratime,rsize=65536,wsize=65536,tcp 0 0

Now you can see NFS share in /var/www/html.




Powered by DorukNet