Aici veti gasi detalii tehnice despre cum se pot realiza configurari software+ hardware.
Here you can find tehnical details about software/hardware configuration.

sâmbătă, 1 aprilie 2023

Manage RAID with mdadmin

 

 

Introduction

RAID arrays provide increased performance and redundancy by combining individual disks into virtual storage devices in specific configurations. In Linux, the mdadm utility makes it easy to create and manage software RAID arrays.

In a previous guide, we covered how to create RAID arrays with mdadm on Ubuntu 16.04. In this guide, we will demonstrate how to manage RAID arrays on an Ubuntu 16.04 server. Managing RAID arrays is quite straight forward in most cases.

Info: Due to the inefficiency of RAID setups on virtual private servers, we don’t recommend deploying a RAID setup on DigitalOcean droplets. The efficiency of datacenter disk replication makes the benefits of a RAID negligible, relative to a setup on baremetal hardware. This tutorial aims to be a reference for a conventional RAID setup.

Prerequisites

To complete this guide, you will need access to a non-root sudo user. You can follow our Ubuntu 16.04 initial server setup guide to set up an appropriate user.

As mentioned above, this guide will cover RAID array management. Follow our guide on how to create RAID arrays with mdadm on Ubuntu 16.04 to create one or more arrays before starting on this guide. This guide will assume that you have one or more arrays to operate on.

Querying for Information about RAID Devices

One of the most essential requirements for proper management is the ability to find information about the structure, component devices, and current state of the array.

To get detailed information about a RAID device, pass the RAID device with the -D or --detail option to mdadm:

  1. sudo mdadm -D /dev/md0

The important information about the array will be displayed:

Output
/dev/md0: Version : 1.2 Creation Time : Mon Aug 8 21:19:06 2016 Raid Level : raid10 Array Size : 209584128 (199.88 GiB 214.61 GB) Used Dev Size : 104792064 (99.94 GiB 107.31 GB) Raid Devices : 4 Total Devices : 4 Persistence : Superblock is persistent Update Time : Mon Aug 8 21:36:36 2016 State : active Active Devices : 4 Working Devices : 4 Failed Devices : 0 Spare Devices : 0 Layout : near=2 Chunk Size : 512K Name : mdadmwrite:0 (local to host mdadmwrite) UUID : 0dc2e687:1dfe70ac:d440b2ac:5828d61d Events : 18 Number Major Minor RaidDevice State 0 8 0 0 active sync set-A /dev/sda 1 8 16 1 active sync set-B /dev/sdb 2 8 32 2 active sync set-A /dev/sdc 3 8 48 3 active sync set-B /dev/sdd

From this view you can see the RAID level, the array size, the health of the individual pieces, the UUID of the array, and the component devices and their roles. The information provided in this view is all fairly well labeled.

To get the shortened details for an array, appropriate for adding to the /dev/mdadm/mdadm.conf file, you can pass in the --brief or -b flags with the detail view:

  1. sudo mdadm -Db /dev/md0
Output
ARRAY /dev/md0 metadata=1.2 name=mdadmwrite:0 UUID=0dc2e687:1dfe70ac:d440b2ac:5828d61d

To get a quick human-readable summary of a RAID device, use the -Q option to query it:

  1. sudo mdadm -Q /dev/md0
Output
/dev/md0: 199.88GiB raid10 4 devices, 0 spares. Use mdadm --detail for more detail.

This can be used to find the key info about a RAID device at a glance.

Getting Information about Component Devices

You can also use mdadm to query individual component devices.

The -Q option, when used with a component device, will tell you the array it is a part of and its role:

  1. sudo mdadm -Q /dev/sdc
Output
/dev/sdc: is not an md array /dev/sdc: device 2 in 4 device active raid10 /dev/md0. Use mdadm --examine for more detail.

You can get more detailed information by using the -E or --examine options:

  1. sudo mdadm -E /dev/sdc
Output
/dev/sdc: Magic : a92b4efc Version : 1.2 Feature Map : 0x0 Array UUID : 0dc2e687:1dfe70ac:d440b2ac:5828d61d Name : mdadmwrite:0 (local to host mdadmwrite) Creation Time : Mon Aug 8 21:19:06 2016 Raid Level : raid10 Raid Devices : 4 Avail Dev Size : 209584128 (99.94 GiB 107.31 GB) Array Size : 209584128 (199.88 GiB 214.61 GB) Data Offset : 131072 sectors Super Offset : 8 sectors Unused Space : before=130984 sectors, after=0 sectors State : active Device UUID : b0676ef0:73046e93:9d9c7bde:c80352bb Update Time : Mon Aug 8 21:36:36 2016 Bad Block Log : 512 entries available at offset 72 sectors Checksum : 8be1be96 - correct Events : 18 Layout : near=2 Chunk Size : 512K Device Role : Active device 2 Array State : AAAA ('A' == active, '.' == missing, 'R' == replacing)

This information is similar to that displayed when using the -D option with the array device, but focused on the component device’s relationship to the array.

Reading the /proc/mdstat Information

To get detailed information about each of the assembled arrays on your server, check the /proc/mdstat file. This is often the best way to find the current status of the active arrays on your system:

  1. cat /proc/mdstat
Output
Personalities : [raid6] [raid5] [raid4] [linear] [multipath] [raid0] [raid1] [raid10] md0 : active raid10 sdd[3] sdc[2] sdb[1] sda[0] 209584128 blocks super 1.2 512K chunks 2 near-copies [4/4] [UUUU] unused devices: <none>

The output here is quite dense, providing a lot of information in a small amount of space.

/proc/mdstat
Personalities : [raid6] [raid5] [raid4] [linear] [multipath] [raid0] [raid1] [raid10] 
. . .

The Personalities line describes the different RAID levels and configurations that the kernel currently supports.

The line beginning with md0 describes the beginning of a RAID device description. The indented line(s) that follow are also describe this device.

/proc/mdstat
. . .
md0 : active raid10 sdd[3] sdc[2] sdb[1] sda[0]
. . .

The first line state that the array is active (not faulty) and configured as RAID 10. Afterwards, the component devices that were used to build the array are listed. The numbers in the brackets describe the current “role” of the device in the array (this affects which copies of data the device is given).

/proc/mdstat
. . .
      209584128 blocks super 1.2 512K chunks 2 near-copies [4/4] [UUUU]
. . .

The second line displayed in this example gives the number of blocks the virtual devices provides, the metadata version (1.2 in this example), and the chunk size of the array. Since this is a RAID 10 array, it also includes information about the layout of the array (this example has been configured to store two copies of each chunk of data in the “near” layout).

The last items in square brackets both represent currently available devices out of a healthy set. The first number in the numeric brackets indicates the size of a healthy array while the second number represents the currently available number of devices. The other brackets are a visual indication of the array health, with “U” representing healthy devices and “_” representing faulty devices.

If your array is currently assembling or recovering, you might have another line that shows the progress. It would look something like this:

/proc/mdstat
. . .
      [>....................]  resync =  0.9% (2032768/209584128) finish=15.3min speed=225863K/sec
. . .

This this describes the operation currently being applied and the current progress in a number of different ways. It also provides the current speed and an estimated time until completion.

After you have a good idea of what arrays are currently running on your system, there are a number of actions you can take.

Stopping an Array

To stop an array, the first step is to unmount it.

Step outside of the mounted directory and unmount it by typing:

  1. cd ~
  2. sudo umount /mnt/md0

You can stop all active arrays by typing:

  1. sudo mdadm --stop --scan

If you want to stop a specific array, pass it to the mdadm --stop command:

  1. sudo mdadm --stop /dev/md0

This will stop the array. You will have to reassemble the array to access it again.

Starting an Array

To start all arrays defined in the configuration files or /proc/mdstat, type:

  1. sudo mdadm --assemble --scan

To start a specific array, you can pass it in as an argument to mdadm --assemble:

  1. sudo mdadm --assemble /dev/md0

This works if the array is defined in the configuration file.

If the correct definition for the array is missing from the configuration file, the array can still be started by passing in the component devices:

  1. sudo mdadm --assemble /dev/md0 /dev/sda /dev/sdb /dev/sdc /dev/sdd

