LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 03-18-2018, 11:19 AM   #1
spoonervt
LQ Newbie
 
Registered: May 2009
Posts: 11

Rep: Reputation: 0
external encrypted USB disk prevents Centos6 booting


I added an external USB disk for storing snapshots and started out with encrypting the disk assuming it would be very easy to walk away with a whole lot of my data.

That works perfectly fine, except for when the system reboots. It gets stuck even before the Centos splash screen is displayed.

If I unplug the disk and wait until the splash screen is shown before I plug it in everything works fine again.

There is nothing on the disk that is required for the boot. There is only one disk in the boot menu (obviously not the encrypted external one) and booting from anything but this one internal HDD is disabled.

Is this a known weakness or can it be fixed - maybe with a work-around like disabling USB during boot altogether and enabling it later -
that allows starting the system with the disk attached?

-Steffen
 
Old 03-18-2018, 11:37 AM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,783

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
If this is the only encrypted disk on the system, edit your GRUB configuration and include "rd_NO_LUKS" in the kernel parameters. The initrd will then no longer probe for LUKS containers.
 
1 members found this post helpful.
Old 03-18-2018, 12:53 PM   #3
spoonervt
LQ Newbie
 
Registered: May 2009
Posts: 11

Original Poster
Rep: Reputation: 0
thanks for the quick reply, but this parameter is already present for all options,
e.g., the default boot option has the following:

(..)
title CentOS (2.6.32-696.20.1.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-696.20.1.el6.x86_64 ro root=/dev/mapper/vg_barebones-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=128M rd_LVM_LV=vg_barebones/lv_swap rd_LVM_LV=vg_barebones/lv_root KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
initrd /initramfs-2.6.32-696.20.1.el6.x86_64.img
(..)

or does it need to be added somewhere else?

(the snippet above is from /boot/grub/grub.conf)

-Steffen

Last edited by spoonervt; 03-18-2018 at 01:09 PM.
 
Old 03-18-2018, 04:35 PM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,783

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
That's strange, because I'm running the same version of CentOS with the same situation (encrypted backup disks) and don't have any problem with booting with the disks connected. (Well, it does mess up my usual sda, sdb, ... assignments, so I generally reboot right away, but my system comes up fine.)

I verified that just now to be sure. System came up fine with a disk with two encrypted partitions powered on.

My grub.conf (line breaks added for readability -- not present in actual file):
Code:
title CentOS (2.6.32-696.23.1.el6.x86_64)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-696.23.1.el6.x86_64 ro root=LABEL=3g-root rd_NO_LUKS LANG=en_US.UTF-8 \
rd_LVM_LV=vg_omega3g/rootvol rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=0  KEYBOARDTYPE=pc \
KEYTABLE=us rd_NO_DM rhgb quiet intel_iommu=on
        initrd /initramfs-2.6.32-696.23.1.el6.x86_64.img
A couple of possibilities come to mind:
  • My disk is partitioned. Is yours by any chance unpartitioned and a whole-disk LUKS volume? I've never tested that.
  • Is there an entry in /etc/crypttab for that volume? There probably should not be.
 
1 members found this post helpful.
Old 03-19-2018, 07:25 AM   #5
spoonervt
LQ Newbie
 
Registered: May 2009
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by rknichols View Post
(...)
A couple of possibilities come to mind:
  • My disk is partitioned. Is yours by any chance unpartitioned and a whole-disk LUKS volume? I've never tested that.
  • Is there an entry in /etc/crypttab for that volume? There probably should not be.
(...)
My drive does not have a partition, I encrypted the entire drive as is. /etc/crypttab is empty.

I'll give it a trial with another drive that is partitioned and encrypted then and update the post when I've done it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Moving LUKS-encrypted USB-disk to new machine Yalla-One Linux - Software 4 12-28-2016 02:16 PM
Booting from encrypted OS installed in USB nishanthame Linux - Security 2 01-25-2011 05:09 AM
Mayday! How do I manually mount my encrypted ext3 external usb disk? simonsharry Linux - Newbie 11 02-15-2009 04:49 AM
Booting Linux from external USB hard disk code_monkey Linux - Hardware 5 03-30-2006 01:54 PM
Encrypted usb external harddrive Ephracis Linux - Security 2 11-10-2005 12:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 03:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration