Posts Tagged Inne

Aug 31 2012

Kukiz – Paranoid

Jun 21 2012

nBox factory reset / hard reset

CLRA:
1) factory reset: EPG + REC + STRZAŁKA W GÓRE
2) hard reset: EPG + RES + STRZAŁKA W DÓŁ

BSLA/BZZB:
1) factory reset: EPG + REC+ STRZAŁKA W GÓRE
2) hard reset: EPG + RES + STRZAŁKA W PRAWO

May 25 2012

LVM on RAID 10

mdadm -v –create /dev/md1 –level=raid10 –raid-devices=4 /dev/sda2 /dev/sdb2 /dev/sdc2 /dev/sdd2
pvcreate /dev/md1
vgcreate vg-server1 /dev/md1
lvcreate -L4g -nlv-home vg-server1
lvcreate -L2g -nlv-var vg-server1
lvcreate -L1g -nlv-tmp vg-server1

The -L option specifies the size of the volume

lvcreate -l 100%FREE -nlv-home vg (creates all of the unallocated space in the volume group)

reducing volume  to 100GB (not for XFS filesystem!)

  1. umount /dev/vg-server1/lv-zapas
  2. e2fsck -f /dev/vg-server1/lv-zapas
  3. resize2fs -p  /dev/vg-server1/lv-zapas 100G
  4. lvreduce -L 100G /dev/vg-server1/lv-zapas
  5. e2fsck -f /dev/vg-server1/lv-zapas
  6. resize2fs -p  /dev/vg-server1/lv-zapas 
  7. e2fsck -f /dev/vg-server1/lv-zapas
  8. mount /dev/vg-server1/lv-zapas

extending volume up to 100GB  (not for XFS filesystem !)

  1. umount /dev/vg-server1/lv-home
  2. lvextend -L 100G /dev/vg-server1/lv-home or  lvextend -l +100%FREE /dev/vg-server1/lv-home)
  3. e2fsck -f /dev/vg-server1/lv-home
  4. resize2fs -p  /dev/vg-server1/lv-home
  5. e2fsck -f /dev/vg-server1/lv-home
  6. mount /dev/vg-server1/lv-home

 

extending volume + 1GB

lvextend -L+1G /dev/vg-server1/lv-var



					
Apr 18 2012

raid1 on existing filesystem -> Example

Existing filesystem is on /dev/sda

/dev/root  /
/dev/sda5 /var
/dev/sda6 /usr
/dev/sda8  /home

Connect new disk (for example /dev/sdb)

Copy partition structure from sda to sdc:

sfdisk -d /dev/sda | sfdisk /dev/sdb

or if disk has differ size

create the same size ( or bigger) partitions on sdb

end change type for fd (Linux raid autodetect)

change disk’s blkid

tune2fs -U random /dev/sdb

Next, create the single-disk RAID-1 array. Note the “missing” keyword is specified as one of our devices. We are going to fill this missing device later.

mdadm --create /dev/md0 --level=1 --raid-devices=2 missing /dev/sdb1

or

mdadm --create /dev/md0 --metadata=0.90 --level=1 --raid-devices=2 missing /dev/sdb1

and for other partitions

mdadm --create /dev/md1 --metadata=0.90 --level=1 --raid-devices=2 missing /dev/sdb5
mdadm --create /dev/md2 --metadata=0.90 --level=1 --raid-devices=2 missing /dev/sdb6
mdadm --create /dev/md3 --metadata=0.90 --level=1 --raid-devices=2 missing /dev/sdb7

cat /proc/mdstat shows just created raid

Use the file system of your preference here. I'll use ext4 for this guide.
mkfs -t ext4 -j -L RAID-ONE /dev/md0
mkfs -t ext4 -j -L RAID-ONE /dev/md1
mkfs -t ext4 -j -L RAID-ONE /dev/md2
mkfs -t ext4 -j -L RAID-ONE /dev/md3

Make a file system on the swap partition:

mkswap -L NEW-SWAP /dev/sdb2

The new RAID-1 array is ready to start accepting data! So now we need to mount the array, and copy everything from the old system to the new system

 mkdir /tmp/md0 /tmp/md1 /tmp/md2 /tmp/md3
 mount /dev/md0 /tmp/md0

 mount /dev/md1 /tmp/md1
 mount /dev/md2 /tmp/md2
 mount /dev/md3 /tmp/md3
 rsync -avxHAXS --delete --progress /home/ /tmp/md3
 rsync -avxHAXS --delete --progress /var/ /tmp/md2
 rsync -avxHAXS --delete --progress /usr/ /tmp/md1
 rsync -avxHAXS --delete --progress / /tmp/md0