Once the array is assembled, it can be mounted as usual:

  1. sudo mount /dev/md0 /mnt/md0

The array should now be accessible at the mount point.

Adding a Spare Device to an Array

Spare devices can be added to any arrays that offer redundancy (such as RAID 1, 5, 6, or 10). The spare will not be actively used by the array unless an active device fails. When this happens, the array will resync the data to the spare drive to repair the array to full health. Spares cannot be added to non-redundant arrays (RAID 0) because the array will not survive the failure of a drive.

To add a spare, simply pass in the array and the new device to the mdadm --add command:

  1. sudo mdadm /dev/md0 --add /dev/sde

If the array is not in a degraded state, the new device will be added as a spare. If the device is currently degraded, the resync operation will immediately begin using the spare to replace the faulty drive.

After you add a spare, update the configuration file to reflect your new device orientation:

  1. sudo nano /etc/mdadm/mdadm.conf

Remove or comment out the current line that corresponds to your array definition:

/etc/mdadm/mdadm.conf
. . .
# ARRAY /dev/md0 metadata=1.2 name=mdadmwrite:0 UUID=d81c843b:4d96d9fc:5f3f499c:6ee99294

Afterwards, append your current configuration:

  1. sudo mdadm --detail --brief /dev/md0 | sudo tee -a /etc/mdadm/mdadm.conf

The new information will be used by the mdadm utility to assemble the array.

Increasing the Number of Active Devices in an Array

It is possible to grow an array by increasing the number of active devices within the assembly. The exact procedure depends slightly on the RAID level you are using.

With RAID 1 or 10

Begin by adding the new device as a spare, just as demonstrated in the last section:

  1. sudo mdadm /dev/md0 --add /dev/sde

Find out the current number of RAID devices in the array:

  1. sudo mdadm --detail /dev/md0
Output
/dev/md0: Version : 1.2 Creation Time : Wed Aug 10 15:29:26 2016 Raid Level : raid1 Array Size : 104792064 (99.94 GiB 107.31 GB) Used Dev Size : 104792064 (99.94 GiB 107.31 GB) Raid Devices : 2 Total Devices : 3 Persistence : Superblock is persistent . . .

We can see that in this example, the array is configured to actively use two devices, and that the total number of devices available to the array is three (because we added a spare).

Now, reconfigure the array to have an additional active device. The spare will be used to satisfy the extra drive requirement:

  1. sudo mdadm --grow --raid-devices=3 /dev/md0

The array will begin to reconfigure with an additional active disk. To view the progress of syncing the data, type:

  1. cat /proc/mdstat

You can continue to use the device as the process completes.

With RAID 5 or 6

Begin by adding the new device as a spare, just as demonstrated in the last section:

  1. sudo mdadm /dev/md0 --add /dev/sde

Find out the current number of RAID devices in the array:

  1. sudo mdadm --detail /dev/md0
Output
/dev/md0: Version : 1.2 Creation Time : Wed Aug 10 18:38:51 2016 Raid Level : raid5 Array Size : 209584128 (199.88 GiB 214.61 GB) Used Dev Size : 104792064 (99.94 GiB 107.31 GB) Raid Devices : 3 Total Devices : 4 Persistence : Superblock is persistent . . .

We can see that in this example, the array is configured to actively use three devices, and that the total number of devices available to the array is four (because we added a spare).

Now, reconfigure the array to have an additional active device. The spare will be used to satisfy the extra drive requirement. When growing a RAID 5 or RAID 6 array, it is important to include an additional option called --backup-file. This should point to a location off the array where a backup file containing critical information will be stored.

Note

The backup file is only used for a very short but critical time during this process, after which it will be deleted automatically. Because the time when this is needed is very brief, you will likely never see the file on disk, but in the event that something goes wrong, it can be used to rebuild the array. This post has some additional information if you would like to know more.

  1. sudo mdadm --grow --raid-devices=4 --backup-file=/root/md0_grow.bak /dev/md0

The following output indicates that the critical section will be backed up:

Output
mdadm: Need to backup 3072K of critical section..

The array will begin to reconfigure with an additional active disk. To view the progress of syncing the data, type:

  1. cat /proc/mdstat

You can continue to use the device as this process completes.

After the reshape is complete, you will need to expand the filesystem on the array to utilize the additional space:

  1. sudo resize2fs /dev/md0

Your array should now have a filesystem that matches its capacity.

With RAID 0

Because RAID 0 arrays cannot have spare drives (there is no chance for a spare to rebuild a damaged RAID 0 array), we must add the new device at the same time that we grow the array.

First, find out the current number of RAID devices in the array:

  1. sudo mdadm --detail /dev/md0
Output
/dev/md0: Version : 1.2 Creation Time : Wed Aug 10 19:17:14 2016 Raid Level : raid0 Array Size : 209584128 (199.88 GiB 214.61 GB) Raid Devices : 2 Total Devices : 2 Persistence : Superblock is persistent . . .

We can now increment the number of RAID devices in the same operation as the new drive addition:

  1. sudo mdadm --grow /dev/md0 --raid-devices=3 --add /dev/sdc

You will see output indicating that the array has been changed to RAID 4:

Output
mdadm: level of /dev/md0 changed to raid4 mdadm: added /dev/sdc

This is normal and expected. The array will transition back into RAID 0 when the data has been redistributed to all existing disks.

You can check the progress of the action by typing:

  1. cat /proc/mdstat

Once the sync is complete, resize the filesystem to use the additional space:

  1. sudo resize2fs /dev/md0

Your array should now have a filesystem that matches its capacity.

Removing a Device from an Array

Removing a drive from a RAID array is sometimes necessary if there is a fault or if you need to switch out the disk.

For a device to be removed, it must first be marked as “failed” within the array. You can check if there is a failed device by using mdadm --detail:

  1. sudo mdadm --detail /dev/md0
Output
/dev/md0: Version : 1.2 Creation Time : Wed Aug 10 21:42:12 2016 Raid Level : raid5 Array Size : 209584128 (199.88 GiB 214.61 GB) Used Dev Size : 104792064 (99.94 GiB 107.31 GB) Raid Devices : 3 Total Devices : 3 Persistence : Superblock is persistent Update Time : Thu Aug 11 14:10:43 2016 State : clean, degraded Active Devices : 2 Working Devices : 2 Failed Devices : 1 Spare Devices : 0 Layout : left-symmetric Chunk Size : 64K Name : mdadmwrite:0 (local to host mdadmwrite) UUID : bf7a711b:b3aa9440:40d2c12e:79824706 Events : 144 Number Major Minor RaidDevice State 0 0 0 0 removed 1 8 0 1 active sync /dev/sda 2 8 16 2 active sync /dev/sdb 0 8 32 - faulty /dev/sdc

The highlighted lines all indicate that a drive is no longer functioning (/dev/sdc in this example).

If you need to remove a drive that does not have a problem, you can manually mark it as failed with the --fail option:

  1. sudo mdadm /dev/md0 --fail /dev/sdc
Output
mdadm: set /dev/sdc faulty in /dev/md0

If you look at the output of mdadm --detail, you should see that the device is now marked faulty.

Once the device is failed, you can remove it from the array with mdadm --remove:

  1. sudo mdadm /dev/md0 --remove /dev/sdc
Output
mdadm: hot removed /dev/sdc from /dev/md0

You can then replace it with a new drive, using the same mdadm --add command that you use to add a spare:

  1. sudo mdadm /dev/md0 --add /dev/sdd
Output
mdadm: added /dev/sdd

The array will begin to recover by copying data to the new drive.

Deleting an Array

To destroy an array, including all data contained within, begin by following the process we used to stop an array.

First, unmount the filesystem:

  1. cd ~
  2. sudo umount /mnt/md0

Next, stop the array:

  1. sudo mdadm --stop /dev/md0

Afterwards, delete the array itself with the --remove command targeting the RAID device:

  1. sudo mdadm --remove /dev/md0

Once the array itself is removed, you should use mdadm --zero-superblock on each of the component devices. This will erase the md superblock, a header used by mdadm to assemble and manage the component devices as part of an array. If this is still present, it may cause problems when trying to reuse the disk for other purposes.

