Find the answer to your Linux question:
Results 1 to 5 of 5
Started with an initrd.gz of 1.9 MB;used 'extract here' (in mint) to get: initrd; used: gzip -dc /mnt/casper/initrd.gz -id to open the initrd making 'new-initrd.' of 2.7 MB; changing nothing, ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2008
    Posts
    3

    editing initrd.gz


    Started with an initrd.gz of 1.9 MB;used 'extract here' (in mint) to get:
    initrd; used:
    gzip -dc /mnt/casper/initrd.gz -id
    to open the initrd making 'new-initrd.' of 2.7 MB;
    changing nothing, repacked using:
    find . | cpio --quiet --dereference -o -H newc | gzip -9 > ~/new-initrd.gz
    The resulting new initrd.gz was more than thirty megabytes!!!
    What am I missing?;

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Hello and welcome!

    I think b/c you are de-referencing links, and thus copying the files the links point to. Try the cpio command w/o the --dereference flag.

  3. #3
    Just Joined!
    Join Date
    Dec 2008
    Posts
    3
    Quote Originally Posted by atreyu View Post
    Hello and welcome!

    I think b/c you are de-referencing links, and thus copying the files the links point to. Try the cpio command w/o the --dereference flag.
    TNX, but I fgured it out:

    find . | cpio --create --format='newc' > /path/to/target;

    The trick is to execute this line inside the directory where the files to be put in the new initrd(here called target) are. Otherwise, cpio searches
    all over for cpio archives; at one point, I got a target initrd of several gigabytes this way!.

    By the way, when trying to reboot from the initrd, there is no reboot command present; if use 'exit' produces kernel panic("tried to kill init").
    Tried inserting 'reboot' and 'rc.d' which reboot uses into the initrd, but no-go. Is there a simple way to reboot without a cold boot?.

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Dec 2008
    Posts
    3
    To clarify: I am using grub4dos to boot just initrd.gz and vmlinuz;need a way to do a warm-boot from there.

  6. #5
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by truk View Post
    The trick is to execute this line inside the directory where the files to be put in the new initrd(here called target) are. Otherwise, cpio searches
    all over for cpio archives; at one point, I got a target initrd of several gigabytes this way!.
    oh, yeah. i had figured you were in the dir you wanted to archive already. cpio is like tar that way.

    By the way, when trying to reboot from the initrd, there is no reboot command present; if use 'exit' produces kernel panic("tried to kill init").
    Tried inserting 'reboot' and 'rc.d' which reboot uses into the initrd, but no-go. Is there a simple way to reboot without a cold boot?.
    so do you actually have a bash shell then? if so, here's a way to force an immediate reboot:

    Code:
    echo b > /proc/sysrq-trigger

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •