Quantcast

Mardi 1 janvier 2 01 /01 /Jan 08:22

 

1) Apache Web server

 

<code>

apt-get install apache2

</code>

 

It serves pages from folder : /var/www

 

<code>

head /etc/apache2/sites-available/default

 

<VirtualHost *:80>
       ServerAdmin webmaster@localhost

        DocumentRoot /var/www

</code>

 

create folder :

<code>

mkdir -p /var/www/sarg

</code>

 

2) SARG

 

<code>

apt-get install sarg

</code>

 

edit sarg conf file : /etc/sarg/sarg.conf

and change the following lines, the last only if you use dansguardian :

<code>

access_log /var/log/squid3/access.log
date_format e
output_dir /var/www/sarg

#
dansguardian_conf /etc/dansguardian/dansguardian.conf

</code>

 

3) SARG Report

 

configure sarg report, here it' in french

<code>

cat <<EOF>/etc/sarg/sarg-reports.conf
SARG=/usr/bin/sarg
CONFIG=/etc/sarg/sarg.conf
HTMLOUT=/var/www/sarg
PAGETITLE="Statitics Proxy $(hostname)"
LOGOIMG=/sarg/images/sarg.png
LOGOLINK="http://$(hostname)/"
DAILY=Jour
WEEKLY=Semaine
MONTHLY=Mois
EXCLUDELOG1="SARG: Pas d enregistrement trouvé"
EXCLUDELOG2="SARG: Fin"

EOF

</code>

 

modify the lines contanint $SARG to add the log floder "/var/log/squid3/access.log*" in the script /usr/sbin/sarg-reports

to have :

<code>

grep \$SARG sarg-reports
      $SARG -f $CONFIG -d $MANUALDATE -o $DAILYOUT /var/log/squid3/access.log*
  $SARG -f $CONFIG -d $TODAY -o $DAILYOUT /var/log/squid3/access.log* >$ERRORS 2>&1
  $SARG -f $CONFIG -d day-1 -o $DAILYOUT /var/log/squid3/access.log* >$ERRORS 2>&1
  $SARG -f $CONFIG -d week-1 -o $WEEKLYOUT /var/log/squid3/access.log* >$ERRORS 2>&1
  $SARG -f $CONFIG -d month-1 -o $MONTHLYOUT /var/log/squid3/access.log* >$ERRORS 2>&1

</code>

 

4) generate report manually

 

<code>

/usr/sbin/sarg-reports daily

/usr/sbin/sarg-reports weekly

/usr/sbin/sarg-reports monthly

</code>

 

there are un /var/www/sarg/

 

5) automate report generation with cron

 

edit root crontab and add the following lines :

 

<code>

crontab -e
@daily /usr/sbin/sarg-reports daily
0 01 * * 1 /usr/sbin/sarg-reports weekly
03 01 1 * * /usr/sbin/sarg-reports monthly


service cron restart

</code>

 

6) Logrotate

change logroate to only rotate logs monthly so we keep information for SARG

 

For Squid

<code>

sed -i 's/daily/monthly/' /etc/logrotate.d/squid3

</code>

 

For Dansguardian :

<code>

cat<<EOF>/etc/logrotate.d/dansguardian
/var/log/dansguardian/access.log {
        rotate 12
        monthly
        compress
        delaycompress
        prerotate
                /etc/init.d/dansguardian stop > /dev/null 2>&1 || true
                /usr/sbin/sarg-reports weekly > /dev/null 2>&1 || true
                /usr/sbin/sarg-reports monthly > /dev/null 2>&1 || true
        endscript
        postrotate
                /etc/init.d/dansguardian start > /dev/null 2>&1
        endscript
}

EOF

<code>

Par nitocris - Publié dans : Linux
Ecrire un commentaire - Voir les 0 commentaires
Jeudi 6 septembre 4 06 /09 /Sep 08:04

Using flash cahce with a SSD (/dev/sda) and a hardrive to spedd up access.