You can see that the superblock is still present in the array by checking out the FSTYPE column in the lsblk --fs output:

  1. lsblk --fs
Output
NAME FSTYPE LABEL UUID MOUNTPOINT sda linux_raid_member mdadmwrite:0 bf7a711b-b3aa-9440-40d2-c12e79824706 sdb linux_raid_member mdadmwrite:0 bf7a711b-b3aa-9440-40d2-c12e79824706 sdc linux_raid_member mdadmwrite:0 bf7a711b-b3aa-9440-40d2-c12e79824706 sdd vda ├─vda1 ext4 DOROOT 4f8b85db-8c11-422b-83c4-c74195f67b91 / └─vda15

In this example, /dev/sda, /dev/sdb, and /dev/sdc were all part of the array and are still labeled as such.

Remove the labels by typing:

  1. sudo mdadm --zero-superblock /dev/sda /dev/sdb /dev/sdc

Next, make sure you remove or comment out any references to the array in the /etc/fstab file:

  1. sudo nano /etc/fstab
/etc/fstab
. . .
# /dev/md0 /mnt/md0 ext4 defaults,nofail,discard 0 0

Save and close the file when you are finished.

Remove or comment out any references to the array from the /etc/mdadm/mdadm.conf file as well:

  1. nano /etc/mdadm/mdadm.conf
/etc/mdadm/mdadm.conf
# ARRAY /dev/md0 metadata=1.2 name=mdadmwrite:0 UUID=bf7a711b:b3aa9440:40d2c12e:79824706 

Save and close the file when you are finished.

Update the initramfs by typing:

  1. sudo update-initramfs -u

This should remove the device from the early boot environment.

 

We can make other actions to md device.

 echo resync > /sys/block/md2/md/sync_action  # to resume intrerrupted rsync

echo repair > /sys/block/md2/md/sync_action

echo check > /sys/block/md2/md/sync_action

Ihe initial status for /sys/block/md2/md/sync_action is idle

 

 To check disk and partition you can take:

lsblk -o NAME,SIZE,FSTYPE,TYPE,MOUNTPOINT

 To see smartctl details:

apt-get install smartmontools

smartctl -a /dev/sda


 Conclusion

Linux’s mdadm utility makes it fairly easy to manage arrays once you understand the conventions it uses and the places where you can look for information. This guide is in no ways exhaustive, but serves to introduce some of the management tasks that you might need to perform on a day-to-day basis.

Once you’re comfortable creating and managing RAID arrays with mdadm, there are a number of different directions you can explore next. Volume management layers like LVM integrate tightly with RAID and allow you to flexibly partition space into logical volumes. Similarly, LUKS and dm-crypt encryption is commonly used to encrypt the RAID devices prior to writing the filesystem. Linux allows all of these technologies to be used together to enhance your storage capabilities.

 

source

sâmbătă, 25 martie 2023

Php check if modules is loaded

Simply put the following command:


php -r "echo ini_get('extension_dir');"

duminică, 25 decembrie 2022

Injecting driver into windows 7 USB install media

 Hi


In many cases we need to add drivers for nvme or USB in Windows 7 installation media beacause new hardware is not supported by original media.

One method is to update boot.wim and install wim from sources folder (in my case iso image was written already on USB stick).

I make tmp folder info drive C.

In my case copy boot.win and install.wim into c:\tmp

In tmp make other folders (mount,updates  and nvme).


Finally in my folder c:\tmp we have following structure:

==============================================================

C:\tmp>dir

 Volume in drive C has no label.

 Volume Serial Number is 8CFB-6090


 Directory of C:\tmp


12/25/2022  01:31 AM    <DIR>          .

12/25/2022  01:31 AM    <DIR>          ..

12/25/2022  01:15 AM       172,568,187 boot.wim

12/25/2022  01:19 AM     2,841,234,901 install.wim

12/25/2022  01:20 AM    <DIR>          mount

12/25/2022  01:13 AM    <DIR>          nvme

12/25/2022  01:31 AM    <DIR>          updates

               2 File(s)  3,013,803,088 bytes

               5 Dir(s)  180,315,807,744 bytes free

===============================================================

Now... Follow these steps

  1. If you need to add some updates to original media Download the following updates from the Microsoft Update Catalog: KB2990941-v3, KB3087873-v2. Save *.MSU files to the directory c:\tmp\updates;
  2. Download the NVMe driver for your controller and extract it to c:\tmp\nvme;
  3. Slipstream the updates and the drivers to the boot WinPE image (boot.wim):
    DISM /Get-WimInfo /WimFile:c:\tmp\boot.wim
    DISM /Mount-Wim /WimFile:"C:\tmp\boot.wim" /Index:1 /MountDir:c:\tmp\mount
    DISM /Image:c:\tmp\mount /Add-Package /PackagePath:C:\tmp\updates
    DISM.exe /image:c:\tmp\mount /Add-Driver /driver:c:\tmp\nvme /recurse /ForceUnsigned
    DISM /Unmount-Wim /MountDir:c:\tmp\mount /Commit
  4. Run the same commands for the image with index 2 (on the second line, replace /Index:1 with /Index:2 ).
  5. Now you need to integrate the update and the driver into the Windows installation image (install.wim). The image file can contain several versions of Windows 7 with different indexes. You can get a list of Windows versions with the command:
    dism /Get-WimInfo /WimFile:c:\tmp\install.wim
    Specify the index of the image to be updated (in our example it is Index:2 )
    DISM /Get-WimInfo /WimFile:c:\tmp\install.wim
    DISM /Mount-Wim /WimFile:"C:\tmp\install.wim" /Index:2 /MountDir:c:\tmp\mount
    DISM /Image:c:\tmp\mount /Add-Package /PackagePath:C:\tmp\updates
    DISM.exe /image:c:\tmp\mount /Add-Driver /driver:c:\tmp\nvme /recurse /ForceUnsigned
    DISM /Unmount-Wim /MountDir:c:\tmp\mount /Commit

 Copy files again into sources folder (from USB Windows 7 installation media) and try again to install.


vineri, 28 ianuarie 2022

Enable Dkim in Postfix on Centos 6/7

 

How DKIM Works ?

When we configured DKIM on sending servers. First, we generated a public/private key pair for signing outgoing messages. The public key is configured as TXT record on a domains name server, and the private key is configured in the outbound email server. When an email is sent by an authorized user of the email server, the server uses the stored private key to generate a digital signature of the message, which is inserted in the message as a header, and the email is sent as normal.

Step 1 – Install DKIM-milter

First make sure you have enabled EPEL repository in your system. After that install dkim-milter package using following command.

yum install postfix opendkim

Step 2 – Generate Key Pair

Now create DKIM key pair using dkim-genkey command line utility provided by dkim-milter package. For this tutorial we are using domain name “example.com”, Change this name with your actual names.

MYDOMAIN=example.com
mkdir -p /etc/opendkim/keys/$MYDOMAIN
cd /etc/opendkim/keys/$MYDOMAIN
opendkim-genkey -r -d $MYDOMAIN

Above command will generate two files default.private and default.txt. You can created multiple DKIM keys for different-2 domains and configure with your postfix server.

Now set the proper permissions on Keys directory.

chown -R opendkim:opendkim /etc/opendkim
chmod go-rw /etc/opendkim/keys

Step 3 – Configure OpenDKIM

Edit the Opendkim configuration file and Add/Update following entries in file.

vim /etc/opendkim.conf
Mode     sv
Socket   inet:8891@localhost
Domain   example.com
#KeyFile        /etc/opendkim/keys/default.private  ### comment this line
KeyTable        /etc/opendkim/KeyTable
SigningTable   refile:/etc/opendkim/SigningTable
ExternalIgnoreList      refile:/etc/opendkim/TrustedHosts
InternalHosts   refile:/etc/opendkim/TrustedHosts

Then edit the domain keys lists setting file /etc/opendkim/KeyTable and add following entry.

default._domainkey.example.com example.com:default:/etc/opendkim/keys/example.com/default.private

After that edit /etc/opendkim/SigningTable file and update following entry.

