Fatih Begit

Şubat 12, 2010

Virtualbox Sanal Disk Yeniden Boyutlandırma

Filed under: Bilgisayar Dünyası — fatihbegit @ 11:23 am
Tags: , , ,

Günümüzde sanallaştırma teknolojileri hem kurumsal alanlarda hem de kişisel kullanım amaçlı olarak oldukça yagınlaştı. Sun Microsystems ürünü olan VirtualBox uygulaması da bu konuda özellikle ücretsiz olması nedeniyle son kullanıcılara en etkin çözümlerden biri olarak karşımıza çıkıyor. VirtualBox kullanarak Windows üzerinde Linux yada Linux üzerinde Windows ortamı sağlayabilen sanal makineler oluşturmak mümkün.

Tabiki bir sanal makine kurabilmeniz için, öncelikle gerçek diskinizde bir dosya olarak gözüken, sanal makinenin işletim sisteminin kurulacağı, sanal bir disk oluşturmanız gerekir. Peki örneğin 10GB olarak oluşturduğunuz disk doldu ve linux sanal makinenizin sistem alanında, disk alanına ihtiyacınız doğdu. Bu yazımda bu durumda yeni kurulum yapmadan sistem disk alanınızı arttırma yollarından birini anlatmaya çalışacağım.  (Disk klonlama adımından sonraki adımlar, gerçek linux sistemimizde disk alanımızın boyutunu değiştirmek için kullanılabilir. Ancak diskimizin boyutunu küçültmek istiyorsak veri kaybı oluşmaması için yeni boyutun disk üzerindeki veri büyüklüğü toplamından küçük olmamasına dikkat edilmelidir.)

Bu işlemi makinemizin diskini değiştirmek olarak düşünebiliriz. Yani yeni ve daha büyük örneğin 20GB lık bir sanal disk oluşturmalıyız.

Daha sonra bu ikinci diski makinemize “Primary Slave” olarak yerleştirelim.

Yapmamız gereken ilk diskimizi ikinci diskimize kopyalamak. Bunun için en sağlıklı yol,bir live CD ile makinemizi açmak. Ubuntu CD leri bu işimizi görecektir. Bunun için sanal CD-ROM umuza bir Ubuntu CD imajı yerleştirerek ve makinemizi CD den boot ederek başlatalım. Diski makinemize “primary slave” olarak yerleştirdiğmiz için /dev/sda eski sanal diskimiz, /dev/sdb yeni ve büyük sanal diskimiz olacaktır. Ancak yine de emin olmak için:

ubuntu@ubuntu:~$ sudo su
root@ubuntu:/home/ubuntu # fdisk -l /dev/sdb
Disk /dev/sdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000c8c93

….

komutunu çalıştırarak, boyutlardan eski ve yeni disklerimizi tespit edebiliriz. Şimdi yeni diskimizin partition tablosunu yani sistem ve swap alanlarımızı yeni ve daha büyük boyutlarda oluşturalım.

