Drop partitions in asm

Hi
Oracle 11.2.0.2
I have sucessfully dropped the disk partition. However I can still see */dev/xvdc3* in v$asm_disk view. What is the reason for this ?
SQL> col path format a20
SQL> select PATH,NAME,GROUP_NUMBER,DISK_NUMBER from v$asm_disk;
PATH                 NAME                           GROUP_NUMBER DISK_NUMBER
/dev/xvdc3                                                     0           1
/dev/xvdc1           DATA_0000                                 1           0
/dev/xvdc2           DATA_0001                                 1           1
ASMCMD> lsdsk
Path
/dev/xvdc1
/dev/xvdc2

Ora_83 wrote:
SQL> select PATH,NAME,GROUP_NUMBER,DISK_NUMBER,header_status from v$asm_disk;
PATH                 NAME       GROUP_NUMBER DISK_NUMBER HEADER_STATUS
/dev/xvdc3                                 0           1 FORMER
/dev/xvdc1           DATA_0000             1           0 MEMBER
/dev/xvdc2           DATA_0001             1           1 MEMBERWhat do I need to do to get rid of completely?Nothing. It is no longer a member of ASM - that is pretty explicitly stated by the header status of that disk (partition).
I suspect that the disk will be visible via ASM as long as it is seen via the discovery string. What is the value for your ASM instance's disk discovery string?
Also keep in mind that Oracle recommends not using partitioning and assigning partitioned slices as disks to ASM. ASM automatically stripes. There's no I/O performance gains by creating partitions on the same disk and then striping these. In fact, it can cause performance anomalies when another non-partitioned disk is added to such a disk group. ASM would for example struggle to balance hot spots as I/O performance is inconsistent across disk group members..