*@example.com default._domainkey.example.com

And edit /etc/opendkim/TrustedHosts file and update following entry.

mail.example.com
example.com

Step 4 – Configure Postfix

Now edit POSTFIX configuration file /etc/postfix/main.cf and add following values at the end of file

smtpd_milters = inet:127.0.0.1:8891
non_smtpd_milters = $smtpd_milters
milter_default_action = accept

finally start DKIM service using following command

service opendkim start

Step 5 – Configure DNS Entry

After configuring private key in postfix server. there will be another file /etc/opendkim/keys/example.com/default.txt/strong> generated by opendkim-genkey. Edit your DNS zone file and add this as TXT record found in default.txt. In my case this is like below.

default._domainkey      IN      TXT     ( "v=DKIM1; k=rsa; s=email; "
"p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCdTtEqM8FqndiFYOderzljMMMqBdEp+wJKP+VUbhc9GigmK34ZjrSqqdKjIEWr2q9DvSVp1H1bZs4t050m0HZxJqknDz2yoDJ6W4mCaSCHesRde5V44V/L65Gqm/rvBz1d6CCp8A2515eveWrIAocOD6pKJ4tnXHz3uwV2ZtgQiQIDAQAB" )  ; ----- DKIM key default for example.com

Step 6 – Verify DKIM

To verify that DKIM is working properly. Let’s send a test email through command line

mail -vs "Test DKIM" my_test_email@gmail.com < /dev/null

In the received email in our mailbox, open the source of the email and search for "DKIM-Signature". You will find something like below

DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=example.com;
	s=default.private; t=1402388963;
	bh=fdkeB/A0FkbVP2k4J4pNPoe23AvqBm9+b0C3OY87Cw8=;
	h=Date:From:Message-Id:To:Subject;
	b=M6g0eHe3LNqURha9d73bFWlPfOERXsXxrYtN2qrSQ6/0WXtOxwkEjfoNTHPzoEOlD
	 i6uLLwV+3/JTs7mFmrkvlA5ZR693sM5gkVgVJmuOsylXSwd3XNfEcGSqFRRIrLhHtbC
	 mAXMNxJtih9OuVNi96TrFNyUJeHMRvvbo34BzqWY=
 
source 

luni, 17 ianuarie 2022

Restoring Orphan File-Per-Table ibd Files

 

This procedure describes how to restore orphan file-per-table .ibd files to another MySQL instance. You might use this procedure if the system tablespace is lost or unrecoverable and you want to restore .ibd file backups on a new MySQL instance.

The procedure is not supported for general tablespace .ibd files.

The procedure assumes that you only have .ibd file backups, you are recovering to the same version of MySQL that initially created the orphan .ibd files, and that .ibd file backups are clean. See Section 14.6.1.4, “Moving or Copying InnoDB Tables” for information about creating clean backups.

Table import limitations outlined in Section 14.6.1.3, “Importing InnoDB Tables” are applicable to this procedure.

  1. On the new MySQL instance, recreate the table in a database of the same name.

    mysql> CREATE DATABASE sakila;
    
    mysql> USE sakila;
    
    mysql> CREATE TABLE actor (
             actor_id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
             first_name VARCHAR(45) NOT NULL,
             last_name VARCHAR(45) NOT NULL,
             last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
             PRIMARY KEY  (actor_id),
             KEY idx_actor_last_name (last_name)
           )ENGINE=InnoDB DEFAULT CHARSET=utf8;
  2. Discard the tablespace of the newly created table.

    mysql> ALTER TABLE sakila.actor DISCARD TABLESPACE;
  3. Copy the orphan .ibd file from your backup directory to the new database directory.

    $> cp /backup_directory/actor.ibd path/to/mysql-5.7/data/sakila/
  4. Ensure that the .ibd file has the necessary file permissions.

  5. Import the orphan .ibd file. A warning is issued indicating that InnoDB tries to import the file without schema verification.

    mysql> ALTER TABLE sakila.actor IMPORT TABLESPACE; SHOW WARNINGS;
    Query OK, 0 rows affected, 1 warning (0.15 sec)
    
    Warning | 1810 | InnoDB: IO Read error: (2, No such file or directory)
    Error opening './sakila/actor.cfg', will attempt to import
    without schema verification
  6. Query the table to verify that the .ibd file was successfully restored.

mysql> SELECT COUNT(*) FROM sakila.actor;
+----------+
| count(*) |
+----------+
|      200 |
+----------+
source 

duminică, 26 decembrie 2021

fsck Error Messages

 

fsck Error Messages

Normally, fsck is run non-interactively to preen the file systems after an abrupt system halt in which the latest file system changes were not written to disk. Preening automatically fixes any basic file system inconsistencies and does not try to repair more serious errors. While preening a file system, fsck fixes the inconsistencies it expects from such an abrupt halt. For more serious conditions, the command reports the error and terminates.

When you run fsck interactively, fsck reports each inconsistency found and fixes innocuous errors. However, for more serious errors, the command reports the inconsistency and prompts you to choose a response. When you run fsck using the -y or -n options, your response is predefined as yes or no to the default response suggested by fsck for each error condition.

Some corrective actions will result in some loss of data. The amount and severity of data loss may be determined from the fsck diagnostic output.

fsck is a multipass file system check program. Each pass invokes a different phase of the fsck program with different sets of messages. After initialization, fsck performs successive passes over each file system, checking blocks and sizes, path names, connectivity, reference counts, and the map of free blocks (possibly rebuilding it). It also performs some cleanup.

The phases (passes) performed by the UFS version of fsck are:

  • Initialization

  • Phase 1 - Check blocks and sizes

  • Phase 2 - Check path names

  • Phase 3 - Check connectivity

  • Phase 4 - Check reference counts

  • Phase 5 - Check cylinder groups

The next sections describe the error conditions that may be detected in each phase, the messages and prompts that result, and possible responses you can make.

Messages that may appear in more than one phase are described in "General fsck Error Messages ". Otherwise, messages are organized alphabetically by the phases in which they occur.

Many of the messages include the abbreviations shown in the table below:

Table 43-1 Error Message Abbreviations

Abbreviation 

Meaning 

BLK

Block number 

DUP

Duplicate block number 

DIR

Directory name 

CG

Cylinder group 

MTIME

Time file was last modified 

UNREF

Unreferenced 

Many of the messages also include variable fields, such as inode numbers, which are represented in this book by an italicized term, such as inode-number. For example, this screen message:


INCORRECT BLOCK COUNT I=2529 

is shown as:


INCORRECT BLOCK COUNT I=inode-number

General fsck Error Messages

The error messages in this section may be displayed in any phase after initialization. Although they offer the option to continue, it is generally best to regard them as fatal. They reflect a serious system failure and should be handled immediately. When confronted with such a message, terminate the program by entering n(o). If you cannot determine what caused the problem, contact your local service provider or another qualified person.


CANNOT SEEK: BLK block-number (CONTINUE)
Cause

A request to move to a specified block number, block-number, in the file system failed. This message indicates a serious problem, probably a hardware failure.

If you want to continue the file system check, fsck will retry the move and display a list of sector numbers that could not be moved. If the block was part of the virtual memory buffer cache, fsck will terminate with a fatal I/O error message.

Action

If the disk is experiencing hardware problems, the problem will persist. Run fsck again to recheck the file system.

If the recheck fails, contact your local service provider or another qualified person.


CANNOT READ: BLK block-number (CONTINUE)
Cause

A request to read a specified block number, block-number, in the file system failed. The message indicates a serious problem, probably a hardware failure.

If you want to continue the file system check, fsck will retry the read and display a list of sector numbers that could not be read. If the block was part of the virtual memory buffer cache, fsck will terminate with a fatal I/O error message. If fsck tries to write back one of the blocks on which the read failed, it will display the following message:

WRITING ZERO'ED BLOCK sector-numbers TO DISK

Action

If the disk is experiencing hardware problems, the problem will persist. Run fsck again to recheck the file system. If the recheck fails, contact your local service provider or another qualified person.


CANNOT WRITE: BLK block-number (CONTINUE)
Cause