root@ubuntu:/home/ubuntu # cfdisk /dev/sdb
cfdisk (util-linux-ng 2.14.2
Disk Drive: /dev/sdb
Size: 21474836480 bytes, 21.4 GB
Heads: 255   Sectors per Track: 63   Cylinders: 2610
Name                 Flags                Part Type         FS Type                       [Label]                   Size (MB)
————————————————————————————————————————————-
sdb1                 Boot                  Primary          Linux ext3                                                       20464.50
sdb5                                             Logical            Linux                                                              1003.49
Şimdi eski sistem alanımızı yeni sistem alanımıza klonlayabliriz.

root@ubuntu:/home/ubuntu# dd if=/dev/sda1 of=/dev/sdb1

dd ile /dev/sda1 bölümünü /dev/sdb1 bölümü içerisine dosya sistem tablosuyla beraber klonladık. Yani sdb1 diskimiz 20GB olmasına rağmen dosya sistemi tablomuz 10GB lık olduğu için kullanılabilir alanımız henüz artmadı. Bunu yeni sanal diskimizi mount ederek te görebiriliz.

Filesystem            Size  Used Avail Use% Mounted on
/dev/sdb1             8.8G  7.4G  1.1G  88% /media/disk

Kullanılabilir alanı genişletmemiz için dosya sistemi tablomuzu da genişletmeliyiz. Öncelikle üzerine verilemizi kopyaladığımız diski kontrol edelim.

root@ubuntu:/home/ubuntu # fsck -n /dev/sdb1
fsck 1.40.8 (13-Mar-2008)
e2fsck 1.40.8 (13-Mar-2008)
/dev/sdb1: clean, 126741/579360 files, 1943615/2319376 blocks
Daha sonra sırasıyla şu komutları çalıştıralım

root@ubuntu:/home/ubuntu # tune2fs /dev/sdb1
tune2fs 1.40.8 (13-Mar-2008)
root@ubuntu:/home/ubuntu # tune2fs -O ^has_journal /dev/sdb1
tune2fs 1.40.8 (13-Mar-2008)
Şimdi fdisk ile dosya sistemi tablomuzu düzenleyebiliriz.

root@ubuntu:/media# fdisk /dev/sdb
The number of cylinders for this disk is set to 2610.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): m
Command action
a   toggle a bootable flag
b   edit bsd disklabel
c   toggle the dos compatibility flag
d   delete a partition
l   list known partition types
m   print this menu
n   add a new partition
o   create a new empty DOS partition table
p   print the partition table
q   quit without saving changes
s   create a new empty Sun disklabel
t   change a partition’s system id
u   change display/entry units
v   verify the partition table
w   write table to disk and exit
x   extra functionality (experts only)
Command (m for help): p
Disk /dev/sdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000c8c93
Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1        2488    19984828+  83  Linux
/dev/sdb2            2489        2610      979965    5  Extended
/dev/sdb5            2489        2610      979933+  82  Linux swap / Solaris

Sdb1 bölümümüzü silelim. Burada veri kaybı olmayacaktır. ( Biz yeni disk oluşturup ayrıca üzerine partition tablomuzu kendimiz yazdığımız için bu bölümü silip yeniden daha büyük şekilde oluşturma adımlarını atlayabiliriz. Ancak aynı disk üzerinde bir genişletme için bu adımların yapılması gerekir.)

Command (m for help): d
Partition number (1-5): 1

Bölümü yeniden oluşturalım.

Command (m for help): n
Command action
l   logical (5 or over)
p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-2610, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-2488, default 2488): 2488

Şimdi tekrar 1. Bölümü bootable yapalım.

Command (m for help): a
Partition number (1-5): 1
Command (m for help): q

Tekrar bölümümüzü kontrol edelim.

root@ubuntu:/home/ubuntu# e2fsck -f /dev/sdb1
e2fsck 1.40.8 (13-Mar-2008)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sdb1: 126741/579360 files (3.5% non-contiguous), 1910813/2319376 blocks

Şimdi dosya sistemimizi genişletebiliriz.

root@ubuntu:/home/ubuntu# resize2fs /dev/sdb1
resize2fs 1.40.8 (13-Mar-2008)
Resizing the filesystem on /dev/sdb1 to 4996207 (4k) blocks.
The filesystem on /dev/sdb1 is now 4996207 blocks long.

Tekrar bölümümüzü kontrol edelim.

root@ubuntu:/home/ubuntu# fsck -n /dev/sdb1
fsck 1.40.8 (13-Mar-2008)
e2fsck 1.40.8 (13-Mar-2008)
/dev/sdb1: clean, 126741/1248480 files, 1932495/4996207 blocks

Dosya sistemimizi tekrar eski moduna döndürelim.

root@ubuntu:/media# tune2fs -j /dev/sdb1
tune2fs 1.40.8 (13-Mar-2008)
Creating journal inode: done
This filesystem will be automatically checked every 28 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

Şimdi sanal makinemizi kapatıp eski sanal diskimizi çıkarıp yeni sanal diskimizi “primary master” yaparak  ve Ubuntu imajımızı sanal CD-ROM dan çıkararak makinemizi başlatabiliriz. Sanal makinemizin sistem bölümünde 10GB lık bir genişleme olduğunu görebiliriz.

