initramfs problem when out of disk space

1,514

Solution 1

100MB is sufficient for 2 kernels and a init ramdisk. You can view your current installed kernels by executing:

dpkg -l 'linux-image-*' | grep '^ii'

Example output:

ii  linux-image-2.6.35-28-generic        2.6.35-28.50                               Linux kernel image for version 2.6.35 on x86/x86_64
ii  linux-image-2.6.38-8-generic         2.6.38-8.42                                Linux kernel image for version 2.6.38 on x86/x86_64
ii  linux-image-generic                  2.6.38.8.22                                Generic Linux kernel image

After confirming that the latest kernel works, you can remove the previous ones. In this case, there is only one redundant kernel:

sudo apt-get purge linux-image-2.6.35-28-generic

If this process does not complete because of previous installation triggers, try adding -f (--fix-broken) before purge.

Solution 2

I'd suggest seeing what is taking up space in /boot/:

find /boot/ -type f | xargs du | sort -n

Then, if you find large consumers of space, you can see which package they're from:

dpkg -S /boot/some-large-file

And if that package is no longer needed, you can remove it. However, be very careful to not remove stuff that you need - particularly the bootloader (grub), and the currently-running kernel.

Share:
1,514

Related videos on Youtube

JM4
Author by

JM4

Updated on September 18, 2022

Comments

  • JM4
    JM4 almost 2 years

    I have a php script which looks for the openssl directory and encrypts customer data I have.

    When I upload the script to my online linux directory - the encryption works fine

    #private key file to use
    $MY_KEY_FILE = "my-prvkey.pem";
    
    #public certificate file to use
    $MY_CERT_FILE = "my-pubcert.pem";
    
    # Paypal's public certificate
    $PAYPAL_CERT_FILE = "paypal_cert_sandbox.pem";
    
    # path to the openssl binary
    $OPENSSL = "/usr/bin/openssl";
    

    When I try and run the same command on my Windows machine which runs XAMPP currently, I am unable to encrypt anything. Anybody else had this problem?

    I would MUCH rather update and test locally than have to ftp a file every time I make a change during our build.

    EDIT

    I do realize the directory above is mainly for linux; however even when I point the directory to the openssl directory within the XAMPP folder (for me at: C:\xampp\apache\bin) the operation fails.

    EDIT 2

    When I say "unable to encrypt" I mean, NOTHING is returned (i.e. the public keys are clearly not finding the openssl .dll files) even though they ARE pointed to the correct directory. There are no error messages. Configuration differences? One is linux server, one is windows local machine.

    In my script, I include the following:

    <?php
    function paypal_encrypt($hash) {
        global $MY_KEY_FILE;
        global $MY_CERT_FILE;
        global $PAYPAL_CERT_FILE;
        global $OPENSSL;
    
        if (!file_exists($MY_KEY_FILE)) {
            echo "ERROR: MY_KEY_FILE $MY_KEY_FILE not found\n"; }
        if (!file_exists($MY_CERT_FILE)) {
            echo "ERROR: MY_CERT_FILE $MY_CERT_FILE not found\n"; }
        if (!file_exists($PAYPAL_CERT_FILE)) {
            echo "ERROR: PAYPAL_CERT_FILE $PAYPAL_CERT_FILE not found\n"; }
        if (!file_exists($OPENSSL)) {
            echo "ERROR: OPENSSL $OPENSSL not found\n"; }
    
        $openssl_cmd = "$OPENSSL smime -sign -signer $MY_CERT_FILE -inkey $MY_KEY_FILE " . "-outform der -nodetach -binary | $OPENSSL smime -encrypt " . "-des3 -binary -outform pem $PAYPAL_CERT_FILE";
    
        $descriptors = array( 0 => array("pipe", "r"), 1 => array("pipe", "w"), );
        $process = proc_open($openssl_cmd, $descriptors, $pipes);
    
        if (is_resource($process)) {
            foreach ($hash as $key => $value) {
                if ($value != "") {
                    fwrite($pipes[0], "$key=$value\n");
                    }
            }
            fflush($pipes[0]);
            fclose($pipes[0]); 
            $output = ""; 
    
            while (!feof($pipes[1])) {
                $output .= fgets($pipes[1]); }
    
                fclose($pipes[1]);
                $return_value = proc_close($process);
                return $output;
        }
    
        return "ERROR"; }
    ?> 
    

    On my windows machine AND the linux machine "Error: OPENSSL not found" is displayed (even though on the linux hosted server the encryption completes anyway). I can remove the line on my windows machine by simply putting C:\xampp\apache\bin\openssl.exe but this still does not do any encrypting).

    • Marc B
      Marc B almost 14 years
      What does "unable to encrypt" mean? You just get the original plaintext? You get garbage? Have you looked for error messages? Have you checked for configuration differences? Is your XAMPP able to find the opensll .dll's? Is your webserver able to read them? You don't give enough details to help.
  • JM4
    JM4 almost 14 years
    tried both before and no results. Still nothing being encrypted for some reason - no error given in logs or on site.
  • user3403
    user3403 about 13 years
    On purging each old kernel it gave the same error as I posted above.
  • Sridhar Ratnakumar
    Sridhar Ratnakumar about 11 years
    using -f (force operation) does not help at all.
  • stew
    stew about 11 years
    -f doesn't mean force anyway