A request to write a specified block number, block-number, in the file system failed.

If you continue the file system check, fsck will retry the write and display a list of sector numbers that could not be written. If the block was part of the virtual memory buffer cache, fsck will terminate with a fatal I/O error message.

Action

The disk may be write-protected. Check the write-protect lock on the drive. If the disk has hardware problems, the problem will persist. Run fsck again to recheck the file system. If the write-protect is not the problem or the recheck fails, contact your local service provider or another qualified person.

Initialization Phase fsck Messages

In the initialization phase, command-line syntax is checked. Before the file system check can be performed, fsck sets up tables and opens files.

The messages in this section relate to error conditions resulting from command-line options, memory requests, the opening of files, the status of files, file system size checks, and the creation of the scratch file. All such initialization errors terminate fsck when it is preening the file system.


bad inode number inode-number to ginode
Cause

An internal error occurred because of a nonexistent inode inode-number. fsck exits.

Action

Contact your local service provider or another qualified person.


cannot alloc size-of-block map bytes for blockmap
cannot alloc size-of-free map bytes for freemap
cannot alloc size-of-state map bytes for statemap
cannot alloc size-of-lncntp bytes for lncntp
Cause

Request for memory for its internal tables failed. fsck terminates. This message indicates a serious system failure that should be handled immediately. This condition may occur if other processes are using a very large amount of system resources.

Action

Killing other processes may solve the problem. If not, contact your local service provider or another qualified person.


Can't open checklist file: filename
Cause

The file system checklist file filename (usually /etc/vfstab) cannot be opened for reading. fsck terminates.

Action

Check if the file exists and if its access modes permit read access.


Can't open filename
Cause

fsck cannot open file system filename. When running interactively, fsck ignores this file system and continues checking the next file system given.

Action

Check to see if read and write access to the raw device file for the file system is permitted.


Can't stat root
Cause

fsck request for statistics about the root directory failed. fsck terminates.

Action

This message indicates a serious system failure. Contact your local service provider or another qualified person.


Can't stat filename
Can't make sense out of name filename
Cause

fsck request for statistics about the file system filename failed. When running interactively, fsck ignores this file system and continues checking the next file system given.

Action

Check if the file system exists and check its access modes.


filename: (NO WRITE)
Cause

Either the -n option was specified or fsck could not open the file system filename for writing. When fsck is running in no-write mode, all diagnostic messages are displayed, but fsck does not attempt to fix anything.

Action

If -n was not specified, check the type of the file specified. It may be the name of a regular file.


IMPOSSIBLE MINFREE=percent IN SUPERBLOCK (SET TO DEFAULT)
Cause

The superblock minimum space percentage is greater than 99 percent or less than 0 percent.

Action

To set the minfree parameter to the default 10 percent, type y at the default prompt. To ignore the error condition, type n at the default prompt.


filename: BAD SUPER BLOCK: message
USE AN ALTERNATE SUPER-BLOCK TO SUPPLY NEEDED INFORMATION;
e.g., fsck[-f ufs] -o b=# [special ...]
where # is the alternate superblock.  See fsck_ufs(1M)
Cause

The superblock has been corrupted.

Action

One of the following messages may be displayed:


CPG OUT OF RANGE
FRAGS PER BLOCK OR FRAGSIZE WRONG
INODES PER GROUP OUT OF RANGE
INOPB NONSENSICAL RELATIVE TO BSIZE 
MAGIC NUMBER WRONG 
NCG OUT OF RANGE 
NCYL IS INCONSISTENT WITH NCG*CPG 
NUMBER OF DATA BLOCKS OUT OF RANGE
NUMBER OF DIRECTORIES OUT OF RANGE
ROTATIONAL POSITION TABLE SIZE OUT OF RANGE
SIZE OF CYLINDER GROUP SUMMARY AREA WRONG
SIZE TOO LARGE 
BAD VALUES IN SUPERBLOCK

Try to rerun fsck with an alternative superblock. Specifying block 32 is a good first choice. You can locate an alternative copy of the superblock by running the newfs -N command on the slice. Be sure to specify the -N option; otherwise, newfs overwrites the existing file system.


UNDEFINED OPTIMIZATION IN SUPERBLOCK (SET TO DEFAULT)
Cause

The superblock optimization parameter is neither OPT_TIME nor OPT_SPACE.

Action

To minimize the time to perform operations on the file system, type y at the SET TO DEFAULT prompt. To ignore this error condition, type n.

Phase 1: Check Blocks and Sizes Messages

This phase checks the inode list. It reports error conditions encountered while:

  • Checking inode types

  • Setting up the zero-link-count table

  • Examining inode block numbers for bad or duplicate blocks

  • Checking inode size

  • Checking inode format

All errors in this phase except INCORRECT BLOCK COUNT, PARTIALLY TRUNCATED INODE, PARTIALLY ALLOCATED INODE, and UNKNOWN FILE TYPE terminate fsck when it is preening a file system.

These messages (in alphabetical order) may occur in phase 1:


block-number BAD I=inode-number
Cause

Inode inode-number contains a block number block-number with a number lower than the number of the first data block in the file system or greater than the number of the last block in the file system. This error condition may generate the EXCESSIVE BAD BLKS error message in phase 1 if inode inode-number has too many block numbers outside the file system range. This error condition generates the BAD/DUP error message in phases 2 and 4.

Action

N/A


BAD MODE: MAKE IT A FILE?
Cause

The status of a given inode is set to all 1s, indicating file system damage. This message does not indicate physical disk damage, unless it is displayed repeatedly after fsck -y has been run.

Action

Type y to reinitialize the inode to a reasonable value.


BAD STATE state-number TO BLKERR
Cause

An internal error has scrambled the fsck state map so that it shows the impossible value state-number. fsck exits immediately.

Action

Contact your local service provider or another qualified person.


block-number DUP I=inode-number
Cause

Inode inode-number contains a block number block-number, which is already claimed by the same or another inode. This error condition may generate the EXCESSIVE DUP BLKS error message in phase 1 if inode inode-number has too many block numbers claimed by the same or another inode. This error condition invokes phase 1B and generates the BAD/DUP error messages in phases 2 and 4.

Action

N/A


DUP TABLE OVERFLOW (CONTINUE)
Cause

There is no more room in an internal table in fsck containing duplicate block numbers. If the -o p option is specified, the program terminates.

Action

To continue the program, type y at the CONTINUE prompt. When this error occurs, a complete check of the file system is not possible. If another duplicate block is found, this error condition repeats. Increase the amount of virtual memory available (by killing some processes, increasing swap space) and run fsck again to recheck the file system. To terminate the program, type n.


EXCESSIVE BAD BLOCKS I=inode-number (CONTINUE)
Cause

Too many (usually more than 10) blocks have a number lower than the number of the first data block in the file system or greater than the number of the last block in the file system associated with inode inode-number. If the -o p (preen) option is specified, the program terminates.

Action

To continue the program, type y at the CONTINUE prompt. When this error occurs, a complete check of the file system is not possible. You should run fsck again to recheck the file system. To terminate the program, type n.


EXCESSIVE DUP BLKS I=inode-number (CONTINUE)
Cause

Too many (usually more than 10) blocks are claimed by the same or another inode or by a free-list. If the -o p option is specified, the program terminates.

Action

To continue the program, type y at the CONTINUE prompt. When this error occurs, a complete check of the file system is not possible. You should run fsck again to recheck the file system. To terminate the program, type n.


INCORRECT BLOCK COUNT I=inode-number (number-of-BAD-DUP-or-missing-blocks should be
 number-of-blocks-in-filesystem) (CORRECT)
Cause

The block count for inode inode-number is number-of-BAD-DUP-or-missing-blocks, but should be number-of-blocks-in-filesystem. When preening, fsck corrects the count.

Action

To replace the block count of inode inode-number by number-of-blocks-in-filesystem, type y at the CORRECT prompt. To terminate the program, type n.


LINK COUNT TABLE OVERFLOW (CONTINUE)
Cause

There is no more room in an internal table for fsck containing allocated inodes with a link count of zero. If the -o p (preen) option is specified, the program exits and fsck has to be completed manually.