root@ubuntu:~$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1              19G  7.4G   11G  41% /

Son olarak swap alanımızın da UUID değeri değiştiği için yeni swap alanımızı makinemize göstermemiz gerekebilir.

root@ubuntu:~$ swapon /dev/sdb5

/etc/fstap dosyamız içerisindeki “UUID=31e0fe03-3dee-4722-a6e8-12c6c2260394 none            swap    sw              0       0” kaydındaki UUID degerini güncellememiz gerekebilir. Swap alanımızın UUID değerini alamak için blkid komutunu kullanabiliriz.

root@ubuntu:~$ blkid
/dev/sda1: UUID=”3264ae82-1b30-47a8-8c18-572ef1202585″
/dev/sda5: TYPE=”swap” UUID=”31e0fe03-3dee-4722-a6e8-12c6c2260394″

Şubat 5, 2010

Cisco VPN 3000 Concentrator ve 64 Bit Windows

Filed under: Bilgisayar Dünyası — fatihbegit @ 3:55 pm
Tags: , , , ,

Bildiğiniz gibi Cisco AnyConnect VPN Client uygulaması Cisco VPN 3000 series concentratorları desteklemiyor. Cisco VPN client uygulamasının ise 64 bitlik derlemesi bulunmuyor. Bu durumda 64 Bit Windows kullanıcıları 3. parti bir uygulama olan  ShrewSoft’ un geliştirdiğini VPN client uygulamasını kullanabilir.

Uygulamaya daha önce kullanılan Cisco VPN Client profillerini (.pcf dosyalarını) import ederek kulalnabilir. Ancak makinenizde daha önceden kurulu Sun Virtualbox gibi sanal network interfaceleri oluşturan bir uygulama kurulu ise Shrew VPN Client kurulumunda “Error 0x8004a029: Couldn’t install the network component.” gibi bit hatayla karşılaşabiliriz. Bu durumda Sun VirtualBox uygulamasını kaldırmanızı, Shrew VPN Client uygulamasını kurmanızı daha sonra Sun VirtualBox uygulamasını tekrar kurmanızı öneriyorum. Tabi bu arada sanal  makinenizde “Bridged Adapter” seceneğini kullanıyorsanız sanal makineniz açılmayacaktır. Bu durum için de Sun VirtualBox içerisinden ilgili sanal makineniz için “NAT” seçeneğini seçerek sanal makinenizi açabilirsiniz.

Cisco VPN 3000 series concentrator ile 64 bit Windows sıkıntısını giderebilecek Shrewsoft VPN Client uygulamasının son sürümüne http://www.shrew.net/download/vpn linkinden ulaşılabilir.

Cisco IP Phone için Catalyst Switchlerde IOS Konfigürasyonu

Filed under: Sistem Yönetimi — fatihbegit @ 1:45 pm
Tags: , , ,

Bu yazıda günümüzde kullanımı oldukça yaygınlaşan IP Phone kullanımı için Catalyst switchlerde yapılması gereken uygulamalardan bahsetmeye çalışacağım.

Öncelikle güvenlik ve performans gerekçesiyle data ve ses trafiğini ayırmamız gerekecektir. Bunu switchlerimiz üzerinde farklı vlanlar oluşturarak halledebiliriz. Ayrıca günümüzde her pc ve telefon için ayrı bir port kullanmamıza gerek yoktur çünkü bir çok IP phone modelinde bilgisayarımızın ağımıza erişebilmesini sağlayacak bir port bulunmaktadır.  Yani bağlantımız her pc+telefon switch üzerinde 1 port işgal edicek şekilde aşağıdaki gibi oluşturulabilir.

Peki switch ile telefon rasındaki bağlantı trunk olarak mı tanımlanmalıdır? Trunk portlar gereksiz broadcast/multicast/ve belirsiz unicast trafiğe izin vereceği ve her vlan için ayrı bit spanning tree instance oluşturacağı için trunk yerine QoS uygulanabilir.