edit /etc/fstab and change mounting points to appropriate /dev/md0 .. /dev/md3

and add line:

/dev/sdb2  swap swap defaults 0 0

reboot with opition  root=/dev/md0 (where my root filesystem was located).

telinit 1 ?

First, open /dev/sda with fdisk and change all the partittions you want to have added to the array to type fd – linux raid autodetection.

Then, for each degraded array, add the appropriate non-array device to it:

mdadm /dev/md0 -a /dev/sda1

(wait for finish recovery)

(umount/dev/sda5)
mdadm /dev/md1 -a /dev/sda5

(wait for finish recovery)

umount/dev/sda6
mdadm /dev/md2 -a /dev/sda6

(wait for finish recovery)

umount/dev/sda8
mdadm /dev/md3 -a /dev/sda8

(wait for finish recovery)

Ensure your /etc/lilo.conf has the correct setup:
boot=/dev/md0
raid-extra-boot=mbr-only
root=/dev/md0

and type:

lilo

LILO will write boot information to each of the individual raid devices boot sectors, so if either /boot or your root partition are on failed disks, you’ll still be able to boot.

Create /etc/mdadm/mdadm.conf.
in /etc/mdadm/mdadm.conf put line:
DEVICE /dev/sda* /dev/sdb*

and WHEN ALL PARTITIONS ARE REBUILDED run:

mdadm --detail --scan >> /etc/mdadm.conf

					
Jan 9 2012

Postfix + Mysql + dovecot + Maildir

wpis w /etc/dovecot.conf.d/10-mail.conf
mail_location = maildir:/var/vmail/%d/%n/Maildir

auth-sql.conf.ext
passdb sql {
args = /etc/dovecot/dovecot-sql.conf
}

userdb static {
args = uid=5000 gid=5000 home=/var/vmail/%d/%n allow_all_users=yes
}

Mar 18 2011

Instalacja Windows7 z USB (wersja 2)

Pobierz usługę  Image Mastering API v2.0

Pobierz Windows7-USB-DVD-tool.exe

Mar 18 2011

Instalacja Windows7 z USB

Potrzeba:

obraz Windows 7

USB Pen Drive (>=4GB)

MBRwiz do pobrania stąd.

1. Sformatuj PenDrive

2. Otwórz command Prompt ( Start Menu -> run -> cmd ) i  wpisz  convert e: /fs:ntfs (gdzie e: to litera dysku USB)

3. Podmontuj obraz dysku Windows 7

4. w command prompt wpisz:

mbrwiz /list (zanotuj numer twojego PenDrive’a)

mbrwiz /disk=X /active=1 (X to numer dysku USB)

exit

5. Otwórz drugi command prompt i wpisz

y: (litera dysku na którym jest podmontowany Windows 7)

cd boot

bootsect /nt60 E: (gdzie E: to litera dysku USB) -jeśli robisz to na komputerze z Windows Vista lub nowszym

bootsect /nt52 E: (gdzie E: to litera dysku USB) -jeśli robisz to na komputerze z XP

6. Skopiuj wszystkie pliki z Windows7 na USB

7. Uruchom ponownie komputer z dysku USB

Mar 3 2011

debian backports

Add this line
deb http://backports.debian.org/debian-backports squeeze-backports main
to your sources.list (or add a new file to /etc/apt/sources.list.d/)
Run apt-get update

Add this linedeb http://backports.debian.org/debian-backports squeeze-backports mainto your sources.list (or add a new file to /etc/apt/sources.list.d/)Run apt-get update

apt-get -t squeeze-backports install “package”

Feb 28 2011

mysql reset zapomnianego hasła

Zatrzymaj serwer mysql.
uruchom serwer w tym trybie:

 /usr/bin/mysqld_safe --skip-grant-tables --socket=/var/run/mysqld/mysqld.sock mysql --user=root mysql
 update user set Password=PASSWORD('new-password-here') WHERE User='root';

w debianie –user=admin

Aug 4 2010

Slackware 13.1 + Postfix + MySQL

postfix z TLS, dovecot, mysql
na systemie 32-bit
make makefiles CCARGS=’-DUSE_TLS -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\”dovecot\” -I/usr/lib/dovecot -DHAS_MYSQL -I/usr/include/mysql’ AUXLIBS=”-L/usr/lib -lsasl2 -L/usr/lib/mysql -lmysqlclient -lz -lm -lssl -lcrypto”

jeśli wyskoczą błędy:
gcc -Wmissing-prototypes -Wformat -DHAS_MYSQL -I/usr/include/mysql -DHAS_PCRE -g -O -I. -DLINUX2 -c alldig.c
mv /usr/include/mysql/events.h /usr/include/mysql/events.h.bak