Action

To continue the program, type y at the CONTINUE prompt. If another allocated inode with a zero-link count is found, this error condition repeats. When this error occurs, a complete check of the file system is not possible. You should run fsck again to recheck the file system. Increase the virtual memory available by killing some processes or increasing swap space, then run fsck again. To terminate the program, type n.


PARTIALLY ALLOCATED INODE I=inode-number (CLEAR)
Cause

Inode inode-number is neither allocated nor unallocated. If the -o p (preen) option is specified, the inode is cleared.

Action

To deallocate the inode inode-number by zeroing out its contents, type y. This may generate the UNALLOCATED error condition in phase 2 for each directory entry pointing to this inode. To ignore the error condition, type n. A no response is appropriate only if you intend to take other measures to fix the problem.


PARTIALLY TRUNCATED INODE I=inode-number (SALVAGE)
Cause

fsck has found inode inode-number whose size is shorter than the number of blocks allocated to it. This condition occurs only if the system crashes while truncating a file. When preening the file system, fsck completes the truncation to the specified size.

Action

To complete the truncation to the size specified in the inode, type y at the SALVAGE prompt. To ignore this error condition, type n.


UNKNOWN FILE TYPE I=inode-number (CLEAR)
Cause

The mode word of the inode inode-number shows that the inode is not a pipe, special character inode, special block inode, regular inode, symbolic link, FIFO file, or directory inode. If the -o p option is specified, the inode is cleared.

Action

To deallocate the inode inode-number by zeroing its contents, which results in the UNALLOCATED error condition in phase 2 for each directory entry pointing to this inode, type y at the CLEAR prompt. To ignore this error condition, type n.

Phase 1B: Rescan for More DUPS Messages

When a duplicate block is found in the file system, this message is displayed:


block-number DUP I=inode-number
Cause

Inode inode-number contains a block number block-number that is already claimed by the same or another inode. This error condition generates the BAD/DUP error message in phase 2. Inodes that have overlapping blocks may be determined by examining this error condition and the DUP error condition in phase 1.

Action

When a duplicate block is found, the file system is rescanned to find the inode that previously claimed that block.

Phase 2: Check Path Names Messages

This phase removes directory entries pointing to bad inodes found in phases 1 and 1B. It reports error conditions resulting from:

  • Incorrect root inode mode and status

  • Directory inode pointers out of range

  • Directory entries pointing to bad inodes

  • Directory integrity checks

When the file system is being preened (-o p option), all errors in this phase terminate fsck, except those related to directories not being a multiple of the block size, duplicate and bad blocks, inodes out of range, and extraneous hard links.

These messages (in alphabetical order) may occur in phase 2:


BAD INODE state-number TO DESCEND
Cause

An fsck internal error has passed an invalid state state-number to the routine that descends the file system directory structure. fsck exits.

Action

If this error message is displayed, contact your local service provider or another qualified person.


BAD INODE NUMBER FOR '.' I=inode-number OWNER=UID MODE=file-mode 
SIZE=file-size MTIME=modification-time DIR=filename (FIX)
Cause

A directory inode-number has been found whose inode number for "." does not equal inode-number.

Action

To change the inode number for "." to be equal to inode-number, type y at the FIX prompt To leave the inode numbers for "." unchanged, type n.


BAD INODE NUMBER FOR '..' I=inode-number OWNER=UID MODE=file-mode 
SIZE=file-size MTIME=modification-time DIR=filename (FIX)
Cause

A directory inode-number has been found whose inode number for ".." does not equal the parent of inode-number.

Action