I suggest to use SSD drive with SLC memory instead off MLC as using a ssd as a cahce drive is expenisve in read/writa and te SSD as a limit. Intel SSD 313 (http://www.intel.com/content/www/us/en/solid-state-drives/solid-state-drives-313-series.html) are specially done for this.

 

#! flashcache
#

 

usefull documents reference :

 

# https://github.com/facebook/flashcache
# http://www.gerrit-tamboer.net/using-flashcache-to-speed-up-your-io-on-ubuntu-12-04/
# https://github.com/facebook/flashcache/wiki/QuickStart-Recipe-for-Ubuntu-11.10
# https://github.com/facebook/flashcache/blob/master/doc/flashcache-sa-guide.txt
# https://github.com/facebook/flashcache/blob/master/README-DKMS
#

 


# step 1 - Clonning Git Repository

apt-get install git-core

#> mkdir -p ~/Build/ ; cd ~/Build/

#> git clone https://github.com/facebook/flashcache.git
Cloning into 'flashcache'...
remote: Counting objects: 914, done.
remote: Compressing objects: 100% (357/357), done.
remote: Total 914 (delta 631), reused 831 (delta 553)
Receiving objects: 100% (914/914), 252.91 KiB | 199 KiB/s, done.
Resolving deltas: 100% (631/631), done.

# Step 2a - Building

# install building tools

sudo apt-get install git build-essential dkms linux-headers-`uname -r` uuid-dev

cd flashcache
sudo make -f Makefile.dkms all boot_conf

# Step 2b - Installation

sudo make install

cat <<EOF>>/etc/sysctl.conf


###################################################################
# FlashCache
#
# disable writing dirty cache data at shutdown (do this only if you really trust FC)
# dev.flashcache.fast_remove = 1
#
# change the reclaim policy from FIFO to LRU" >>/etc/sysctl.conf
dev.flashcache.reclaim_policy = 1
#
# Writeback
# do not write "stale" data to disk until evicted due to lack of space
#dev.flashcache.fallow_delay = 0
#
EOF

# Step 3 - Init

sudo modprobe flashcache
sudo echo "flashcache" >> /etc/modules

# Verification :

dmesg | tail
....................
[159671.822040] flashcache: flashcache-1.0 initialized

#
lsmod |grep flashcache
flashcache             82901  0

# Step 4 - montage volume simple DATA/Home

# Find the UUID of the volume you want to cache:
ls -la /dev/disk/by-uuid/



#### Home drive
sudo umount /home/yoyo
sudo flashcache_create -v -p back filecache_home /dev/sda2 /dev/disk/by-uuid/c85a514b-0a7d-4c4c-8af6-dcea99ed773c

vi /etc/fstab
# Comment out the line with the device you want to cache
# Add a new line for the flashcache similar this:

# /home/yoyo/ was on /dev/sda5 during installation
# UUID=c85a514b-0a7d-4c4c-8af6-dcea99ed773c /home           reiserfs defaults        0       2
/dev/mapper/filecache_data /home/yoyo     reiserfs defaults        0       2


#Step 5 - check

~# sudo dmsetup status
filecache_data: 0 325122048 flashcache stats:
    reads(2775), writes(37)
    read hits(3), read hit percent(0)
    write hits(11) write hit percent(29)
    dirty write hits(0) dirty write hit percent(0)
    replacement(0), write replacement(0)
    write invalidates(0), read invalidates(0)
    pending enqueues(0), pending inval(0)
    metadata dirties(37), metadata cleans(0)
    metadata batch(3) metadata ssd writes(34)
    cleanings(0) fallow cleanings(0)
    no room(0) front merge(0) back merge(0)
    disk reads(2772), disk writes(0) ssd reads(3) ssd writes(2843)
    uncached reads(0), uncached writes(0), uncached IO requeue(0)
    uncached sequential reads(0), uncached sequential writes(0)
    pid_adds(0), pid_dels(0), pid_drops(0) pid_expiry(0)

~# sudo dmsetup table

filecache_data: 0 325122048 flashcache conf:
    ssd dev (/dev/sda3), disk dev (/dev/disk/by-uuid/45e71c47-a88f-4493-8b1a-e5bfcf7562b0) cache mode(WRITE_BACK)
    capacity(14092M), associativity(512), data block size(4K) metadata block size(4096b)
    skip sequential thresh(0K)
    total blocks(3607552), cached blocks(2132154), cache percent(59)
    dirty blocks(11), dirty percent(0)
    nr_queued(0)
Size Hist: 4096:61231


# Step 6 - startup script to write data on exit

cat <<EOF>/etc/init.d/unflashcache
#! /bin/sh
### BEGIN INIT INFO
# Provides: unflashcache
# Required-Start:
# Required-Stop: 
# Should-Stop:
# Default-Start:
# Default-Stop: 0 6    
# Short-Description: Unload flashcache module and fs.
### END INIT INFO
 
PATH=/sbin:/bin
. /lib/init/vars.sh
 
. /lib/lsb/init-functions
 
do_stop () {
    echo Unload cachedev
    umount /data
    dmsetup remove cachedev
    rmmod flashcache   
}
 
case "$1" in
  start)
    # No-op
    ;;
  restart|reload|force-reload)
    echo "Error: argument '$1' not supported" >&2
    exit 3
    ;;
  stop)
    do_stop
    ;;
  *)
    echo "Usage: $0 start|stop" >&2
    exit 3
    ;;