3750test(config-if)#switchport voice vlan ?
<1-4094>  Vlan for voice traffic
dot1p     Priority tagged on PVID
none      Do not tell telephone about voice vlan
untagged  Untagged on PVID

Sadece vlan-id opsiyonu ile ses paketlerinin 802.1q ve voice VLAN-ID etiketlemeli, varsayılan Layer 2 CoS değeri 5 olarak (Voice control için 3),

dot1p opsiyonu ile ses paketlerinin VLAN0 etiketlemeli 802.1p frameleri içerisinde , varsayılan Layer 2 CoS değeri 5 olarak (Voice control için 3) iletimi sağlanabilir.

3750test#configure terminal
3750test(config)#interface fastethernet 2/5
3750test(config-if)#switchport mode access
3750test(config-if)#Switchport access vlan 10
3750test(config-if)#switchport voice vlan 20

Voice vlanın konfigürasyonuyla “spanning-tree portfast” komutu otomatik gözükecektir. Dikkat edilmesi gereken noktalardan biri de voice vlan konfigürasyonu kaldırıldığında “Port Fast” komutu otomatik kaldırılmaz.

Otomatik QoS uygulaması için cihazımız daha önceden QoS için konfigüre edilmediyse :

3750test#configure terminal
3750test(config)#interface fastethernet 2/5
3750test(config-if)#auto qos voip ?
cisco-phone      Trust the QoS marking of Cisco IP Phone
cisco-softphone  Trust the QoS marking of Cisco IP SoftPhone
trust            Trust the DSCP/CoS marking
3750test(config-if)#auto qos voip cisco-phone

Auto qos komutu ile QoS disabled durumda ise açılacak ve çıkış kuyrukları ve threshold değerleri otomatik set edilecektir.

mls qos map policed-dscp  24 26 46 to 0
mls qos map cos-dscp 0 8 16 24 32 46 48 56
mls qos srr-queue input bandwidth 90 10
mls qos srr-queue input threshold 1 8 16
mls qos srr-queue input threshold 2 34 66
mls qos srr-queue input buffers 67 33
mls qos srr-queue input cos-map queue 1 threshold 2  1
mls qos srr-queue input cos-map queue 1 threshold 3  0
mls qos srr-queue input cos-map queue 2 threshold 1  2
mls qos srr-queue input cos-map queue 2 threshold 2  4 6 7
mls qos srr-queue input cos-map queue 2 threshold 3  3 5
mls qos srr-queue input dscp-map queue 1 threshold 2  9 10 11 12 13 14 15
mls qos srr-queue input dscp-map queue 1 threshold 3  0 1 2 3 4 5 6 7
mls qos srr-queue input dscp-map queue 1 threshold 3  32
mls qos srr-queue input dscp-map queue 2 threshold 1  16 17 18 19 20 21 22 23
mls qos srr-queue input dscp-map queue 2 threshold 2  33 34 35 36 37 38 39 48
mls qos srr-queue input dscp-map queue 2 threshold 2  49 50 51 52 53 54 55 56
mls qos srr-queue input dscp-map queue 2 threshold 2  57 58 59 60 61 62 63
mls qos srr-queue input dscp-map queue 2 threshold 3  24 25 26 27 28 29 30 31
mls qos srr-queue input dscp-map queue 2 threshold 3  40 41 42 43 44 45 46 47
mls qos srr-queue output cos-map queue 1 threshold 3  5
mls qos srr-queue output cos-map queue 2 threshold 3  3 6 7
mls qos srr-queue output cos-map queue 3 threshold 3  2 4
mls qos srr-queue output cos-map queue 4 threshold 2  1
mls qos srr-queue output cos-map queue 4 threshold 3  0
mls qos srr-queue output dscp-map queue 1 threshold 3  40 41 42 43 44 45 46 47
mls qos srr-queue output dscp-map queue 2 threshold 3  24 25 26 27 28 29 30 31
mls qos srr-queue output dscp-map queue 2 threshold 3  48 49 50 51 52 53 54 55
mls qos srr-queue output dscp-map queue 2 threshold 3  56 57 58 59 60 61 62 63
mls qos srr-queue output dscp-map queue 3 threshold 3  16 17 18 19 20 21 22 23
mls qos srr-queue output dscp-map queue 3 threshold 3  32 33 34 35 36 37 38 39
mls qos srr-queue output dscp-map queue 4 threshold 1  8
mls qos srr-queue output dscp-map queue 4 threshold 2  9 10 11 12 13 14 15
mls qos srr-queue output dscp-map queue 4 threshold 3  0 1 2 3 4 5 6 7
mls qos queue-set output 1 threshold 1 138 138 92 138
mls qos queue-set output 1 threshold 2 138 138 92 400
mls qos queue-set output 1 threshold 3 36 77 100 318
mls qos queue-set output 1 threshold 4 20 50 67 400
mls qos queue-set output 2 threshold 1 149 149 100 149
mls qos queue-set output 2 threshold 2 118 118 100 235
mls qos queue-set output 2 threshold 3 41 68 100 272
mls qos queue-set output 2 threshold 4 42 72 100 242
mls qos queue-set output 1 buffers 10 10 26 54
mls qos queue-set output 2 buffers 16 6 17 61
mls qos