To change the inode number for ".." to be equal to the parent of inode-number, type y at the FIX prompt. (Note that "..'' in the root inode points to itself.)To leave the inode number for ".." unchanged, type n.


BAD RETURN STATE state-number FROM DESCEND
Cause

An fsck internal error has returned an impossible state state-number from the routine that descends the file system directory structure. fsck exits.

Action

If this message is displayed, contact your local service provider or another qualified person.


BAD STATE state-number FOR ROOT INODE
Cause

An internal error has assigned an impossible state state-number to the root inode. fsck exits.

Action

If this error message is displayed, contact your local service provider or another qualified person.


BAD STATE state-number FOR INODE=inode-number
Cause

An internal error has assigned an impossible state state-number to inode inode-number. fsck exits.

Action

If this error message is displayed, contact your local service provider or another qualified person.


DIRECTORY TOO SHORT I=inode-number OWNER=UID MODE=file-mode 
SIZE=file-size MTIME=modification-time DIR=filename (FIX)
Cause

A directory filename has been found whose size file-size is less than the minimum directory size. The owner UID, mode file-mode, size file-size, modify time modification-time, and directory name filename are displayed.

Action

To increase the size of the directory to the minimum directory size, type y at the FIX prompt. To ignore this directory, type n.


DIRECTORY filename: LENGTH file-size NOT MULTIPLE OF block-number (ADJUST)
Cause

A directory filename has been found with size file-size that is not a multiple of the directory block size block-number.

Action

To round up the length to the appropriate block size, type y. When preening the file system (-o p option), fsck only displays a warning and adjusts the directory. To ignore this condition, type n.


DIRECTORY CORRUPTED I=inode-number OWNER=UID MODE=file-mode 
SIZE=file-size MTIME=modification-time DIR=filename (SALVAGE)
Cause

A directory with an inconsistent internal state has been found.

Action

To throw away all entries up to the next directory boundary (usually a 512-byte boundary), type y at the SALVAGE prompt. This drastic action can throw away up to 42 entries. Take this action only after other recovery efforts have failed. To skip to the next directory boundary and resume reading, but not modify the directory, type n.


DUP/BAD I=inode-number OWNER=O MODE=M SIZE=file-size 
MTIME=modification-time TYPE=filename (REMOVE)
Cause

Phase 1 or phase 1B found duplicate blocks or bad blocks associated with directory or file entry filename, inode inode-number. The owner UID, mode file-mode, size file-size, modification time modification-time, and directory or file name filename are displayed. If the -p (preen) option is specified, the duplicate/bad blocks are removed.

Action

To remove the directory or file entry filename, type y at the REMOVE prompt. To ignore this error condition, type n.


DUPS/BAD IN ROOT INODE (REALLOCATE)
Cause

Phase 1 or phase 1B has found duplicate blocks or bad blocks in the root inode (usually inode number 2) of the file system.

Action

To clear the existing contents of the root inode and reallocate it, type y at the REALLOCATE prompt. The files and directories usually found in the root inode will be recovered in phase 3 and put into the lost+found directory. If the attempt to allocate the root fails, fsck will exit with: CANNOT ALLOCATE ROOT INODE. Type n to get the CONTINUE prompt. Type: y to respond to the CONTINUE prompt, and ignore the DUPS/BAD error condition in the root inode and continue running the file system check. If the root inode is not correct, this may generate many other error messages. Type n to terminate the program.


EXTRA '.' ENTRY I=inode-number OWNER=UID MODE=file-mode 
SIZE=file-size MTIME=modification-time DIR=filename (FIX)
Cause

A directory inode-number has been found that has more than one entry for ".".

Action

To remove the extra entry for "." type y at the FIX prompt. To leave the directory unchanged, type n.


EXTRA '..' ENTRY I=inode-number OWNER=UID MODE=file-mode 
SIZE=file-size MTIME=modification-time DIR=filename(FIX)
Cause

A directory inode-number has been found that has more than one entry for ".." (the parent directory).

Action

To remove the extra entry for `..' (the parent directory), type y at the FIX prompt. To leave the directory unchanged, type n.


hard-link-number IS AN EXTRANEOUS HARD LINK TO A DIRECTORY filename (REMOVE)
Cause

fsck has found an extraneous hard link hard-link-number to a directory filename. When preening (-o p option), fsck ignores the extraneous hard links.

Action

To delete the extraneous entry hard-link-number type y at the REMOVE prompt. To ignore the error condition, type n.


inode-number OUT OF RANGE I=inode-number NAME=filename (REMOVE)
Cause

A directory entry filename has an inode number inode-number that is greater than the end of the inode list. If the -p (preen) option is specified, the inode will be removed automatically.

Action

To delete the directory entry filename type y at the REMOVE prompt. To ignore the error condition, type n.


MISSING '.' I=inode-number OWNER=UID MODE=file-mode SIZE=file-size 
MTIME=modification-time DIR=filename (FIX)
Cause

A directory inode-number has been found whose first entry (the entry for ".") is unallocated.

Action

To build an entry for "." with inode number equal to inode-number, type y at the FIX prompt. To leave the directory unchanged, type n.


MISSING '.' I=inode-number OWNER=UID MODE=file-mode SIZE=file-size 
MTIME=modification-time DIR=filename CANNOT FIX, FIRST ENTRY IN 
DIRECTORY CONTAINS filename
Cause

A directory inode-number has been found whose first entry is filename. fsck cannot resolve this problem.

Action

If this error message is displayed, contact your local service provider or another qualified person.


MISSING '.' I=inode-number OWNER=UID MODE=file-mode SIZE=file-size 
MTIME=modification-time DIR=filename CANNOT FIX, INSUFFICIENT 
SPACE TO ADD '.'
Cause

A directory inode-number has been found whose first entry is not ".". fsck cannot resolve the problem.

Action

If this error message is displayed, contact your local service provider or another qualified person.


MISSING '..' I=inode-number OWNER=UID MODE=file-mode SIZE=file-size 
MTIME=modification-time DIR=filename (FIX)
Cause

A directory inode-number has been found whose second entry is unallocated.

Action

To build an entry for ".." with inode number equal to the parent of inode-number, type y at the FIX prompt. (Note that "..'' in the root inode points to itself.) To leave the directory unchanged, type n.


MISSING '..' I=inode-number OWNER=UID MODE=file-mode SIZE=file-size 
MTIME=modification-time DIR=filename CANNOT FIX, SECOND ENTRY IN 
DIRECTORY CONTAINS filename
Cause

A directory inode-number has been found whose second entry is filename. fsck cannot resolve this problem.

Action

If this error message is displayed, contact your local service provider or another qualified person.


MISSING '..' I=inode-number OWNER=UID MODE=file-mode SIZE=file-size 
MTIME=modification-time DIR=filename CANNOT FIX, INSUFFICIENT SPACE 
TO ADD '..'
Cause

A directory inode-number has been found whose second entry is not ".." (the parent directory). fsck cannot resolve this problem.

Action

If this error message is displayed, contact your local service provider or another qualified person.


NAME TOO LONG filename
Cause

An excessively long path name has been found, which usually indicates loops in the file system name space. This error can occur if a privileged user has made circular links to directories.

Action

Remove the circular links.


ROOT INODE UNALLOCATED (ALLOCATE)
Cause

The root inode (usually inode number 2) has no allocate-mode bits.

Action

To allocate inode 2 as the root inode, type y at the ALLOCATE prompt. The files and directories usually found in the root inode will be recovered in phase 3 and put into the lost+found directory. If the attempt to allocate the root inode fails, fsck displays this message and exits: CANNOT ALLOCATE ROOT INODE. To terminate the program, type n.


ROOT INODE NOT DIRECTORY (REALLOCATE)
Cause

The root inode (usually inode number 2) of the file system is not a directory inode.

Action

To clear the existing contents of the root inode and reallocate it, type y at the REALLOCATE prompt. The files and directories usually found in the root inode will be recovered in phase 3 and put into the lost+found directory. If the attempt to allocate the root inode fails, fsck displays this message and exits :CANNOT ALLOCATE ROOT INODE. To have fsck prompt with FIX, type n.


UNALLOCATED I=inode-number OWNER=UID MODE=file-mode SIZE=file-size 
MTIME=modification-time type=filename(REMOVE)
Cause

A directory or file entry filename points to an unallocated inode inode-number. The owner UID, mode file-mode, size file-size, modify time modification-time, and file name filename are displayed.

Action

To delete the directory entry filename, type y at the REMOVE prompt. To ignore the error condition, type n.


ZERO LENGTH DIRECTORY I=inode-number OWNER=UID MODE=file-mode 
SIZE=file-size MTIME=modification-time DIR=filename (REMOVE)
Cause

A directory entry filename has a size file-size that is zero. The owner UID, mode file-mode, size file-size, modify time modification-time, and directory name filename are displayed.

Action

To remove the directory entry filename, type y at the REMOVE prompt. This results in the BAD/DUP error message in phase 4. To ignore the error condition, type n.

Phase 3: Check Connectivity Messages

This phase checks the directories examined in phase 2 and reports error conditions resulting from:

  • Unreferenced directories

  • Missing or full lost+found directories

These messages (in alphabetical order) may occur in phase 3:


BAD INODE state-number TO DESCEND
Cause

An internal error has caused an impossible state state-number to be passed to the routine that descends the file system directory structure. fsck exits.

Action

If this occurs, contact your local service provider or another qualified person.


DIR I=inode-number1 CONNECTED. PARENT WAS I=inode-number2
Cause

This is an advisory message indicating a directory inode inode-number1 was successfully connected to the lost+found directory. The parent inode inode-number2 of the directory inode inode-number1 is replaced by the inode number of the lost+found directory.

Action

N/A


DIRECTORY filename LENGTH file-size NOT MULTIPLE OF block-number (ADJUST)
Cause

A directory filename has been found with size file-size that is not a multiple of the directory block size B. (This condition can recur in phase 3 if it is not adjusted in phase 2.)

Action

To round up the length to the appropriate block size, type y at the ADJUST prompt. When preening, fsck displays a warning and adjusts the directory. To ignore this error condition, type n.


lost+found IS NOT A DIRECTORY (REALLOCATE)
Cause

The entry for lost+found is not a directory.

Action

To allocate a directory inode and change the lost+found directory to reference it, type y at the REALLOCATE prompt. The previous inode reference by the lost+found directory is not cleared and it will either be reclaimed as an unreferenced inode or have its link count adjusted later in this phase. Inability to create a lost+found directory displays the message: SORRY. CANNOT CREATE lost+found DIRECTORY and aborts the attempt to link up the lost inode, which generates the UNREF error message in phase 4. To abort the attempt to link up the lost inode, which generates the UNREF error message in phase 4, type n.


NO lost+found DIRECTORY (CREATE)
Cause

There is no lost+found directory in the root directory of the file system. When preening, fsck tries to create a lost+found directory.

Action

To create a lost+found directory in the root of the file system, type y at the CREATE prompt. This may lead to the message NO SPACE LEFT IN / (EXPAND). If the lost+found directory cannot be created, fsck displays the message: SORRY. CANNOT CREATE lost+found DIRECTORY and aborts the attempt to link up the lost inode. This in turn generates the UNREF error message later in phase 4. To abort the attempt to link up the lost inode, type n.


NO SPACE LEFT IN /lost+found (EXPAND)
Cause

Another entry cannot be added to the lost+found directory in the root directory of the file system because no space is available. When preening, fsck expands the lost+found directory.

Action

To expand the lost+found directory to make room for the new entry, type y at the EXPAND prompt. If the attempted expansion fails, fsck displays: SORRY. NO SPACE IN lost+found DIRECTORY and aborts the request to link a file to the lost+found directory. This error generates the UNREF error message later in phase 4. Delete any unnecessary entries in the lost+found directory. This error terminates fsck when preening is in effect. To abort the attempt to link up the lost inode, type n.


UNREF DIR I=inode-number OWNER=UID MODE=file-mode SIZE=file-size 
MTIME=modification-time (RECONNECT)
Cause

The directory inode inode-number was not connected to a directory entry when the file system was traversed. The owner UID, mode file-mode, size file-size, and modification time modification-time of directory inode inode-number are displayed. When preening, fsck reconnects the non-empty directory inode if the directory size is non-zero. Otherwise, fsck clears the directory inode.

Action

To reconnect the directory inode inode-number into the lost+found directory, type y at the RECONNECT prompt. If the directory is successfully reconnected, a CONNECTED message is displayed. Otherwise, one of the lost+found error messages is displayed. To ignore this error condition, type n. This error causes the UNREF error condition in phase 4.

Phase 4: Check Reference Counts Messages

This phase checks the link count information obtained in phases 2 and 3. It reports error conditions resulting from:

  • Unreferenced files

  • A missing or full lost+found directory

  • Incorrect link counts for files, directories, symbolic links, or special files

  • Unreferenced files, symbolic links, and directories

  • Bad or duplicate blocks in files and directories

  • Incorrect total free-inode counts

All errors in this phase (except running out of space in the lost+found directory) are correctable when the file system is being preened.

These messages (in alphabetical order) may occur in phase 4:


BAD/DUP type I=inode-number OWNER=UID MODE=file-mode SIZE=file-size 
MTIME=modification-time (CLEAR)
Cause

Phase 1 or phase 1B found duplicate blocks or bad blocks associated with file or directory inode inode-number. The owner UID, mode file-mode, size file-size, and modification time modification-time of inode inode-number are displayed.

Action

To deallocate inode inode-number by zeroing its contents, type y at the CLEAR prompt. To ignore this error condition, type n.


(CLEAR)
Cause

The inode mentioned in the UNREF error message immediately preceding cannot be reconnected. This message does not display if the file system is being preened because lack of space to reconnect files terminates fsck.

Action

To deallocate the inode by zeroing out its contents, type y at the CLEAR prompt. To ignore the preceding error condition, type n.


LINK COUNT type I=inode-number OWNER=UID MODE=file-mode 
SIZE=file-size
MTIME=modification-time COUNT link-count SHOULD BE 
corrected-link-count (ADJUST)
Cause

The link count for directory or file inode inode-number is link-count but should be corrected-link-count. The owner UID, mode file-mode, size file-size, and modification time modification-time of inode inode-number are displayed. If the -o p option is specified, the link count is adjusted unless the number of references is increasing. This condition does not occur unless there is a hardware failure. When the number of references is increasing during preening, fsck displays this message and exits: LINK COUNT INCREASING

Action

To replace the link count of directory or file inode inode-number with corrected-link-count, type y at the ADJUST prompt. To ignore this error condition, type n.


lost+found IS NOT A DIRECTORY (REALLOCATE)
Cause

The entry for lost+found is not a directory.

Action

To allocate a directory inode and change the lost+found directory to reference it, type y at the REALLOCATE prompt. The previous inode reference by the lost+found directory is not cleared. It will either be reclaimed as an unreferenced inode or have its link count adjusted later in this phase. Inability to create a lost+found directory displays this message: SORRY. CANNOT CREATE lost+found DIRECTORY and aborts the attempt to link up the lost inode. This error generates the UNREF error message later in phase 4. To abort the attempt to link up the lost inode, type n.


NO lost+found DIRECTORY (CREATE)
Cause

There is no lost+found directory in the root directory of the file system. When preening, fsck tries to create a lost+found directory.

Action

To create a lost+found directory in the root of the file system, type y at the CREATE prompt. If the lost+found directory cannot be created, fsck displays the message: SORRY. CANNOT CREATE lost+found DIRECTORY and aborts the attempt to link up the lost inode. This error in turn generates the UNREF error message later in phase 4. To abort the attempt to link up the lost inode, type n.


NO SPACE LEFT IN / lost+found (EXPAND)
Cause

There is no space to add another entry to the lost+found directory in the root directory of the file system. When preening, fsck expands the lost+found directory.

Action

To expand the lost+found directory to make room for the new entry, type y at the EXPAND prompt. If the attempted expansion fails, fsck displays the message: SORRY. NO SPACE IN lost+found DIRECTORY and aborts the request to link a file to the lost+found directory. This error generates the UNREF error message later in phase 4. Delete any unnecessary entries in the lost+found directory. This error terminates fsck when preening (-o p option) is in effect. To abort the attempt to link up the lost inode, type n.


UNREF FILE I=inode-number OWNER=UID MODE=file-mode SIZE=file-size 
MTIME=modification-time (RECONNECT)
Cause

File inode inode-number was not connected to a directory entry when the file system was traversed. The owner UID, mode file-mode, size file-size, and modification time modification-time of inode inode-number are displayed. When fsck is preening, the file is cleared if either its size or its link count is zero; otherwise, it is reconnected.

Action

To reconnect inode inode-number to the file system in the lost+found directory, type y. This error may generate the lost+found error message in phase 4 if there are problems connecting inode inode-number to the lost+found directory. To ignore this error condition, type n. This error always invokes the CLEAR error condition in phase 4.


UNREF type I=inode-number OWNER=UID MODE=file-mode SIZE=file-size 
MTIME=modification-time (CLEAR)
Cause

Inode inode-number (whose type is directory or file) was not connected to a directory entry when the file system was traversed. The owner UID, mode file-mode, size file-size, and modification time modification-time of inode inode-number are displayed. When fsck is preening, the file is cleared if either its size or its link count is zero; otherwise, it is reconnected.

Action

To deallocate inode inode-number by zeroing its contents, type y at the CLEAR prompt. To ignore this error condition, type n.


ZERO LENGTH DIRECTORY I=inode-number OWNER=UID MODE=file-mode 
SIZE=file-size MTIME=modification-time(CLEAR)
Cause

A directory entry filename has a size file-size that is zero. The owner UID, mode file-mode, size file-size, modification time modification-time, and directory name filename are displayed.

Action

To deallocate the directory inode inode-number by zeroing out its contents, type y. To ignore the error condition, type n.

Phase 5: Check Cylinder Groups Messages

This phase checks the free-block and used-inode maps. It reports error conditions resulting from:

  • Allocated inodes missing from used-inode maps

  • Free blocks missing from free-block maps

  • Free inodes in the used-inode maps

  • Incorrect total free-block count

  • Incorrect total used inode count

These messages (in alphabetical order) may occur in phase 5:


BLK(S) MISSING IN BIT MAPS (SALVAGE)
Error Message

BLK(S) MISSING IN BIT MAPS (SALVAGE)
Cause

A cylinder group block map is missing some free blocks. During preening, fsck reconstructs the maps.

Action

To reconstruct the free-block map, type y at the SALVAGE prompt. To ignore this error condition, type n.


CG character-for-command-option: BAD MAGIC NUMBER
Cause

The magic number of cylinder group character-for-command-option is wrong. This error usually indicates that the cylinder group maps have been destroyed. When running interactively, the cylinder group is marked as needing reconstruction. fsck terminates if the file system is being preened.

Action

If this occurs, contact your local service provider or another qualified person.


FREE BLK COUNT(S) WRONG IN SUPERBLK (SALVAGE)
Cause

The actual count of free blocks does not match the count of free blocks in the superblock of the file system. If the -o p option was specified, the free-block count in the superblock is fixed automatically.

Action

To reconstruct the superblock free-block information, type y at the SALVAGE prompt. To ignore this error condition, type n.


SUMMARY INFORMATION BAD (SALVAGE)
Cause

The summary information is incorrect. When preening, fsck recomputes the summary information.

Action

To reconstruct the summary information, type y at the SALVAGE prompt. To ignore this error condition, type n.

Cleanup Phase Messages

Once a file system has been checked, a few cleanup functions are performed. The cleanup phase displays the following status messages.


number-of files, number-of-files
used, number-of-files free (number-of frags, number-of blocks, 
percent fragmentation)

This message indicates that the file system checked contains number-of files using number-of fragment-sized blocks, and that there are number-of fragment-sized blocks free in the file system. The numbers in parentheses break the free count down into number-of free fragments, number-of free full-sized blocks, and the percent fragmentation.


***** FILE SYSTEM WAS MODIFIED *****

This message indicates that the file system was modified by fsck. If this file system is mounted or is the current root (/) file system, reboot. If the file system is mounted, you may need to unmount it and run fsck again; otherwise, the work done by fsck may be undone by the in-core copies of tables.


filename FILE SYSTEM STATE SET TO OKAY

This message indicates that file system filename was marked as stable. Use the fsck -m command to determine if the file system needs checking.


filename FILE SYSTEM STATE NOT SET TO OKAY

This message indicates that file system filename was not marked as stable. Use the fsck -m command to determine if the file system needs checking.

source

Map


Visitor Map