LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-27-2017, 03:02 AM   #1
asteroid4u
Member
 
Registered: Jun 2015
Posts: 58

Rep: Reputation: Disabled
Encrypt root partition using cryptsetup


Hi,

I need encrypt root file system. I used below command

cryptsetup -y -v luksFormat /dev/sda1

But i am getting below error.

WARNING!
========
This will overwrite data on /dev/sda1 irrevocably.

Are you sure? (Type uppercase yes): YES
Enter passphrase:
Verify passphrase:
[ 94.408069] alg: No test for fips(ansi_cprng) (fips_ansi_cprng)
Cannot format device /dev/md126p2 which is still in use.
Command failed with code 16: Device or resource busy

Could anyone please help me how to encrypt root file system in linux system.

Thanks,
 
Old 07-27-2017, 04:30 AM   #2
TheEzekielProject
Member
 
Registered: Dec 2016
Distribution: arch
Posts: 668

Rep: Reputation: 190Reputation: 190
There are tons of guides out there with step by step instructions for setting up encryption. I'd recommend you google for one. This error makes it look like your /dev/sda is mounted and it shouldn't be
 
Old 07-27-2017, 04:59 AM   #3
asteroid4u
Member
 
Registered: Jun 2015
Posts: 58

Original Poster
Rep: Reputation: Disabled
I have got tons of links but those are not for root file system encryption. Could you share the link for this? I know that we have to umount the file system to encrypt but for root file system umount is possible?
 
Old 07-27-2017, 05:18 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,125

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Use a liveCD/USB to do it. Encrypting the root is not as straightforward as a data partition as the initrd has to be rebuilt with the cryptsetup included. That is very distro specific.
Of course you will lose everything on that partition as the message warns.
 
Old 07-27-2017, 03:27 PM   #5
TheEzekielProject
Member
 
Registered: Dec 2016
Distribution: arch
Posts: 668

Rep: Reputation: 190Reputation: 190
Have a look at this
 
  


Reply

Tags
cryptsetup, linux



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Identify an encrypted partition by UUID in order to unlock with cryptsetup taylorkh Linux - Security 1 08-24-2016 09:29 AM
How to determine if a cryptsetup-LUKS encrypted partition is working? fanoflq Linux - Newbie 21 04-20-2016 02:06 PM
cryptsetup: WARNING: could not determine root device from /etc/fstab rendezvous123 Ubuntu 4 02-28-2013 07:09 AM
[SOLVED] is this cryptsetup command okay to run as root? oznola Linux - Security 1 01-03-2013 08:01 AM
[Slackware 13.0]Cryptsetup problem with encrypted home partition dlinux Slackware 3 08-29-2009 12:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:44 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