esac
EOF

chmod 755  /etc/init.d/unflashcache
update-rc.d unflashcache start 39 0 6 .


# ################

# Step 7 - on root drive

sudo vi /etc/fstab
# Comment out the line with the device you want to cache
# Add a new line for the flashcache similar this:
# / was on /dev/sda1 during installation
#UUID=a8da2c39-109c-4be9-b70a-74d5720f30df /               btrfs   defaults,subvol=@ 0       1
/dev/mapper/filecache_root /               btrfs   defaults,subvol=@ 0       1

#Edit your /boot/grub/grub.cfg to change the root device to the flashcache device you intend to use.

- Boot off a live CD like the Ubuntu desktop installer.
- mount the partition with flashcache compiled
mount /dev/disk/by-uuid/c85a514b-0a7d-4c4c-8af6-dcea99ed773c /mnt
cd /mnt/yoyo/Build/flashcache
# install binary
make install
modprobe flashcache
# create root flashcache

flashcache_create -v -p back filecache_root /dev/sda1 /dev/disk/by-uuid/a8da2c39-109c-4be9-b70a-74d5720f30df

#if ok

reboot


######

# Step 8 - if needed
## Removing Flashcache from a Boot Volume

# First, ensure that dev.flashcache.fast_remove = 0 and reboot to minimize potential lost data
# Edit fstab
vi /etc/fstab
# Comment out the flashcache line and un-comment the original device line


# Reboot to recovery mode (hold left shift during boot)
# Mount / using the non-flashcache drive
mount -o relatime /dev/md0 /

# Remove the FC device mapper device
dmsetup remove fc-md

# Remove FC special SSD signature (change /dev/sdb with whatever your FC device is)
flashcache_destroy /dev/sdb

# Done, continue booting normally
exit

 

# remove module

dkms remove -m flashcache -v $(git describe  --always --abbrev=12) --all

Par nitocris - Publié dans : Linux
Ecrire un commentaire - Voir les 0 commentaires
Jeudi 26 avril 4 26 /04 /Avr 08:24

I've installed an openfiler on the KVM with directe access to disk.

 

I use a file to hold the Virtaul machine and I give it a directe acess to disk /dev/hda and /dev/hdb

 

1 - Generate the VM

 

cat <EOF>>/srv/VM/openfiler29.sh
#!/bin/bash

NAME='openfiler29'
DISK='5'
ISO='/srv/VM/ISO/openfileresa-2.99.1-x86_64-disc1.iso'

virt-install \
-n${NAME} \
--description 'OpenFiler 2.99' \
--ram 512 \
--vcpus=1 \
--autostart \
--os-type linux \
--hvm \
--accelerate \
-v \
--network bridge=br0,model=virtio \
--disk path=/srv/VM/OS/lv_${NAME}_os.qcow2,size=${DISK} \
-c ${ISO} \
--vnc --vnclisten=0.0.0.0 --vncport=5901\
-k fr-fr

EOF


we finish by connecting to the VM with vnc on port 5901.
I suggest to add an ssh authentification to do the rest of the configuration remotely (lots of documentation about this on the web)

2 - update the openfiler

Here are some command to do have the last version

conary update conary
conary updateall
conary update openfiler

add some package
conary install patch testdisk

 

3 - correction and modification

 

