Dariush Debian Diary

Diariusz Dariusza

, 08, 2012

Permanent URL 

mdadm --add /dev/md2 /dev/sda6 mdadm: /dev/sda6 reports being an active member for /dev/md2, but a --re-add fails. mdadm: not performing --add as that would convert /dev/sda6 in to a spare. mdadm: To make this a spare, use "mdadm --zero-superblock /dev/sda6" first. pokurcz:/home/eyck# mdadm --zero-superblock /dev/sda6 pokurcz:/home/eyck# mdadm --add /dev/md2 /dev/sda6 mdadm: added /dev/sda6 pokurcz:/home/eyck# cat /proc/mdstat Personalities : [raid1] md2 : active raid1 sda6[2] sdd6[3] 1851851521 blocks super 1.2 [2/1] [U_] [>....................] recovery = 0.0% (57792/1851851521) finish=1601.6min speed=19264K/sec

Last modified on

Permanent URL btrfs vs filesystem problems/recovery tool

mount -o recovery /dev/btrfs /btrfs



device fsid b45b8c51-33eb-4ab0-9a33-4741cf8c6a6a devid 1 transid 18732 /dev/ubf6
btrfs: enabling auto recoveryparent transid verify failed on 57569280 wanted 18732 found 18734
parent transid verify failed on 57569280 wanted 18732 found 18734
parent transid verify failed on 57569280 wanted 18732 found 18734
parent transid verify failed on 57569280 wanted 18732 found 18734
parent transid verify failed on 57569280 wanted 18732 found 18734
parent transid verify failed on 57569280 wanted 18732 found 18734
parent transid verify failed on 9799873626169147392 wanted 9799873626169212927 found 0
------------[ cut here ]------------
kernel BUG at fs/btrfs/volumes.c:2860!
invalid opcode: 0000 [#1] SMP
CPU 1
Modules linked in: ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 nf_conntrack nf_defrag_ipv4 veth ftdi_sio usbserial ext3 jbd isofs loop nls_iso8859_1 nls_cp437 vfat fat sg intel_agp intel_gtt radeon ttm drm_kms_helper drm i2c_algo_bit iptable_filter ip_tables ebtable_nat ebtables x_tables acpi_cpufreq mperf cpufreq_userspace cpufreq_stats cpufreq_powersave cpufreq_ondemand freq_table parport_pc ppdev lp parport bnep rfcomm binfmt_misc fuse tun nfs lockd fscache auth_rpcgss nfs_acl sunrpc bridge ipheth 8021q garp stp ext4 mbcache jbd2 zram(C) kvm_intel kvm snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_intel snd_hda_codec btusb snd_pcm_oss snd_mixer_oss snd_pcm bluetooth psmouse rfkill snd_timer i2c_i801 i7core_edac pcspkr i2c_core button snd edac_core processor soundcore rtc_cmos snd_page_alloc crc16 serio_raw evdev thermal_sys xfs btrfs zlib_deflate crc32c libcrc32c dm_mod raid1 md_mod sd_mod crc_t10dif usb_storage uas ub usbhid hid r8169 mii ahci libahci firewire_ohci libata firewire_core crc_itu_t scsi_mod ehci_hcd usbcore usb_common [last unloaded: scsi_wait_scan]

Pid: 18418, comm: mount Tainted: G         C   3.2.1 #1 Hewlett-Packard HP Elite 7000 Microtower PC/2A90h
RIP: 0010:[<ffffffffa0197fa7>]  [<ffffffffa0197fa7>] btrfs_num_copies+0x37/0x82 [btrfs]
RSP: 0018:ffff88006a2c3ac8  EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff8800ab266108 RCX: ffffffffffffffff
RDX: 00000078c9e30000 RSI: 880025241b880000 RDI: ffff88019742e1b8
RBP: ffff88006a2c3ae8 R08: 880025241b88ffff R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 880025241b880000
R13: 0000000000000000 R14: ffff88005d2b8a00 R15: 0000000000000000
FS:  00007f55305927e0(0000) GS:ffff88022fc40000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00002b0d47c59000 CR3: 00000001f0ab6000 CR4: 00000000000026e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process mount (pid: 18418, threadinfo ffff88006a2c2000, task ffff8802221cdbe0)
Stack:
 ffff880047a2e400 0000000000001000 ffff88005d2b89d8 ffff880047a2e400
 ffff88006a2c3b48 ffffffffa0175b2b 00000000000000ff 880025241b88ffff
 ffff88004e58e570 00000000ab266000 ffff880047a2e400 ffff88005d2b89d8
Call Trace:
 [<ffffffffa0175b2b>] btree_read_extent_buffer_pages+0x9d/0xbc [btrfs]
 [<ffffffffa01767b0>] read_tree_block+0x30/0x43 [btrfs]
 [<ffffffffa017a992>] open_ctree+0xf12/0x154c [btrfs]
 [<ffffffffa0160145>] btrfs_mount+0x3aa/0x565 [btrfs]
 [<ffffffff810cc527>] ? __free_pages+0x1b/0x24
 [<ffffffff810cc56f>] ? free_pages+0x3f/0x46
 [<ffffffff811853b4>] ? smack_sb_copy_data+0xf6/0x107
 [<ffffffff81112d8f>] mount_fs+0x6b/0x14f
 [<ffffffff810e1474>] ? __alloc_percpu+0xb/0xd
 [<ffffffff81127e21>] vfs_kern_mount+0x60/0x98
 [<ffffffff811291cd>] do_kern_mount+0x48/0xd8
 [<ffffffff81129940>] do_mount+0x6e3/0x746
 [<ffffffff810f6c25>] ? alloc_pages_current+0xaa/0xcd
 [<ffffffff81129a26>] sys_mount+0x83/0xbd
 [<ffffffff81337492>] system_call_fastpath+0x16/0x1b
Code: fb 48 83 ec 10 48 8d 7f 08 48 89 55 e8 e8 56 ea 19 e1 48 8b 55 e8 4c 89 e6 48 89 df e8 83 30 ff ff f0 48 ff 43 08 48 85 c0 75 04 <0f> 0b eb fe 48 8b 50 18 4c 39 e2 77 09 48 03 50 20 4c 39 e2 73
RIP  [<ffffffffa0197fa7>] btrfs_num_copies+0x37/0x82 [btrfs]
 RSP <ffff88006a2c3ac8>
---[ end trace ea074e24971fab1f ]---


./btrfsck  /dev/ubf6
parent transid verify failed on 58155008 wanted 18733 found 18661
parent transid verify failed on 58155008 wanted 18733 found 18661
parent transid verify failed on 58155008 wanted 18733 found 18661
parent transid verify failed on 58155008 wanted 18733 found 18661
Ignoring transid failure
leaf 58155008 items 6 free space 169 generation 18661 owner 7
fs uuid b45b8c51-33eb-4ab0-9a33-4741cf8c6a6a
chunk uuid ab8e0c05-f526-4614-a74e-59d6260a7a26
        item 0 key (EXTENT_CSUM EXTENT_CSUM 390792507392) itemoff 3839 itemsize 156
                extent csum item
        item 1 key (EXTENT_CSUM EXTENT_CSUM 390792667136) itemoff 3167 itemsize 672
                extent csum item
        item 2 key (EXTENT_CSUM EXTENT_CSUM 390793355264) itemoff 2431 itemsize 736
                extent csum item
        item 3 key (EXTENT_CSUM EXTENT_CSUM 390794108928) itemoff 1631 itemsize 800
                extent csum item
        item 4 key (EXTENT_CSUM EXTENT_CSUM 390794928128) itemoff 959 itemsize 672
                extent csum item
        item 5 key (EXTENT_CSUM EXTENT_CSUM 390795616256) itemoff 319 itemsize 640
                extent csum item
failed to find block number 74158080
Aborted

pokurcz:git/btrfs-recvo/recovery-beta# ./find-root  /dev/ubf6
Super think's the tree root is at 53374976, chunk root 20975616
Well block 4194304 seems great, but generation doesn't match, have=3, want=18734
Well block 4206592 seems great, but generation doesn't match, have=4, want=18734
Found tree root at 53374976


./btrfs-debug-tree -R /dev/ubf6
root tree: 53374976 level 0
chunk tree: 20975616 level 1
extent tree key (EXTENT_TREE ROOT_ITEM 0) 53465088 level 2
device tree key (DEV_TREE ROOT_ITEM 0) 26942234624 level 1
fs tree key (FS_TREE ROOT_ITEM 0) 74158080 level 2
checksum tree key (CSUM_TREE ROOT_ITEM 0) 447963000832 level 3
data reloc tree key (DATA_RELOC_TREE ROOT_ITEM 0) 29380608 level 0
btrfs root backup slot 0
        tree root gen 18732 block 57569280
                extent root gen 18732 block 74190848
                chunk root gen 8588 block 20975616
                device root gen 8588 block 26942234624
                csum root gen 18728 block 447963000832
                fs root gen 18732 block 74158080
                360809558016 used 520133771264 total 1 devices
btrfs root backup slot 1
        tree root gen 18733 block 57999360
                extent root gen 18733 block 58003456
                chunk root gen 8588 block 20975616
                device root gen 8588 block 26942234624
                csum root gen 18728 block 447963000832
                fs root gen 18732 block 74158080
                360809553920 used 520133771264 total 1 devices
btrfs root backup slot 2
        tree root gen 18734 block 53374976
                extent root gen 18734 block 53465088
                chunk root gen 8588 block 20975616
                device root gen 8588 block 26942234624
                csum root gen 18728 block 447963000832
                fs root gen 18732 block 74158080
                360809553920 used 520133771264 total 1 devices
btrfs root backup slot 3
        tree root gen 9799873626169212927 block 9799873626169147392
                extent root gen 0 block 0
                chunk root gen 65535 block 9800301589670461439
                device root gen 0 block 0
                csum root gen 0 block 0
                fs root gen 0 block 0
                9800432325723422720 used 0 total 9800432325698322431 devices
total bytes 520133771264
bytes used 360809553920
uuid b45b8c51-33eb-4ab0-9a33-4741cf8c6a6a
Btrfs Btrfs v0.19

Read-only recovery works (as of 2012.02):

time nice ionice -c 3 ./restore -v /dev/btrfs /fs/recovery
Root objectid is 5
Restoring /fs/recovery/home.2011.01.19.tar.lzma
Restoring /fs/recovery/venom
Restoring /fs/recovery/venom/fs.tar.lzop
We seem to be looping a lot on /fs/recovery/venom/fs.tar.lzop, do you want to keep going on ? (y/N): y
We seem to be looping a lot on /fs/recovery/venom/fs.tar.lzop, do you want to keep going on ? (y/N):
Done searching /fs/recovery/venom
Restoring /fs/recovery/out
Restoring /fs/recovery/out/copy
Done searching /fs/recovery/out/copy
Restoring /fs/recovery/out/pdf

...



real    647m2.091s
user    0m0.800s
sys     30m3.790s

( 309G of data recovered from failed btrfs in 10 hours )

Last modified on

, 16, 2011

Permanent URL Improving update performance of munin with rrdcached: munin 1.4

Last modified on

, 04, 2011

Permanent URL Restoring iPhone 3G bricked by 'Erase all data and settings' command

Symptoms: Gray apple.

* Press Home and Power simultanously
* keep on holding then both until reboot, and then until iTunes logo appears
* when iTunes logo appears, you can restore using iTunes

Last modified on

, 16, 2009

Permanent URL ADWS 9389 perl

ADWS 9389 perl

Last modified on

, 13, 2009

Permanent URL iP4600 on 64-bit debian with duplex printing

go to http://software.canon-europe.com/products/0010649.asp download debian .tar, unpack and:

dpkg -i --force-architecture cnijfilter-common_3.00-1_i386.deb        cnijfilter-ip4600series_3.00-1_i386.deb

Last modified on

, 22, 2009

Permanent URL Moving Roles in Postgresql ( with passwords )

pg_dumpall -g

Last modified on

, 05, 2008

Permanent URL Upgrading Postgresql from 8.1 to 8.3 (debian lenny transition)

apt-get install postgresql ( this install postgresql-8.3 ) pg_dropcluster --stop 8.3 main kakofonix:/var/backups/pg# pg_upgradecluster -v 8.3 8.1 main Creating new cluster (configuration: /etc/postgresql/8.3/main, data: /var/lib/postgresql/8.3/main)... Moving configuration file /var/lib/postgresql/8.3/main/postgresql.conf to /etc/postgresql/8.3/main... Moving configuration file /var/lib/postgresql/8.3/main/pg_hba.conf to /etc/postgresql/8.3/main... Moving configuration file /var/lib/postgresql/8.3/main/pg_ident.conf to /etc/postgresql/8.3/main... Configuring postgresql.conf to use port 5433... Disabling connections to the old cluster during upgrade... Disabling connections to the new cluster during upgrade... Re-enabling connections to the old cluster... Re-enabling connections to the new cluster... Creating globals... Fixing hardcoded library paths for stored procedures... Upgrading database agenericdatabase... Analyzing database agenericdatabase... Fixing hardcoded library paths for stored procedures... Upgrading database anotherdb... Analyzing database anotherdb... Fixing hardcoded library paths for stored procedures... Upgrading database postgres... Analyzing database postgres... Fixing hardcoded library paths for stored procedures... Upgrading database template1... pg_restore: [archiver (db)] Error while PROCESSING TOC: pg_restore: [archiver (db)] Error from TOC entry 1502; 1262 1 DATABASE template1 postgres pg_restore: [archiver (db)] could not execute query: ERROR: database "template1" already exists Command was: CREATE DATABASE template1 WITH TEMPLATE = template0 ENCODING = 'SQL_ASCII'; WARNING: errors ignored on restore: 1 Analyzing database template1... Copying old configuration files... Copying old start.conf... Stopping target cluster... Stopping old cluster... Disabling automatic startup of old cluster... Configuring old cluster to use a different port (5433)... Starting target cluster on the original port... Success. Please check that the upgraded cluster works. If it does, you can remove the old cluster with pg_dropcluster 8.1 main

Last modified on

, 13, 2008

Permanent URL Create Degraded Raid1

Sep  5  2007
gnoll2:~# mdadm --create /dev/md1 --level 1 --raid-devices=2 missing /dev/hdh5
mdadm: array /dev/md1 started.
gnoll2:~# cat /proc/mdstat 
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
md1 : active raid1 hdh5[1]
      77152064 blocks [2/1] [_U]
            
unused devices: <none>

gnoll2:/fs/tmp# mdadm --add /dev/md1 /dev/hde5 
mdadm: added /dev/hde5
gnoll2:/fs/tmp# cat /proc/mdstat 
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
md1 : active raid1 hde5[2] hdh5[1]
      77152064 blocks [2/1] [_U]
            [>....................]  recovery =  0.0% (18560/77152064) finish=414.6min speed=3093K/sec
	          
unused devices: <none>
gnoll2:/fs/tmp# 

pokurcz:/home/eyck# mdadm  --create /dev/md1 -a yes --level 1 --raid-devices=2 missing /dev/sdb5
mdadm: array /dev/md1 started.

pokurcz:/home/eyck# cat /proc/mdstat 
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
md1 : active raid1 sdb5[1]
      50002176 blocks [2/1] [_U]
            
unused devices: <none>
pokurcz:/home/eyck# 

pokurcz:/home/eyck# mdadm --add /dev/md1 /dev/sda5
mdadm: added /dev/sda5
pokurcz:/home/eyck# cat /proc/mdstat 
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
md1 : active raid1 sda5[2] sdb5[1]
      50002176 blocks [2/1] [_U]
      [>....................]  recovery =  0.2% (139392/50002176) finish=11.9min speed=69696K/sec
	          
unused devices: <none>

Last modified on

, 12, 2008

Permanent URL VMWare Server on debian etch requirements

ii libx11-6 1.0.3-7 X11 client-side library ii libx11-data 1.0.3-7 X11 client-side library ii libxau6 1.0.1-2 X11 authorisation library ii libxcomposite1 0.3-3 X11 Composite extension library ii libxdmcp6 1.0.1-2 X11 Display Manager Control Protocol library ii libxext6 1.0.1-2 X11 miscellaneous extension library ii libxfixes3 4.0.1-5 X11 miscellaneous 'fixes' extension library ii libxi6 1.0.1-4 X11 Input extension library ii libxrender1 0.9.1-3 X Rendering Extension client library ii libxt6 1.0.2-2 X11 toolkit intrinsics library ii libxtst6 1.0.1-5 X11 Testing -- Resource extension library

Last modified on

, 15, 2008

Permanent URL Installing fairly featurefull perl on win32

1) get openssl-win32 2) install strawberry perl 3) (if your openssl include Crypt::SSLeay with correct perl version, go for it, if not - perl -MCPAN -e shell install Crypt::SSLeay - fails. go to cpan build dir, perl Makefile.PL;dmake => works. dmake install Next, Net::SSLeay - repeat, it fails, because it forgets about ssleay.a files.. copy their paths from Makefile for Crypt::SSLeay (EXTRALIBS vs LDLOADLIBS) install Tk, Net::SSLeay::Handle, Win32::Process... and voilea..

Last modified on

, 11, 2008

Permanent URL Upgrading postgres from 8.1 to 8.3 on debian etch:


root@test64:/var/backups/pg# pg_upgradecluster 8.1 main
Creating new cluster (configuration: /etc/postgresql/8.3/main, data: /var/lib/postgresql/8.3/main)...
Moving configuration file /var/lib/postgresql/8.3/main/postgresql.conf to /etc/postgresql/8.3/main...
Moving configuration file /var/lib/postgresql/8.3/main/pg_hba.conf to /etc/postgresql/8.3/main...
Moving configuration file /var/lib/postgresql/8.3/main/pg_ident.conf to /etc/postgresql/8.3/main...
Configuring postgresql.conf to use port 5433...
Disabling connections to the old cluster during upgrade...
Disabling connections to the new cluster during upgrade...
Re-enabling connections to the old cluster...
Re-enabling connections to the new cluster...
Creating globals...
Fixing hardcoded library paths for stored procedures...
Upgrading database bazkadb-user07...
Analyzing database bazkadb-user07...
Fixing hardcoded library paths for stored procedures...
Upgrading database bazkadbep...
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 1617; 2606 562236 FK CONSTRAINT fkad166f893bd6f4d7 bazka
pg_restore: [archiver (db)] could not execute query: ERROR:  foreign key constraint "fkad166f893bd6f4d7" cannot be implemented
DETAIL:  Key columns "id_endpoint" and "id_endpoint" are of incompatible types: character varying and integer.
    Command was: ALTER TABLE ONLY user_endpoint
    ADD CONSTRAINT fkad166f893bd6f4d7 FOREIGN KEY (id_endpoint) REFERENCES endpoint(id_endpoi...
WARNING: errors ignored on restore: 1
Analyzing database bazkadbep...
Fixing hardcoded library paths for stored procedures...
Upgrading database postgres...
Analyzing database postgres...
Fixing hardcoded library paths for stored procedures...
Upgrading database bazkadbep2...
Analyzing database bazkadbep2...
Fixing hardcoded library paths for stored procedures...
Upgrading database bazkadb...
Analyzing database bazkadb...
Fixing hardcoded library paths for stored procedures...
Upgrading database xwiki...
Analyzing database xwiki...
Fixing hardcoded library paths for stored procedures...
Upgrading database scheduler...
Analyzing database scheduler...
Fixing hardcoded library paths for stored procedures...
Upgrading database template1...
Analyzing database template1...
Copying old configuration files...
Copying old start.conf...
Stopping target cluster...
Stopping old cluster...
Disabling automatic startup of old cluster...
Configuring old cluster to use a different port (5433)...
Starting target cluster on the original port...
Success. Please check that the upgraded cluster works. If it does,
you can remove the old cluster with

  pg_dropcluster 8.1 main

root@test64:/var/backups/pg# pg_dropcluster 8.1 main

Last modified on

, 25, 2008

Permanent URL Backups with snapshots

pokurcz:/home/ftp# xfs_freeze -f /fs/tmpptc/     
pokurcz:/home/ftp# lvcreate -l 500 -s -n tsnap /dev/dat/tmpptc 
  Logical volume "tsnap" created
pokurcz:/home/ftp# mkdir /fs/snapt
pokurcz:/home/ftp# mount -o nouuid,ro /dev/dat/tmp
tmpf    tmpptc  
pokurcz:/home/ftp# mount -o nouuid,ro /dev/dat/tmp
tmpf    tmpptc  
pokurcz:/home/ftp# mount -o nouuid,ro /dev/dat/   
bck      devetch  fs       ftp      tmpf     tmpptc   tsnap    
pokurcz:/home/ftp# mount -o nouuid,ro /dev/dat/tsnap /fs/snapt/
pokurcz:/home/ftp# xfs_freeze -u /fs/tmpptc
pokurcz:/home/ftp# 



pokurcz:/home/ftp# cd /fs/tmpptc/
pokurcz:/fs/tmpptc# ls
TL1_6-install.pdf                        
VMware-VMvisor-InstallerCD-3.5.0-67921.i386.iso  conieface.xfsdump.gz  hypervisor_performance_comparison_1_0_5_with_esx-data.pdf  ldap.pem         q                     testy
pokurcz:/fs/tmpptc# touch HELLO.WORLD
pokurcz:/fs/tmpptc# ls /fs/snapt/
VMware-VMvisor-InstallerCD-3.5.0-67921.i386.iso  conieface.xfsdump.gz  hypervisor_performance_comparison_1_0_5_with_esx-data.pdf  ldap.pem         q                     testy
pokurcz:/fs/tmpptc# 


Clean up:

pokurcz:/fs/tmpptc# umount /fs/snapt/
pokurcz:/fs/tmpptc# lvremove -f /dev/dat/   
      tmpf     tmpptc   tsnap    
pokurcz:/fs/tmpptc# lvremove -f /dev/dat/tsnap 
  Logical volume "tsnap" successfully removed

Last modified on

, 22, 2008

Permanent URL Remove disks from lvm

HN:/home/eyck# pvscan 
  PV /dev/dm-10          VG systems   lvm2 [65.00 GB / 5.93 GB free]
  PV /dev/dm-9           VG cdb       lvm2 [70.00 GB / 1.89 GB free]
  PV /dev/dm-8           VG spool     lvm2 [797.47 GB / 81.70 GB free]
  PV /dev/cciss/c0d0p5                lvm2 [32.98 GB]
  PV /dev/cciss/c1d0p5                lvm2 [67.83 GB]
  PV /dev/cciss/c1d1p5                lvm2 [67.83 GB]
  PV /dev/cciss/c1d2p5                lvm2 [273.45 GB]
  PV /dev/cciss/c1d3p1                lvm2 [279.39 GB]
  Total: 8 [1.62 TB] / in use: 3 [932.46 GB] / in no VG: 5 [721.49 GB]
HN:/home/eyck# pvremove  /dev/cciss/c1d3p1
  Labels on physical volume "/dev/cciss/c1d3p1" successfully wiped
HN:/home/eyck# pvremove  /dev/cciss/c1d2p5
  Labels on physical volume "/dev/cciss/c1d2p5" successfully wiped
HN:/home/eyck# pvremove  /dev/cciss/c1d1p5
  Labels on physical volume "/dev/cciss/c1d1p5" successfully wiped
HN:/home/eyck# pvremove  /dev/cciss/c0d0p5
  Labels on physical volume "/dev/cciss/c0d0p5" successfully wiped
HN:/home/eyck# pvremove  /dev/cciss/c1d0p5
  Labels on physical volume "/dev/cciss/c1d0p5" successfully wiped
HN:/home/eyck# 

HN:/home/eyck# pvscan 
  PV /dev/dm-10   VG systems   lvm2 [65.00 GB / 5.93 GB free]
  PV /dev/dm-9    VG cdb       lvm2 [70.00 GB / 1.89 GB free]
  PV /dev/dm-8    VG spool     lvm2 [797.47 GB / 81.70 GB free]
Total: 3 [932.46 GB] / in use: 3 [932.46 GB] / in no VG: 0 [0   ]

Last modified on

Permanent URL Kerberos and k5start

kadmin -k -p eyck@DOMAIN

Last modified on

, 14, 2007

Permanent URL PowerDNS on PostgreSQL


CREATE TABLE domains (
    id serial NOT NULL,
    name character varying(255) NOT NULL,
    master character varying(20),
    last_check integer,
    "type" character varying(6) NOT NULL,
    notified_serial integer,
    account character varying(40)
);


CREATE TABLE records (
    id serial NOT NULL,
    domain_id integer,
    name character varying(255),
    "type" character varying(6),
    content character varying(255),
    ttl integer,
    prio integer,
    change_date integer
);

CREATE TABLE supermasters (
    ip character varying(25) NOT NULL,
    nameserver character varying(255) NOT NULL,
    account character varying(40)
);



COPY domains (id, name, master, last_check, "type", notified_serial, account) FROM stdin;
1       kuszelas.eu    \N      \N      NATIVE  \N      \N
\.


--
-- Data for TOC entry 22 (OID 17153)
-- Name: records; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY records (id, domain_id, name, "type", content, ttl, prio, change_date) FROM stdin;
2       1       localhost.kuszelas.eu  A       127.0.0.1       120     \N      \N
20      1       kuszelas.eu    MX      mail2.kuszelas.eu      300     10      \N
21      1       mail2.kuszelas.eu      A       212.182.115.24  120     \N      \N
1       1       kuszelas.eu    SOA     localhost user.kuszelas.eu 1   86400   \N      \N
17      1       kuszelas.eu    NS      ns.kuszelas.eu 300     \N      \N
18      1       kuszelas.eu    MX      mail.kuszelas.eu       300     5       \N
12      1       _jabber._tcp.jabber.kuszelas.eu        SRV     0 5269 kuszelas.eu     300     10      \N
13      1       _xmpp-server._tcp.jabber.kuszelas.eu   SRV     0 5269 kuszelas.eu     300     10      \N
14      1       _xmpp-client._tcp.jabber.kuszelas.eu   SRV     0 5222 kuszelas.eu     300     10      \N
16      1       kuszelas.eu    TXT     Serwer  300     \N      \N
3       1       www.kuszelas.eu        A       195.242.124.71  120     \N      \N
5       1       dns.kuszelas.eu        A       195.242.124.71  120     \N      \N
6       1       ftp.kuszelas.eu        A       195.242.124.71  120     \N      \N
7       1       poczta.kuszelas.eu     A       195.242.124.71  120     \N      \N
8       1       pop3.kuszelas.eu       A       195.242.124.71  120     \N      \N
9       1       smtp.kuszelas.eu       A       195.242.124.71  120     \N      \N
10      1       ssh.kuszelas.eu        A       195.242.124.71  120     \N      \N
11      1       jabber.kuszelas.eu     A       195.242.124.71  120     \N      \N
4       1       mail.kuszelas.eu       A       195.242.124.71  120     \N      \N
\.


Audit trail:
CREATE TABLE audit_domains (
    operation         char(1)   NOT NULL,
    stamp             timestamp NOT NULL,
    userid            text      NOT NULL,
    id serial NOT NULL,
    name character varying(255) NOT NULL,
    master character varying(20),
    last_check integer,
    "type" character varying(6) NOT NULL,
    notified_serial integer,
    account character varying(40)
);


CREATE TABLE audit_records (
    operation         char(1)   NOT NULL,
    stamp             timestamp NOT NULL,
    userid            text      NOT NULL,
    id serial NOT NULL,
    domain_id integer,
    name character varying(255),
    "type" character varying(6),
    content character varying(255),
    ttl integer,
    prio integer,
    change_date integer
);

CREATE OR REPLACE FUNCTION process_audit_domains() RETURNS TRIGGER AS $audit_domains$
    BEGIN
        --
        -- Create a row in audit_domains to reflect the operation performed on domains,
        -- make use of the special variable TG_OP to work out the operation.
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO audit_domains SELECT 'D', now(), user, OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO audit_domains SELECT 'U', now(), user, NEW.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO audit_domains SELECT 'I', now(), user, NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$audit_domains$ LANGUAGE plpgsql;

CREATE TRIGGER audit_domains
AFTER INSERT OR UPDATE OR DELETE ON domains
    FOR EACH ROW EXECUTE PROCEDURE process_audit_domains();

--

CREATE OR REPLACE FUNCTION process_audit_records() RETURNS TRIGGER AS $audit_records$
    BEGIN
        --
        -- Create a row in audit_records to reflect the operation performed on records,
        -- make use of the special variable TG_OP to work out the operation.
        --
        IF (TG_OP = 'DELETE') THEN
            INSERT INTO audit_records SELECT 'D', now(), user, OLD.*;
            RETURN OLD;
        ELSIF (TG_OP = 'UPDATE') THEN
            INSERT INTO audit_records SELECT 'U', now(), user, NEW.*;
            RETURN NEW;
        ELSIF (TG_OP = 'INSERT') THEN
            INSERT INTO audit_records SELECT 'I', now(), user, NEW.*;
            RETURN NEW;
        END IF;
        RETURN NULL; -- result is ignored since this is an AFTER trigger
    END;
$audit_records$ LANGUAGE plpgsql;

CREATE TRIGGER audit_records
AFTER INSERT OR UPDATE OR DELETE ON records
    FOR EACH ROW EXECUTE PROCEDURE process_audit_records();



Last modified on

, 04, 2007

Permanent URL Compaq 6910p on debian lenny

Calendar

February 2012
Sun Mon Tue Wed Thu Fri Sat
     
     

Archives

Categories

Subscribe

Subscribe to a syndicated feed of this weblog, brought to you by the power of RSS.

XML