Ses paketleri trunk linkler üzerine çıkarılacaksa uplink portumuzda da QoS konfigürasyonu gerekir.

3750test(config)#interface gigabitethernet 1/1
3750test(config-if)#auto qos voip trust
Ses  Paketleri Layer 3 interfaceler üzerinde çıkarılacaksa ek olarak “mls qos trust dscp” komutu çalıştırılmalıdır.
3750test#configure terminal
3750test(config)#interface gigabitethernet 1/1
3750test(config-if)#auto qos voip trust
3750test(config-if)#mls qos trust dscp
3750test(config-if)#qos trust dscp

Kullandığımız switch 3750-24ps gibi PoE (Power over Ethernet) desktekleyen bir cihaz ise ve telefonlarımız için ayrıca güç kabloları kullanmak istemiyorsak, switchimizi IP Phone cihazlarımızı beslemek için de kullanabiliriz.

3750test#configure terminal
3750test(config)#interface fastethernet 2/5
3750test(config-if)#power inline auto

Burada switchimizin güç kaynağı ve beslediği cihazların gereksinim duydukları güçlerin de göz önünde bulundurulması gerekebilir.

http://www.ciscosystems.net.mu/en/US/prod/collateral/switches/ps5718/ps5023/product_data_sheet09186a008016136f.html
http://www.cisco.com/en/US/products/hw/switches/ps607/products_qanda_item09186a0080116ffe.shtml
http://www.cisco.com/en/US/docs/switches/lan/catalyst3560/software/release/12.2_25_sea/configuration/guide/swvoip.html
http://www.cisco.com/en/US/products/hw/switches/ps4324/products_configuration_example09186a0080722cdb.shtml

Crontab Editor Problemi

Filed under: Sistem Yönetimi — fatihbegit @ 8:49 am
Tags: , ,

Linux görev zamanlayıcısı olan cron uygulmasının her kullanıcı için kontrolünü kolaylaştıran crontab uygulaması ile ilgili şu durumla karşılaşabiliriz.

user@ pc:/tmp$ crontab -e
no crontab for user – using an empty one
29
^Z
[3]+  Stopped                 crontab –e
user@ pc:/tmp$

Burada “user” kullanıcısı kendi crontab dosyasını edit seçeneği ile açmaya çalışmış fakat profilinde EDITOR set edilmediği için crontab ilgili dosyayı açabileceği editor bulamamıştır.Sorunun çözümü için sistemimizde EDITOR değerini set etmeliyiz.

user@ pc:~$ EDITOR=/usr/bin/vi
user@pc:~$ export EDITOR

Kolaylık sağlaması açısından editor değerini nano ya da pico olarak ta set edebiliriz. Daha sonra  “crontab –e” komutu ile kullanıcının crontab dosyası bizim istediğimiz editor ile açılabilir ve ilgili düzenlemeler yapılabilir.

Theme: Rubric. WordPress.com'dan blog alın.

Takip Et

Get every new post delivered to your Inbox.