RAID-1(from : http://www.everything-virtual.com/?p=349)

conary update mdadm=openfiler.rpath.org@rpl:devel/2.6.4-0.2-1
ln -s /sbin/lvm /usr/sbin/lvm

 

Virtual drive in openfiler those show by the use of virtio. We need to had some line in /opt/openfiler/sbin/list-disks.pl

I've done a small patch. you can apply this way :

 

cd /opt/openfiler/sbin/

conary install patch
patch -bR -p1 /opt/openfiler/sbin/list-disks.pl< ./list-disks.pl.patch
chown openfiler.openfiler /opt/openfiler/sbin/list-disks.pl
chmod 755 /opt/openfiler/sbin/list-disks.pl

 

cat list-disks.pl.patch

 

--- list-disks.pl    2012-04-22 14:24:14.000000000 +0200
+++ /opt/openfiler/sbin/list-disks.pl    2009-05-16 19:07:57.000000000 +0200
@@ -188,11 +188,6 @@
             # Promise raid controller
             push(@devs, "/dev/$1");
         }
-        elsif (/\d+\s+\d+\s+\d+\s+vd(\S)\s/ || /\d+\s+\d+\s+\d+\s+vd(\S\D)\s/) {
-             # virtio raid device
-             local $d = $1;
-             push(@devs, "/dev/vd$d");
-         }
     }
    
     close(PARTS);
@@ -329,11 +324,7 @@
                 $disk->{'desc'} = &text('select_device', 'IDE', uc($1));
                 $disk->{'type'} = 'ide';
             }