Similar Messages

  • Problem while dropping partitions

    Hi All,
    I'm using oracle 11g. I have 2 tables A and B. A is the master table and B is the child table. Both the tables are partitioned based on month. Now when i have to drop partition for previous month, i first drop partition from table B then from table A. With table B the partition is getting dropped successfully. But when i try to drop partition for A it gives an error as it is a master table. Table A does not have any data in the partitioned to be dropped that is being referenced by table B. How do i drop the partition for master table.
    Thanks in Advance

    Hi,
    There may be Chance of Have some rows .. just find out the rows existing in the partition of master table with existence of records in Child table that makes it clear clarificaiton...
    - Pavan Kumar N

  • Problem in truncate/drop partitions in a table having nested table columns.

    Hi,
    I have a table that has 2 columns of type nested table. Now in the purge process, when I try to truncate or drop a partition from this table, I get error that I can't do this (because table has nested tables). Can anybody help me telling how I will be able to truncate/drop partition from this table? IF I change column types from nested table to varray type, will it help?
    Also, is there any short method of moving existing data from a nested table column to a varray column (having same fields as nested table)?
    Thanks in advance.

    >
    I have a table that has 2 columns of type nested table. Now in the purge process, when I try to truncate or drop a partition from this table, I get error that I can't do this (because table has nested tables). Can anybody help me telling how I will be able to truncate/drop partition from this table?
    >
    Unfortunately you can't do those operations when a table has a nested table column. No truncate, no drop, no exchange partition at the partition level.
    A nested table column is stored as a separate table and acts like a 'child' table with foreign keys to the 'parent' table. It is these 'foreign keys' that prevent the truncation (just like normal foreign keys prevent truncating partions and must be disabled first) but there is no mechanism to 'disable' them.
    Just one excellent example (there are many others) of why you should NOT use object columns at all.
    >
    IF I change column types from nested table to varray type, will it help?
    >
    Yes but I STRONGLY suggest you take this opportunity to change your data model to a standard relational one and put the 'child' (nested table) data into its own table with a foreign key to the parent. You can create a view on the two tables that can make data appear as if you have a nested table type if you want.
    Assuming that you are going to ignore the above advice just create a new VARRAY type and a table with that type as a column. Remember VARRAYs are defined with a maximum size. So the number of nested table records needs to be within the capacity of the VARRAY type for the data to fit.
    >
    Also, is there any short method of moving existing data from a nested table column to a varray column (having same fields as nested table)?
    >
    Sure - just CAST the nested table to the VARRAY type. Here is code for a VARRAY type and a new table that shows how to do it.
    -- new array type
    CREATE OR REPLACE TYPE ARRAY_T AS VARRAY(10) OF VARCHAR2(64)
    -- new table using new array type - NOTE there is no nested table storage clause - arrays stored inline
    CREATE TABLE partitioned_table_array
         ( ID_ INT,
          arra_col  ARRAY_T )
         PARTITION BY RANGE (ID_)
         ( PARTITION p1 VALUES LESS THAN (40)
         , PARTITION p2 VALUES LESS THAN(80)
         , PARTITION p3 VALUES LESS THAN(100)
    -- insert the data from the original table converting the nested table data to the varray type
    INSERT INTO PARTITIONED_TABLE_ARRAY
    SELECT ID_, CAST(NESTED_COL AS ARRAY_T) FROM PARTITIONED_TABLENaturally since there is no more nested table storage you can truncate or drop partitions in the above table
    alter table partitioned_table_array truncate partition p1
    alter table partitioned_table_array drop partition p1

  • Drop partition without disabling foreign key

    Hi All,
    I have parent and child table.
    Parent table
    create table parent_1
    (id number,
    create_date date,
    constraint parent_1_pk001 PRIMARY KEY (id))
    PARTITION BY RANGE (create_date)
    INTERVAL (NUMTODSINTERVAL(1,'DAY'))
    (PARTITION parent_1_part VALUES LESS THAN ('01-JAN-2010'));
    Child Table
    create table child_1
    (id number,
    create_date date,
    constraint child_1_fk001 FOREIGN KEY (id)
    REFERENCES parent_1 (id))
    PARTITION BY RANGE (create_date)
    INTERVAL (NUMTODSINTERVAL(1,'DAY'))
    (PARTITION create_date_part VALUES LESS THAN ('01-JAN-2010'));
    I am having problems dropping partition.
    Parent_1
    1     26-JUL-12
    2     26-JUL-12
    Child_1
    1     26-JUL-12
    alter table CHILD_1 drop partition SYS_P274;
    table CHILD_1 altered.
    ON DROPPING PARENT PARTITION
    alter table parent_1 drop partition SYS_P273;
    Error report:
    SQL Error: ORA-02266: unique/primary keys in table referenced by enabled foreign keys
    02266. 00000 - "unique/primary keys in table referenced by enabled foreign keys"
    *Cause:    An attempt was made to truncate a table with unique or
    primary keys referenced by foreign keys enabled in another table.
    Other operations not allowed are dropping/truncating a partition of a
    partitioned table or an ALTER TABLE EXCHANGE PARTITION.
    *Action:   Before performing the above operations the table, disable the
    foreign key constraints in other tables. You can see what
    constraints are referencing a table by issuing the following
    command:
    SELECT * FROM USER_CONSTRAINTS WHERE TABLE_NAME = "tabnam";
    PLEASE CAN I KNOW IF THERE IS ANY WAY TO DROP PARENT PARTITION WITHOUT DISABLE/ENABLE FOREIGN CONSTRAINTS
    Thanks

    SQL Error: ORA-02266: unique/primary keys in table referenced by enabled foreign keys
    02266. 00000 - "unique/primary keys in table referenced by enabled foreign keys"
    *Cause: An attempt was made to truncate a table with unique or
    primary keys referenced by foreign keys enabled in another table.
    Other operations not allowed are dropping/truncating a partition of a
    partitioned table or an ALTER TABLE EXCHANGE PARTITION.
    *Action: Before performing the above operations the table, disable the
    foreign key constraints in other tables. You can't do that until you disable the foreign key constraint
    http://jonathanlewis.wordpress.com/2006/12/10/drop-parent-partition/
    Hope this helps
    Mohamed Houri
    www.hourim.wordpress.com

  • Drop partition with missing associate Tablespace

    Hi All,
    Scenario is user accidentally removed datafile using rm command then we dropped that Tablespace using offline drop. we want to drop partition for which TS and datafile both are already offline dropped .
    Thanks.

    >
    I tried to exchange partition with another table having same properties of original table. While doing so it prompted below error,
    ORA-14292: Partitioning type of table must match subpartitioning type of composite partition
    >
    Then most likely the table and partition do NOT have the same properties.
    If you want to exchange a partition of a table that is subpartitioned then the other table has to be partitioned in the same way that the main table is subpartitioned.
    Post the DDL for the main table that shows how it is partitioned/subpartitioned and the DDL for the work table you are trying to use for the exchange.
    See my reply Posted: Jan 7, 2013 7:02 PM in this thread for a solution that uses exchange partition is a similar manner
    Merge tables

  • How to create and drop partitions automatically?

    How to create and drop partitions automatically?
    The environment is Oracle 10g(10.2.0.3) on the RHEL4.0 system.
    I want to partition the MESSAGE table by date (NUMTODSINTERVAL(1,'DAY') ). One partition per day. Because the table is huge, only 2 partitions (today and yesterday's data) are necessary to be kept online. All the partitions that earlier than the previous day will be backed up and then dropped. I want to make the partition creating and dropping jobs run automatically. How to do it?
    Thank you

    junez wrote:
    How to create and drop partitions automatically?
    The environment is Oracle 10g(10.2.0.3) on the RHEL4.0 system.
    I want to partition the MESSAGE table by date (NUMTODSINTERVAL(1,'DAY') ). One partition per day. Because the table is huge, only 2 partitions (today and yesterday's data) are necessary to be kept online. All the partitions that earlier than the previous day will be backed up and then dropped. I want to make the partition creating and dropping jobs run automatically. How to do it?With 11g, new partitions can automatically be created.
    With 10g, you need to do that yourself. I prefer to create a "buffer" of future partitions - in case the job whose task it is to add new partitions gets held up or stuck. Or the job queue is full due to some problem and it does not get the chance to execute in time.
    I dislike your partitioning criteria. I prefer using the date directly and not mangling it to something else. If a specific day has a large volume of data, then another option is to use hourly date ranged partitions. With local partitioned indexes and the date time range used for querying, this can be quite effective performance wise.
    As for partitioning maintenance - I use a custom written partitionManager PL/SQL package that provides an interface for adding daily and hourly partitions to a table. Input parameters are for example name of the table, start date and the number of partitions to add. Similarly it provides interfaces for aging partitions - again by specifying a table and a date-time to use as the starting point, back into time, for removing old partitions.
    I typically call this code from the actual application code itself - so before a new partition will be used for example, the app code will first ensure that it has a partition to use. This is safer than a separate job as the dependency is resolved where and when it is needed - and not done as a separate task.
    For example - you should have a procedure/package that provides an app the means to log a message into your MESSAGE table. As part of an autonomous transaction, this procedure can check if the required partition exists, before attempting to insert a message into the table.
    Where this approach is not possible, a DBMS_JOB can be used to create future partitions - but as I mentioned, rather have it add a bunch of future (empty) partitions in case something goes pear shape with the job mechanism.

  • Ignoring only "Drop Partition" DDLs.

    Hi,
    I am doing a proof of concept to see if we can use Golden Gate to replicate data from our Primary database (Oracle 10g) to a reporting database. The primary is an OLTP database and I intend to use the "IGNOREDELETES" feature so that any purging done to remove historical data (from primary) will not remove anything from the reporting database.
    In case of partitioned tables when I drop a partition to remove older data, can I have Golden Gate not replicate only this DDL (drop partition) command?
    Thank you.

    Hello,
    You disable all of them in order to delete the parent record and correponding child record (remember it wont' let you delete unless you take care of all the dependencies) and it won't let you enable if you missed to delete any child record.
    Regards
    Edited by: OrionNet on Mar 17, 2009 11:32 AM

  • Error on drop partition

    Hello,
    When i execute this command i get this:
    SQL> ALTER TABLE RMPM.GROUPE_AFFAIRES DROP PARTITION PART_71;
    ALTER TABLE RMPM.GROUPE_AFFAIRES DROP PARTITION PART_71
    ERROR at line 1:
    ORA-04045: errors during recompilation/revalidation of RMPM.IDX_GA_LIB
    ORA-29881: failed to validate indextype
    I d'ont know why???
    Thanks
    PS: oracle version is 9.2.0.6.0 on AIX

    Hello,
    When i execute this command i get this:
    SQL> ALTER TABLE RMPM.GROUPE_AFFAIRES DROP PARTITION PART_71;
    ALTER TABLE RMPM.GROUPE_AFFAIRES DROP PARTITION PART_71
    ERROR at line 1:
    ORA-04045: errors during recompilation/revalidation of RMPM.IDX_GA_LIB
    ORA-29881: failed to validate indextype
    I d'ont know why???
    Thanks
    PS: oracle version is 9.2.0.6.0 on AIX

  • GG replication for interval partitioned tables while issuing drop partition command

    Hi all, we have golden gate replication between two databses 1 and 2. table A in 1 and 2 is interval partitioned but the partition names are different. whats the best way to achieve GG replication using drop partition. We want to drop partition automatically in DB 2 if done in DB 1.

    Hi,
    In this scenario ypu would better to drop manually on both the database, especially for drop you could filter based on operation type and do it manually.

  • DROP PARTITION ONLINE

    Hi, @work we're trying to implement this schema: We've got very high transactional tables... with a huge load of INSERTS on them 24/7; so we decide to partition these tables hourly and remove all the indexes from them. Our problem begins when we issue the DROP PARTITION statement. It actually drops the partition but left almost always two ot three sessions frozen from the aplications that load the data. It also locks the tables involved in the procedure. The key here is that que WE CANNOT STOP the populating process because is a business rules restriction. Can this be done this way and how?. One more thing... we also try this process when the tables got GLOBAL INDEXES con them... but issuing a DROP PARTITION UPDATE GLOBAL INDEXES is prohibitive because of the time it takes and the degradation of performance it involves. If we issue the DROP PARTITION alone... the indexes became unusuble and the process loading data stop and fell. I don't know why because we set SKIP_UNUSABLE_INDEXES = TRUE. We though that using flat tables partitioned without indexes would be the solution but we're facing this issue. Thanks for any hint that may come in hand. Regards.
    Robert.

    so we decide to partition these tables hourly and remove all the indexes from them
    One more thing... we also try this process when the tables got GLOBAL INDEXES on
    them... but issuing a DROP PARTITION UPDATE GLOBAL INDEXES is prohibitive
    because of the time it takes and the degradation of performance it involves. If we issue
    the DROP PARTITION alone... the indexes became unusuble and the process loading
    data stop and fell. I don't know why because we set SKIP_UNUSABLE_INDEXES =
    TRUE.The above two are contradictory statements.
    As of now, do you have Global Indexes on the table in question ? (Yes/No)
    Assuming, the answer is "NO". Instead of dropping the partition, try to EXCHANGE the partition with a dummy table and then drop the partition.
    Hope this works out in your case.
    Regards

  • Alter drop partition - hanging

    Hi all,
    I am trying to drop some partitions on several tables in my database. These tables generally have ~50,000 range partitions. When I ran my script to drop ~ 30,000 partitions in our dev db, it took about 2 hours to complete. Now in our production db, I am running a single drop command and its just hanging and hanging. Any ideas how I can dig deeper to find out why the different results? Running Oracle 11.2 on RHEL5.
    Thank you,
    Scott
    alter table events_sup drop partition evt_15apr2012_0600_0615;

    SQL> list
    1* select * from V$session_wait where sid = 709
    SID SEQ#
    EVENT
    P1TEXT P1
    P1RAW
    P2TEXT P2
    P2RAW
    P3TEXT P3
    P3RAW WAIT_CLASS_ID WAIT_CLASS#
    WAIT_CLASS WAIT_TIME
    SECONDS_IN_WAIT STATE WAIT_TIME_MICRO TIME_REMAINING_MICRO
    TIME_SINCE_LAST_WAIT_MICRO
    709 12892
    db file sequential read
    file# 2699
    0000000000000A8B
    block# 1050130
    0000000000100612
    blocks 1
    0000000000000001 1740759767 8
    User I/O 0
    0 WAITING 8607 -1
    0

  • Drop partitions in HASH partitioned table

    SELECT * FROM product_component_version
    NLSRTL      10.2.0.4.0     Production
    Oracle Database 10g Enterprise Edition      10.2.0.4.0     64bi
    PL/SQL      10.2.0.4.0     Production
    TNS for Solaris:      10.2.0.4.0     ProductionI have a table which is partitioned by HASH into several partitions. I would like to remove them all the same way I can DROP partitions in a LIST or RANGE partitioned tables.
    I COALESCE-d my table until it remained with only one partition. Now I've got a table with one HASH partition and I would like to remove it and to end up with unpartitioned table.
    How could it be accomplished?
    Thank you!

    Verdi wrote:
    I have a table which is partitioned by HASH into several partitions. I would like to remove them all the same way I can DROP partitions in a LIST or RANGE partitioned tables.
    I COALESCE-d my table until it remained with only one partition. Now I've got a table with one HASH partition and I would like to remove it and to end up with unpartitioned table.
    How could it be accomplished?
    You cannot turn a partitioned table into a non-partitioned table, but you could create a replacement table (including indexes etc.) and then use the 'exchange partition' option on the partitioned table. This will modify the data dictionary so the data segments for the partition exchange names with the data segments for the new table - which gives you a simple table, holding the data, in minimum time and with (virtually) no undo and redo.
    The drawback to this method is that you have to sort out all the dependencies and privileges.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    Author: <b><em>Oracle Core</em></b>

  • Drop Partition update Global Indexes

    hello Gurus,
    what will happen internally when issue a command
    alter table tab_name drop partition part_name update global indexes;
    why my insert statement waiting to complete this task on " cursor: pin S wait on X "
    thanks in advance ..

    Several times i also noticed that wait event for some jobs on 10 2 0 4 on hpux.
    I didn't found out what was the reason.
    It seems this wait event can be easly related to some bugs.
    http://karenmorton.blogspot.com/2008/08/strange-parsing-behavior.html
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/waitevents003.htm#sthref3012

  • Drop partition from procedure

    Hi,
    Why I can't drop partiton from procedure? How can I do it?
    SQL> alter table ama add partition p1 values ('1')
    2 /
    Table altered.
    SQL>
    SQL> create procedure partition_drop (partition_name varchar) is
    2 begin
    3      execute immediate 'alter table ama drop partition p'||partition_name||')';
    4 end;
    5 /
    Procedure created.
    SQL>
    SQL> call partition_drop('1')
    2 /
    call partition_drop('1')
    ERROR at line 1:
    ORA-14048: a partition maintenance operation may not be combined with other operations
    ORA-06512: at "AMA.PARTITION_DROP", line 3
    SQL>
    SQL> alter table ama drop partition p1
    2 /
    Table altered.

    Hi,
    I have tried this and its working..
    Create Table Part_Test(a number(2), b varchar2(30))
    Partition by range (a)
    (Partition part1 values less than (10) tablespace users,
    Partition part2 values less than (20) tablespace users ,
    Partition part3 values less than (30))
    Begin
    Execute Immediate 'Alter table part_test add partition part5 values less than (MAXVALUE)';
    Execute Immediate 'Alter Table part_test drop partition part1';
    end;
    Thanks....

  • MD randomly dropping partition from array

    Hello, folks! I am having some trouble with MD randomly removing a partition from one of my RAID-1 arrays. So far this has happened three times over the past couple weeks, but it only happens on boot.
    I have two 3TB WD SATA hard disks containing two RAID-1 volumes set up as follows:
    /dev/sda1 FAT32 EFI System Partition (250MiB)
    /dev/sdb1 Reserved Space (250MiB)
    /dev/sda2 Disk 0 of /dev/md0 with v0.90 metadata (250MiB)
    /dev/sdb2 Disk 1 of /dev/md0 with v0.90 metadata (250MiB)
    /dev/sda3 swap partition 0 encrypted with dm-crypt mapped to /dev/mapper/swapA (8GiB)
    /dev/sdb3 swap partition 1 encrypted with dm-crypt mapped to /dev/mapper/swapB (8GiB)
    /dev/sda4 Disk 0 of /dev/md1 with v1.2 metadata (2750GiB)
    /dev/sdb4 Disk 1 of /dev/md1 with v1.2 metadata (2750GiB)
    /dev/md1 is encrypted with LUKS and mapped to /dev/mapper/root
    /dev/mapper/root is the only volume in the LVM volume group rootvg
    the volume group rootvg currently has three logical volumes
    logical volume root is mapped to /dev/mapper/rootvg-root and is the file system root
    logical volume home is mapped to /dev/mapper/rootvg-home and is mounted /home
    logical volume var is mapped to /dev/mapper/rootvg-var and is mounted /var
    I also wrote this initcpio hook (I call it 'secdec'), with a bit of help from the Arch Wiki, which decrypts /dev/mapper/root, optionally with a openssl encrypted key file on a USB memory stick:
    run_hook ()
    local keyCopyDec keyCopyEnc keyMountPoint maxTries retryDelay \
    shutdownOnFail
    # customizable ############################################################
    keyCopyDec="/crypto_keyfile.bin" # temp storage for decrypted key data
    keyCopyEnc="/crypto_keyfile.enc" # temp storage for encrypted key data
    keyMountPoint="/ckey" # key storage device mount point
    maxTries=3 # max number of decrypt attempts
    retryDelay=2 # delay in seconds between retries
    shutdownOnFail=0 # shut down computer if decrypt fails
    #+0=yes, 1=no
    # /customizable ###########################################################
    local abortMsg passPromptKey passPromptVol passWrong secdecFormat \
    shutdownMsg
    local E_NOFILE
    local KEY NOKEY SSLKEY
    local CSQUIET OIFS
    local cryptDev cryptName keyDev keyFile keyFs keyType pass passPrompt \
    success tries
    abortMsg="Aborting..."
    passPromptKey="Key passphrase: "
    passPromptVol="LUKS passphrase: "
    passWrong="Invalid passphrase."
    secdecFormat="secdec=cryptdev:dmname:keydev:keyfs:keyfile"
    shutdownMsg="Shutting down computer. You may try again later."
    E_NOFILE=66
    KEY=1
    NOKEY=0
    SSLKEY=2
    OIFS=$IFS
    [ "$(echo "${quiet}" | awk '{print tolower($0)}')" == "y" ] && \
    CSQUIET=">/dev/null 2>&1"
    askForBooleanInput ()
    # Ask the user for boolean input.
    # $1: The question to pose.
    # $2: A string containing single characters, separated by spaces, which are
    #+keys pressed that would return boolean true (0).
    # $3: A string containing single characters, separated by spaces, which are
    #+keys pressed that would return a boolean false (1).
    # Returns 0 if the user presses a key that generates a character found in
    #+$2.
    # Returns 1 if the user presses a key that generates a character found in
    #+$3.
    # Returns 2 if an incorrect number of parameters was provided.
    local keyin
    [ ${#} -ne 3 ] && return 2
    echo -n "$1"
    while true; do
    read -sn1 keyin
    case "$keyin" in
    [$2]) echo "$keyin"; keyin=0; break;;
    [$3]) echo "$keyin"; keyin=1; break;;
    *) echo -n -e "\a";;
    esac
    done
    return $keyin
    askForPass ()
    # Ask the user to enter a pass{word|phrase}.
    # $1: The prompt to display.
    # $2: The name of the variable to assign the input pass{word|phrase} to.
    #+For example, to assign to $pass, $2 should be "pass".
    # Returns 0 on success or 1 if there is a parameter error.
    [ ${#} -ne 2 ] || [ -z "${1}" ] || [ -z "${2}" ] && return 1
    read -rsp "$1" "$2"
    echo
    isSsl ()
    # Examine a file for indications that it is SSL encrypted.
    # $1: Path to the key file to examine.
    # Returns 0 if the file appears to be SSL encrypted, 1 if the file does not
    #+appear to be SSL encrypted and $E_NOFILE if $1 is not a regular file.
    [ ! -f "${1}" ] && return $E_NOFILE
    [ "$(dd if="${1}" bs=1 count=8 2>/dev/null | \
    awk '{print tolower($0)}')" == "salted__" ]
    getKey ()
    # Attempt to find and copy a key from $keyDev to $keyCopyEnc.
    # $1: Path to the device containing the key data.
    # $2: Name of file system containing the key file.
    # $3: Path to the key file, relative to $4.
    # $4: Mount point of partition containing key file.
    # $5: Path to temporary copy of key file.
    # $6: Boolean value indicating whether to allow user the opportunity to
    #+switch key devices before attempting to find a key. This is useful if
    #+a key has already been tried and failed. The user could switch memory
    #+devices before trying again. 0=true, 1=false; default is false.
    # Returns one of $KEY, $NOKEY or $SSLKEY depending on what was found.
    local result wait
    if [ -z "${6}" ] || [ ${6} -eq 1 ]; then wait=1; else wait=0; fi
    mkdir -p "$4" >/dev/null 2>&1
    while true; do
    if [ ${wait} -eq 0 ]; then
    askForBooleanInput \
    "(S)earch for key or (R)evert to LUKS passphrase? " "s S" "r R"
    if [ ${?} -eq 0 ]; then result=$KEY; else result=$NOKEY; fi
    wait=1
    else
    result=$KEY
    fi
    if [ ${result} -eq ${KEY} ]; then
    if poll_device "${1}" ${rootdelay}; then
    mount -r -t "$2" "$1" "$4" >/dev/null 2>&1
    dd if="$4/$3" of="$5" >/dev/null 2>&1
    umount "$4" >/dev/null 2>&1
    if [ -f "${5}" ]; then
    isSsl "${5}" && result=$SSLKEY
    else
    err "Key $3 not found."
    unset result
    wait=0
    fi
    else
    err "Key device $1 not found."
    unset result
    wait=0
    fi
    fi
    [ -n "${result}" ] && break
    done
    return $result
    # If the secdec kernel parameter was not specified, inform the user, but
    #+allow init to continue in case another hook will work.
    if [ -z "${secdec}" ]; then
    echo "Missing parameter: $secdecFormat"
    return 0
    fi
    # Make sure required kernel modules are available.
    if ! /sbin/modprobe -a -q dm-crypt >/dev/null 2>&1 || \
    [ ! -e "/sys/class/misc/device-mapper" ]; then
    err "Required kernel modules not available."
    err "$abortMsg"
    exit 1
    fi
    if [ ! -e "/dev/mapper/control" ]; then
    mkdir -p "/dev/mapper" >/dev/null 2>&1
    mknod "/dev/mapper/control" c \
    $(cat /sys/class/misc/device-mapper/dev | sed 's|:| |') >/dev/null 2>&1
    fi
    # Parse the secdec kernel parameter, check it's format, make sure $cryptDev
    #+is available, and that it contains a LUKS volume.
    IFS=:
    read cryptDev cryptName keyDev keyFs keyFile <<EOF
    $secdec
    EOF
    IFS=$OIFS
    if [ $(echo "${secdec}" | awk -F: '{print NF}') -ne 5 ] || \
    [ -z "${cryptDev}" ] || [ -z "${cryptName}" ]; then
    err "Verify parameter format: $secdecFormat"
    err "$abortMsg"
    exit 1
    fi
    if ! poll_device "${cryptDev}" ${rootdelay}; then
    err "Device $cryptDev not available."
    err "$abortMsg"
    exit 1
    fi
    # Inform the user that $cryptDev doesn't contain a LUKS volume, but allow
    #+init to continue, in case another hook can handle this.
    if ! /sbin/cryptsetup isLuks "${cryptDev}" >/dev/null 2>&1; then
    echo "Device $cryptDev does not contain a LUKS volume."
    return 0
    fi
    # Attempt to open the LUKS volume.
    tries=0
    unset keyType
    while true; do
    success=1
    # Attempt to copy a decryption key.
    if [ -z ${keyType} ]; then
    getKey "$keyDev" "$keyFs" "$keyFile" "$keyMountPoint" \
    "$keyCopyEnc" 1
    keyType=$?
    elif [ ${keyType} -eq ${KEY} ]; then
    getKey "$keyDev" "$keyFs" "$keyFile" "$keyMountPoint" \
    "$keyCopyEnc" 0
    keyType=$?
    elif [ ${keyType} -eq ${SSLKEY} ]; then
    if askForBooleanInput "(U)se a different key or (T)ry again? " \
    "u U" "t T"; then
    getKey "$keyDev" "$keyFs" "$keyFile" "$keyMountPoint" \
    "$keyCopyEnc" 0
    keyType=$?
    fi
    fi
    # Open the LUKS volume.
    if [ ${keyType} -eq ${NOKEY} ]; then
    askForPass "$passPromptVol" "pass"
    /sbin/cryptsetup luksOpen "$cryptDev" "$cryptName" "$CSQUIET" <<EOF
    $pass
    EOF
    success=$?
    [ ${success} -ne 0 ] && err "$passWrong"
    else
    if [ ${keyType} -eq ${SSLKEY} ]; then
    askForPass "$passPromptKey" "pass"
    /sbin/openssl aes256 -pass pass:"$pass" -d -in "$keyCopyEnc" \
    -out "$keyCopyDec" >/dev/null 2>&1
    if [ ${?} -ne 0 ]; then
    rm -f "$keyCopyDec" >/dev/null 2>&1
    err "$passWrong"
    fi
    else
    mv "$keyCopyEnc" "$keyCopyDec" >/dev/null 2>&1
    fi
    if [ -f "${keyCopyDec}" ]; then
    /sbin/cryptsetup --key-file "$keyCopyDec" \
    luksOpen "$cryptDev" "$cryptName" "$CSQUIET"
    success=$?
    fi
    fi
    [ ${success} -ne 0 ] && err "Failed to open LUKS volume."
    tries=$(( $tries + 1 ))
    [ ${tries} -ge ${maxTries} ] || [ ${success} -eq 0 ] && break
    sleep "$retryDelay"
    done
    if [ ${success} -eq 0 ]; then
    if [ ! -e "/dev/mapper/${cryptName}" ]; then
    err "LUKS volume was opened, but failed to map to $cryptName."
    err "$abortMsg"
    exit 1
    fi
    echo "LUKS volume opened."
    else
    if [ ${shutdownOnFail} -eq 0 ]; then
    echo "shutdownMsg"
    poweroff -f
    fi
    exit 1
    fi
    The failing array is /dev/md1 and mdadm is reporting the following:
    mdadm --detail /dev/md1
    /dev/md1:
    Version : 1.2
    Creation Time : Wed May 30 18:50:05 2012
    Raid Level : raid1
    Array Size : 2921467179 (2786.13 GiB 2991.58 GB)
    Used Dev Size : 2921467179 (2786.13 GiB 2991.58 GB)
    Raid Devices : 2
    Total Devices : 1
    Persistence : Superblock is persistent
    Update Time : Wed Sep 12 03:34:52 2012
    State : clean, degraded
    Active Devices : 1
    Working Devices : 1
    Failed Devices : 0
    Spare Devices : 0
    Name : archiso:1
    UUID : 8ad37e84:f7261906:da3d317e:24080362
    Events : 44661
    Number Major Minor RaidDevice State
    0 8 4 0 active sync /dev/sda4
    1 0 0 1 removed
    mdadm --examine /dev/sda4
    /dev/sda4:
    Magic : a92b4efc
    Version : 1.2
    Feature Map : 0x0
    Array UUID : 8ad37e84:f7261906:da3d317e:24080362
    Name : archiso:1
    Creation Time : Wed May 30 18:50:05 2012
    Raid Level : raid1
    Raid Devices : 2
    Avail Dev Size : 5842934631 (2786.13 GiB 2991.58 GB)
    Array Size : 2921467179 (2786.13 GiB 2991.58 GB)
    Used Dev Size : 5842934358 (2786.13 GiB 2991.58 GB)
    Data Offset : 2048 sectors
    Super Offset : 8 sectors
    State : clean
    Device UUID : abba1dc3:3fadf7a7:be452bb5:b8bbe97b
    Update Time : Wed Sep 12 03:37:48 2012
    Checksum : aad3e44b - correct
    Events : 44729
    Device Role : Active device 0
    Array State : A. ('A' == active, '.' == missing)
    mdadm --examine /dev/sdb4/dev/sdb4:
    Magic : a92b4efc
    Version : 1.2
    Feature Map : 0x0
    Array UUID : 8ad37e84:f7261906:da3d317e:24080362
    Name : archiso:1
    Creation Time : Wed May 30 18:50:05 2012
    Raid Level : raid1
    Raid Devices : 2
    Avail Dev Size : 5842934631 (2786.13 GiB 2991.58 GB)
    Array Size : 2921467179 (2786.13 GiB 2991.58 GB)
    Used Dev Size : 5842934358 (2786.13 GiB 2991.58 GB)
    Data Offset : 2048 sectors
    Super Offset : 8 sectors
    State : clean
    Device UUID : 09a09f49:b329feaa:3341111b:47b484fe
    Update Time : Wed Sep 12 01:50:34 2012
    Checksum : 1cdc19c0 - correct
    Events : 42869
    Device Role : Active device 1
    Array State : AA ('A' == active, '.' == missing)
    cat /proc/mdstat
    Personalities : [raid1]
    md0 : active raid1 sda2[0] sdb2[1]
    204736 blocks [2/2] [UU]
    md1 : active raid1 sda4[0]
    2921467179 blocks super 1.2 [2/1] [U_]
    unused devices: <none>
    This is md log info of the first reboot after my first recovery:
    Sep 9 20:18:03 localhost kernel: [ 1.784225] md: raid1 personality registered for level 1
    Sep 9 20:18:03 localhost kernel: [ 2.552971] md: md1 stopped.
    Sep 9 20:18:03 localhost kernel: [ 2.553418] md: bind<sdb4>
    Sep 9 20:18:03 localhost kernel: [ 2.553574] md: bind<sda4>
    Sep 9 20:18:03 localhost kernel: [ 2.554080] md/raid1:md1: active with 2 out of 2 mirrors
    Sep 9 20:18:03 localhost kernel: [ 2.554093] md1: detected capacity change from 0 to 2991582391296
    Sep 9 20:18:03 localhost kernel: [ 2.566266] md1: unknown partition table
    Sep 9 20:18:03 localhost kernel: [ 2.617922] md: md0 stopped.
    Sep 9 20:18:03 localhost kernel: [ 2.618382] md: bind<sdb2>
    Sep 9 20:18:03 localhost kernel: [ 2.618525] md: bind<sda2>
    Sep 9 20:18:03 localhost kernel: [ 2.619175] md/raid1:md0: active with 2 out of 2 mirrors
    Sep 9 20:18:03 localhost kernel: [ 2.619203] md0: detected capacity change from 0 to 209649664
    Sep 9 20:18:03 localhost kernel: [ 10.933334] md0: unknown partition table
    And this is the next time I rebooted:
    Sep 10 19:59:07 localhost kernel: [ 1.780481] md: raid1 personality registered for level 1
    Sep 10 19:59:07 localhost kernel: [ 2.806037] md: md1 stopped.
    Sep 10 19:59:07 localhost kernel: [ 2.806345] md: bind<sda4>
    Sep 10 19:59:07 localhost kernel: [ 2.806888] md/raid1:md1: active with 1 out of 2 mirrors
    Sep 10 19:59:07 localhost kernel: [ 2.806898] md1: detected capacity change from 0 to 2991582391296
    Sep 10 19:59:07 localhost kernel: [ 2.820308] md1: unknown partition table
    Sep 10 19:59:07 localhost kernel: [ 2.956599] md: md0 stopped.
    Sep 10 19:59:07 localhost kernel: [ 2.957149] md: bind<sdb2>
    Sep 10 19:59:07 localhost kernel: [ 2.957269] md: bind<sda2>
    Sep 10 19:59:07 localhost kernel: [ 2.958086] md/raid1:md0: active with 2 out of 2 mirrors
    Sep 10 19:59:07 localhost kernel: [ 2.958100] md0: detected capacity change from 0 to 209649664
    Sep 10 19:59:07 localhost kernel: [ 11.742281] md0: unknown partition table
    In between these two boots there are no reports of md failures. For some reason, its just dropping the second partition.
    I just did a restoration earlier today and on the very next boot, md refuses to use /dev/sdb4. Once I booted, I checked update times (not the ones listed) and /dev/sda4 and /dev/sdb4 were about 4 minutes apart. Since it takes only about a minute for Arch to reboot, including me typing my openssl key password, Arch was running for about 3 minutes without updating. I'm assuming this is of some significance since /dev/md0 reports perfect synchronization.
    All of this has been working very well for me for about 6 months now. Both hard drives, which I bought at the same time, are about 9 months old. I checked both drives using smartctl, and both report SMART enabled and passed. SMART attribute data doesn't make a lot of sense to me and I haven't looked up the format, but the reallocation event value is the same as the day I bought the drives, so I'm kind of assuming things are ok there, or at least bad sectors aren't being created.
    I hope I've provided all required details here. Any help would be appreciated.
    Last edited by cng1024 (2012-09-13 00:02:43)

    It would seem that nobody has any ideas about why this may be happening. I've done a complete diagnostic of both hard disks and both passed. I then downloaded the latest iso, formatted and reinstalled, but that failed after one reboot.
    I have a theory as to why it may be happening, but I haven't tested it yet. Perhaps someone can tell me if I may be on the right track here. I got to wondering what happens during shutdown. The root fs remounts ro during shutdown, but it does remain mounted which means everything under that, my logical volumes, LUKS and RAID are all still open when the system halts. I saved my original configs before I reformatted and it turns out I forgot to add the shutdown hook to the initcpio image which means my RAID wasn't being stopped before halt.
    I'm going to try a few experiments to see if adding the shutdown hook makes a difference. Hopefully I'm right, and I'll update either way, but I'd still appreciate it if someone with a bit more experience could weigh in on this.

Maybe you are looking for

  • Extended desktop not working, but mirror image does

    I am using two identical HP monitors.  I have a Y adapter to connect the monitors.  Which I'm guessing means the computer is only seeing one display since there is only one display output on the back. Can anyone tell me how to get my graphics card to

  • PO changes to be sent as XML format

    Hello SRM gurus, I need to send newly created or changed PO's to a legacy system. I am using SRM 7.0 and there is no IDOC type for a PO. I have done some research and the way to go as recommended is using XML. I am using PI. I am not familiar with us

  • Submit PDF data to servlet

    Hiii I am new to LiveCycle Desiger suite. I have created a form using live cycle .When user fill the form , i want this info to pass servlet End users are using Adobe reader 8 and above. Can it possible?? How to submit this pdf data to servlet?? Plz

  • EBC Discussion

    In a particular configuration, there are two applets in a view. The top applet is based on Siebel BC (Acccount) and the below applet is a list applet based on EBC. The user navigates to this view as follows: 1. Search for a particular Account 2. Dril

  • Buying a new computer with Snow Leopard    Thoughts/Advice/ Recommendations

    Hey all, right now I'm on my old 2003 G4 1.07GHz white 12" iBook, 256 MB, using Safari 3.0.4 I am SERIOUSLY thinking about purchasing a new computer, and am thinking a brand new white Mac 13" I Book with: 2.13GHz / 250GB Serial ATA HardDrive 4GB 800M