A copy of /boot? (Newb Question)

Discussion in 'all things UNIX' started by NormanN, Oct 28, 2011.

Thread Status:
Not open for further replies.
  1. NormanN

    NormanN Registered Member

    Joined:
    Jan 14, 2011
    Posts:
    67
    I installed 11.04 to an encrypted LVM and used my SD Card for /boot. The SD Card is locked up when not in use. Is it possible to make a copy of the SD Card in case of loss? Or can I create another one once I'm booted into the OS? I assume the encryption key is on there somewhere, because I had another SD Card that was created the exact same way and I got an encryption error when trying to boot from it (everything was identical except the first install had an encrypted /home directory as well...not really needed and extra work for the CPU, so I reinstalled without it).

    Thx,

    NN
     
  2. Mrkvonic

    Mrkvonic Linux Systems Expert

    Joined:
    May 9, 2005
    Posts:
    8,695
    Sure you can. Just dd it to another device.
    Make sure you do it when it is UNMOUNTED.
    E.g.: dd if=/dev/sdcarddevname of=/dev/targetdevdevice bs=4k
    Cheers,
    Mrk
     
  3. x942

    x942 Guest

    The key isn't on there (it's part of the drive header). What probably happened is the copy you made didn't have Cryptsetup in it. By default /boot doesn't load the binaries to start LUKS. I have done this in the past too.

    Quick question:
    Do you know how I can move /boot and my MBR off my computer onto a SD Card? I tried DD but it fails to boot. I already have it installed.
     
  4. NormanN

    NormanN Registered Member

    Joined:
    Jan 14, 2011
    Posts:
    67
    Thanks! So new that I'll have to research even that, but I have a place to start :D

    NN
     
  5. NormanN

    NormanN Registered Member

    Joined:
    Jan 14, 2011
    Posts:
    67
  6. wilbertnl

    wilbertnl Registered Member

    Joined:
    Dec 29, 2004
    Posts:
    1,850
    Location:
    Tulsa, Oklahoma
    This is how I understand your question:
    You boot into the system and want to create a backup of /boot, which currently resides on a flash drive.

    My suggestion:

    (cd /boot && tar -cf - .) | (cd /path-to-empty-backup && tar -xvf -)

    The result is a folder with all the folders and files from /boot.
     
  7. NormanN

    NormanN Registered Member

    Joined:
    Jan 14, 2011
    Posts:
    67
    Yes, thanks! I want to have backup copies in case of loss or damage. So after I run your provided command, I should then be able to boot off of that second device, and enter my encryption key (pass phrase) correct?

    NN
     
Loading...
Thread Status:
Not open for further replies.