-            elsif ($disk->{'device'} =~ /\/vd(\S)$/) {
-                # VIRTIO disk
-                $disk->{'desc'} = &text('select_device', 'IDE', uc($1));
-                $disk->{'type'} = 'ide';
-            }   
+           
             elsif ($disk->{'device'} =~ /\/xvd(\S)$/) {
                 # Xen disk
                 $disk->{'desc'} = &text('select_device', 'IDE', uc($1));

 

3 -

 

change the Virtual MAchine definition to allow access to disk directly

 

virsh dumpxml openfiler29 >openfiler29.xml

 

root@HostVm:/srv/VM# cat openfiler29.xml
<domain type='kvm' id='15'>
  <name>openfiler29</name>
  <uuid>e16ff78f-ac6b-f35e-a31d-f8b0a547db5d</uuid>
  <description>OpenFiler 2.99</description>
  <memory>524288</memory>
  <currentMemory>524288</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='x86_64' machine='pc-1.0'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/srv/VM/OS/lv_openfiler29_os.qcow2'/>
      <target dev='hda' bus='ide'/>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0' unit='0'/>
    </disk>
    <disk type='block' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <target dev='hdd' bus='ide'/>
      <readonly/>
      <alias name='ide0-1-0'/>
      <address type='drive' controller='0' bus='1' unit='0'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/dev/sda'/>
      <target dev='hdb' bus='virtio'/>
      <alias name='virtio-disk1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/dev/sdb'/>
      <target dev='hdc' bus='virtio'/>
      <alias name='virtio-disk2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </disk>
    <controller type='ide' index='0'>
      <alias name='ide0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:95:ec:fc'/>
      <source bridge='br0'/>
      <target dev='vnet1'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/4'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/4'>
      <source path='/dev/pts/4'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='5901' autoport='no' listen='0.0.0.0' keymap='fr'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='cirrus' vram='9216' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </memballoon>
  </devices>
  <seclabel type='dynamic' model='apparmor' relabel='yes'>
    <label>libvirt-e16ff78f-ac6b-f35e-a31d-f8b0a547db5d</label>
    <imagelabel>libvirt-e16ff78f-ac6b-f35e-a31d-f8b0a547db5d</imagelabel>
  </seclabel>
</domain>

 

update openfiler29 VM

 

virsh dumpxml openfiler29 >openfiler29.xml

virsh shutdown openfiler29

virsh define openfiler29.xml

virsh start openfiler29

 

 

4 - active directory Integration

Copy and past from an other web site http://www.ozziks.com/2008/12/13/join-openfiler-to-active-directory/

Par nitocris - Publié dans : Linux
Ecrire un commentaire - Voir les 0 commentaires
Samedi 31 mars 6 31 /03 /Mars 07:36

Une installation en 32-bits sur Natty (11.04)

 

sudo apt-get install build-essential
cd ~/temp
https://sites.google.com/a/hunny.be/www/epson-alc1100-filter_1.2-1_i386.deb
wget https://sites.google.com/a/hunny.be/www/epson-alc1100-filter-cups_1.2-1_i386.deb
wget http://fr.archive.ubuntu.com/ubuntu/pool/universe/g/gcc-3.3/libstdc++5_3.3.6-24ubuntu1_i386.deb
sudo dpkg --force-architecture --force-depends -i libstdc++5_3.3.6-24ubuntu1_i386.deb
sudo dpkg --force-architecture --force-depends -i epson-alc1100-filter-cups_1.2-1_i386.deb
sudo dpkg --force-architecture --force-depends -i epson-alc1100-filter_1.2-1_i386.deb

sudo invoke-rc.d cups restart
cd -

 

Une installation en mode 64-bits sur Precise Pangolin (12.04 beta2)

 

sudo apt-get install build-essential
mkdir ~/temp
cd ~/temp

wget https://sites.google.com/a/hunny.be/www/epson-alc1100-filter-cups_1.2-1_i386.deb
sudo dpkg --force-architecture --force-depends -i epson-alc1100-filter_1.2-1_i386.deb
wget http://fr.archive.ubuntu.com/ubuntu/pool/universe/g/gcc-3.3/libstdc++5_3.3.6-24ubuntu1_i386.deb
sudo dpkg -x libstdc++5_3.3.6-24ubuntu1_i386.deb .
sudo cp -a usr/lib/i386-linux-gnu/libstdc++.so.5* /usr/lib32/
sudo dpkg --force-architecture --force-depends -i libstdc++5_3.3.6-24ubuntu1_i386.deb
sudo dpkg --force-architecture --force-depends -i epson-alc1100-filter-cups_1.2-1_i386.deb
sudo dpkg --force-architecture --force-depends -i epson-alc1100-filter_1.2-1_i386.deb

sudo apt-get install -f

sudo invoke-rc.d cups restart

 

Par nitocris - Publié dans : Linux
Ecrire un commentaire - Voir les 0 commentaires
Dimanche 25 mars 7 25 /03 /Mars 11:25

Un check du disque indique une erreur physique :

root@freenas:~# smartctl -l selftest /dev/sdc
smartctl 5.40 2010-03-16 r3077 [i686-pc-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF READ SMART DATA SECTION ===
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Completed: read failure 90% 2675 821561257

On relance le test pour avoir une information recente :

 

root@freenas:/var/lib/ntp# smartctl -t short /dev/sdc
smartctl 5.40 2010-03-16 r3077 [i686-pc-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
Sending command: "Execute SMART Short self-test routine immediately in off-line mode".
Drive command "Execute SMART Short self-test routine immediately in off-line mode" successful.
Testing has begun.
Please wait 2 minutes for test to complete.
Test will complete after Sun Mar 25 11:49:00 2012

Use smartctl -X to abort test

 

Quelques minutes après

 

root@freenas:/var/lib/ntp# smartctl -l selftest /dev/sdc
smartctl 5.40 2010-03-16 r3077 [i686-pc-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF READ SMART DATA SECTION ===
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Completed: read failure 90% 2677 821561257
# 2 Short offline Completed: read failure 90% 2675 821561257

 

 

On verifie si les espace on déjà été réalloués :ici ce n'est pas le cas, les valeurs son à 0

 

root@freenas:~# smartctl -A /dev/sdc |grep Reallocated
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE

5 Reallocated_Sector_Ct 0x0033 252 252 010 Pre-fail Always - 0
196 Reallocated_Event_Count 0x0032 252 252 000 Old_age Always - 0

On Verifie sur quelle partition : ici /dev/sdc5

root@freenas:~# fdisk -lu /dev/sdc

Disque /dev/sdc: 1000.2 Go, 1000204886016 octets
255 têtes, 63 secteurs/piste, 121601 cylindres, total 1953525168 secteurs
Unités = secteurs de 1 * 512 = 512 octets
Taille de secteur (logique / physique) : 512 octets / 512 octets
taille d'E/S (minimale / optimale) : 512 octets / 512 octets
Identifiant de disque : 0x000c9c9b

Périphérique Amorce Début Fin Blocs Id Système
/dev/sdc1 2048 4196351 2097152 82 Linux swap / Solaris
La partition 1 ne se termine pas sur une frontière de cylindre.
/dev/sdc2 30371840 1953523711 961575936 5 Étendue
/dev/sdc3 * 4196352 30371839 13087744 83 Linux
/dev/sdc5 30373888 1953523711 961574912 83 Linux

 

On verifie le type de formatage

 

root@freenas:~# blkid | grep /dev/sdc5
/dev/sdc5: UUID="d970d235-6438-43d9-b6dc-8904c67ca05e" TYPE="reiserfs"

 

On demonte la paritition et on effectue un check "rapide" en lecture

 

root@freenas:~# umount /dev/sdc5
root@freWill read-only check consistency of the filesystem on /dev/sdc5
Will put log info to 'stdout'

Do you want to run this program?[N/Yes] (note need to type Yes if you do):Yes
enas:~# reiserfsck /dev/sdc5
###########
reiserfsck --check started at Sun Mar 25 11:03:39 2012
###########
Replaying journal: Done.
Reiserfs journal '/dev/sdc5' in blocks [18..8211]: 0 transactions replayed
Checking internal tree.. finished
Comparing bitmaps..finished
Checking Semantic tree:
finished
No corruptions found
There are on the filesystem:
Leaves 164119
Internal nodes 987
Directories 190
Other files 1810
Data block pointers 165948281 (70011999 of them are zero)
Safe links 0
###########
reiserfsck finished at Sun Mar 25 11:20:05 2012
###########

 

Reparation

source : http://smartmontools.sourceforge.net/badblockhowto.html

[Step 1] On recupere la taille des secteurs

root@freenas:~# debugreiserfs /dev/sdc5 | grep '^Blocksize'
debugreiserfs 3.6.21 (2009 www.namesys.com)
Blocksize: 4096

[Step 2] On calcul le nombre de secteurs

Le debut de la partition : 30373888

Le secteur en erreur : 821561257

Taille des block : 4096

# echo "(821561257-30373888)*512/4096" | bc -l
98898421.12500000000000000000

On Verifie que cette valeur est plus petite que le nombre de block de la partition (98 898 421<=240 393 728)


root@freenas:~# debugreiserfs /dev/sdc5 | grep "Count of blocks on the device"
debugreiserfs 3.6.21 (2009 www.namesys.com)

Count of blocks on the device: 240393728

[Step 3] On cherche des infos sur ce block

root@freenas:~# debugreiserfs -l 98898421 /dev/sdc5
debugreiserfs 3.6.21 (2009 www.namesys.com)

Filesystem state: consistent

 

Ici il semble qe le block ne soit pas alloué.

 

Alors on fait une recherche autour en mode non destructif :

 

root@freenas:~# badblocks -b 4096 -p 3 -s -v -n /dev/sdc5 `expr 98898421 + 100` `expr 98898421 - 100`
Vérification des blocs défectueux dans un mode non destructif de lecture-écriture
Du bloc 98898321 au bloc 98898521

[Step 4-A] Reallocation

On trouve aucun secteur defectuex, alors on force la ré-alloction : 
root@freenas:/var/lib/ntp# dd if=/dev/zero of=/dev/sdc5 count=1 bs=4096 seek=98898421
1+0 enregistrements lus
1+0 enregistrements écrits
4096 octets (4,1 kB) copiés, 0,000565237 s, 7,2 MB/s


[Step 4-A] Error

root@freenas:~# badblocks -b 4096 -p 3 -s -v -n /dev/sdc5 $((98982613+10)) $((98982613-10))
Vérification des blocs défectueux dans un mode non destructif de lecture-
écriture
Du bloc 98982603 au bloc 98982623
Vérification des blocs défectueux (test non destructif de lecture-écriture)
Test en cours avec un motif aléato989826130% effectué, 0:19 écouléulé
complété
Passe complétée, 1 blocs défectueux repérés.

debugreiserfs -1 98982613 /dev/sdc5
debugreiserfs 3.6.21 (2009 www.namesys.com)

98982613 is used in ondisk bitmap

bread: Cannot read the block (98982613): (Input/output error).

Abandon



Par nitocris - Publié dans : Linux
Ecrire un commentaire - Voir les 0 commentaires
 
Créer un blog gratuit sur over-blog.com - Contact - C.G.U. - Rémunération en droits d'auteur - Signaler un abus - Articles les plus commentés