LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 10-21-2010, 06:24 AM   #16
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,604

Rep: Reputation: 446Reputation: 446Reputation: 446Reputation: 446Reputation: 446

Hi,

here is another procedure. I assume you used the alternate installer and used lvm to create an encrypted root and swap partition.
1.) Boot from the liveCD and become root by typing into a terminal
Code:
sudo -i
2.) Install some tools (You will need internet access for this to work)
Code:
aptitude install cryptsetup lvm2
3.) Assuming that /dev/sda7 is the partition that holds your encrypted filesystem
Code:
cryptsetup luksOpen /dev/sda7 sda7_crypt
You should be asked for your passphrase now. Enter it. If everything went well it should display something like
Code:
Key slot 0 unlocked.
4.) Make your logical volumes visible
Code:
vgchange -a y
The result should be something like
Code:
2 logical volume(s) in volume group "ubuntu" now active
Enter the following
Code:
ls /dev/ubuntu/
It should list the names of the logical volumes. One of them should be named root or so.
5.) Mount the logical volume named root.
Code:
mount /dev/ubuntu/root /mnt
If everything went Ok, then you should be able to access your files in /mnt. After you have copied your files to a secure location (thumbdrive, external harddisk... just not to the temporary filesystem of the liveuser) you can unmount everything and close the encrypted drive.
Code:
sync
umount /mnt
vgchange -a n
cryptsetup luksClose sda7_crypt
That should be it. If your setup varies or if any of the command fails post exactly what you have typed with the corresponding output up to the command that failed.

Hope this helps.

Last edited by crts; 10-21-2010 at 09:31 AM.
 
Old 10-21-2010, 02:03 PM   #17
shikhar623
LQ Newbie
 
Registered: Oct 2010
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by crts View Post
Hi,

here is another procedure. I assume you used the alternate installer and used lvm to create an encrypted root and swap partition.
1.) Boot from the liveCD and become root by typing into a terminal
Code:
sudo -i
2.) Install some tools (You will need internet access for this to work)
Code:
aptitude install cryptsetup lvm2
3.) Assuming that /dev/sda7 is the partition that holds your encrypted filesystem
Code:
cryptsetup luksOpen /dev/sda7 sda7_crypt
You should be asked for your passphrase now. Enter it. If everything went well it should display something like
Code:
Key slot 0 unlocked.
4.) Make your logical volumes visible
Code:
vgchange -a y
The result should be something like
Code:
2 logical volume(s) in volume group "ubuntu" now active
Enter the following
Code:
ls /dev/ubuntu/
It should list the names of the logical volumes. One of them should be named root or so.
5.) Mount the logical volume named root.
Code:
mount /dev/ubuntu/root /mnt
If everything went Ok, then you should be able to access your files in /mnt. After you have copied your files to a secure location (thumbdrive, external harddisk... just not to the temporary filesystem of the liveuser) you can unmount everything and close the encrypted drive.
Code:
sync
umount /mnt
vgchange -a n
cryptsetup luksClose sda7_crypt
That should be it. If your setup varies or if any of the command fails post exactly what you have typed with the corresponding output up to the command that failed.

Hope this helps.
Step 2 did not work
Screenshot5.png
instead i used
Quote:
apt-get install cryptsetup lvm2
the code is as follows:
Quote:
ubuntu@ubuntu:~$ sudo -i
root@ubuntu:~# aptitude install cryptsetup lvm2
The program 'aptitude' can be found in the following packages:
* aptitude
* aptitude-gtk (You will have to enable component called 'universe')
Try: apt-get install <selected package>
root@ubuntu:~# aptitude install cryptsetup lvm2
The program 'aptitude' can be found in the following packages:
* aptitude
* aptitude-gtk
Try: apt-get install <selected package>
root@ubuntu:~# aptitude install cryptsetup lvm2
The program 'aptitude' can be found in the following packages:
* aptitude
* aptitude-gtk
Try: apt-get install <selected package>
root@ubuntu:~# aptitude install cryptsetup lvm2
The program 'aptitude' can be found in the following packages:
* aptitude
* aptitude-gtk
Try: apt-get install <selected package>
root@ubuntu:~# apt-get install cryptsetup lvm2
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
root@ubuntu:~# apt-get install cryptsetup lvm2
Reading package lists... Done
Building dependency tree
Reading state information... Done
cryptsetup is already the newest version.
The following extra packages will be installed:
libdevmapper-event1.02.1 watershed
The following NEW packages will be installed:
libdevmapper-event1.02.1 lvm2 watershed
0 upgraded, 3 newly installed, 0 to remove and 14 not upgraded.
2 not fully installed or removed.
Need to get 446kB of archives.
After this operation, 1,278kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://archive.ubuntu.com/ubuntu/ maverick/main libdevmapper-event1.02.1 i386 2:1.02.39-1ubuntu6 [27.3kB]
Get:2 http://archive.ubuntu.com/ubuntu/ maverick/main watershed i386 5 [10.7kB]
Get:3 http://archive.ubuntu.com/ubuntu/ maverick/main lvm2 i386 2.02.54-1ubuntu6 [408kB]
Fetched 446kB in 22s (19.5kB/s)
Selecting previously deselected package libdevmapper-event1.02.1.
(Reading database ... 124563 files and directories currently installed.)
Unpacking libdevmapper-event1.02.1 (from .../libdevmapper-event1.02.1_2%3a1.02.39-1ubuntu6_i386.deb) ...
Selecting previously deselected package watershed.
Unpacking watershed (from .../archives/watershed_5_i386.deb) ...
Selecting previously deselected package lvm2.
Unpacking lvm2 (from .../lvm2_2.02.54-1ubuntu6_i386.deb) ...
Processing triggers for man-db ...
Setting up initramfs-tools (0.98.1ubuntu6) ...
update-initramfs: deferring update (trigger activated)
cp: cannot stat `/vmlinuz': No such file or directory
dpkg: error processing initramfs-tools (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up bcmwl-kernel-source (5.60.48.36+bdcom-0ubuntu5) ...
Removing old bcmwl-5.60.48.36+bdcom DKMS files...

-------- Uninstall Beginning --------
Module: bcmwl
Version: 5.60.48.36+bdcom
Kernel: 2.6.35-22-generic (i686)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

wl.ko:
- Uninstallation
- Deleting from: /lib/modules/2.6.35-22-generic/updates/dkms/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.

depmod....

DKMS: uninstall Completed.

------------------------------
Deleting module version: 5.60.48.36+bdcom
completely from the DKMS tree.
------------------------------
Done.
Loading new bcmwl-5.60.48.36+bdcom DKMS files...
First Installation: checking all kernels...
Building only for 2.6.35-22-generic
Building for architecture i686
Building initial module for 2.6.35-22-generic
Done.

wl.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/2.6.35-22-generic/updates/dkms/

depmod....

DKMS: install Completed.
update-initramfs: deferring update (trigger activated)
ffcp: cannot stat `/vmlinuz': No such file or directory
dpkg: error processing bcmwl-kernel-source (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up libdevmapper-event1.02.1 (2:1.02.39-1ubuntu6) ...
dpkg: dependency problems prevent configuration of watershed:
watershed depends on initramfs-tools; however:
Package initramfs-tools is not configured yet.
dpkg: error processing watershed (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of lvm2:
lvm2 depends on watershed (>= 2); however:
Package watershed is not configured yet.
dpkg: error processing lvm2 (--configure):
dependency problems - leaving unconfigured
Processing triggers for libc-bin ...
No apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because MaxReports is reached already
ldconfig deferred processing now taking place
Errors were encountered while processing:
initramfs-tools
bcmwl-kernel-source
watershed
lvm2
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@ubuntu:~# cryptsetup luksOpen /dev/sda7 sda7_crypt
Device /dev/sda7 is not a valid LUKS device.
root@ubuntu:~# aptitude install cryptsetup lvm2
The program 'aptitude' can be found in the following packages:
* aptitude
* aptitude-gtk
Try: apt-get install <selected package>
root@ubuntu:~# clear

root@ubuntu:~# aptitude install cryptsetup lvm2
The program 'aptitude' can be found in the following packages:
* aptitude
* aptitude-gtk
Try: apt-get install <selected package>
root@ubuntu:~# apt-get install cryptsetup lvm2
Reading package lists... Done
Building dependency tree
Reading state information... Done
cryptsetup is already the newest version.
lvm2 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 14 not upgraded.
4 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Do you want to continue [Y/n]? y
Setting up initramfs-tools (0.98.1ubuntu6) ...
update-initramfs: deferring update (trigger activated)
cp: cannot stat `/vmlinuz': No such file or directory
dpkg: error processing initramfs-tools (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up bcmwl-kernel-source (5.60.48.36+bdcom-0ubuntu5) ...
Removing old bcmwl-5.60.48.36+bdcom DKMS files...

-------- Uninstall Beginning --------
Module: bcmwl
Version: 5.60.48.36+bdcom
Kernel: 2.6.35-22-generic (i686)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

wl.ko:
- Uninstallation
- Deleting from: /lib/modules/2.6.35-22-generic/updates/dkms/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.

depmod....

DKMS: uninstall Completed.

------------------------------
Deleting module version: 5.60.48.36+bdcom
completely from the DKMS tree.
------------------------------
Done.
Loading new bcmwl-5.60.48.36+bdcom DKMS files...
First Installation: checking all kernels...
Building only for 2.6.35-22-generic
Building for architecture i686
Building initial module for 2.6.35-22-generic
Done.

wl.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/2.6.35-22-generic/updates/dkms/

depmod....

DKMS: install Completed.
update-initramfs: deferring update (trigger activated)
cp: cannot stat `/vmlinuz': No such file or directory
dpkg: error processing bcmwl-kernel-source (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of watershed:
watershed depends on initramfs-tools; however:
Package initramfs-tools is not configured yet.
dpkg: error processing watershed (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of lvm2:
lvm2 depends on watershed (>= 2); however:
Package watershed is not configured yet.
dpkg: error processing lvm2 (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because MaxReports is reached already
Errors were encountered while processing:
initramfs-tools
bcmwl-kernel-source
watershed
lvm2
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@ubuntu:~#
what next?
 
Old 10-21-2010, 02:34 PM   #18
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,604

Rep: Reputation: 446Reputation: 446Reputation: 446Reputation: 446Reputation: 446
I was assuming that /dev/sda7 was your encrypted device. As it seems /dev/sda7 is not encrypted. If you want to mount /dev/sda7 just do
Code:
sudo -i
mount /dev/sda7 /mnt
If /dev/sda7 is not what you are looking for then do the following
Code:
sudo -i
for f in /dev/sd*; do cryptsetup isLuks "${f}" && echo "${f}"; done
This will print all encrypted harddisks. Post the result before you continue.

Last edited by crts; 10-21-2010 at 02:36 PM.
 
Old 10-21-2010, 03:00 PM   #19
shikhar623
LQ Newbie
 
Registered: Oct 2010
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by crts View Post
I was assuming that /dev/sda7 was your encrypted device. As it seems /dev/sda7 is not encrypted. If you want to mount /dev/sda7 just do
Code:
sudo -i
mount /dev/sda7 /mnt
If /dev/sda7 is not what you are looking for then do the following
Code:
sudo -i
for f in /dev/sd*; do cryptsetup isLuks "${f}" && echo "${f}"; done
This will print all encrypted harddisks. Post the result before you continue.
it gets mounted but i am not able to open USERNAME folder.
http://img209.imageshack.us/i/screenshot6xh.png/
 
Old 10-21-2010, 03:06 PM   #20
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,604

Rep: Reputation: 446Reputation: 446Reputation: 446Reputation: 446Reputation: 446
That is probably because you are opening nautilus a normal user.
Try as root
Code:
nautilus
BTW, it does not seem like you have any encrypted disks.
 
Old 10-21-2010, 03:22 PM   #21
shikhar623
LQ Newbie
 
Registered: Oct 2010
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by crts View Post
That is probably because you are opening nautilus a normal user.
Try as root
Code:
nautilus
BTW, it does not seem like you have any encrypted disks.
the USERNAME got opened with NAUTILUS.
but the USERNAME directory contains ony two files.
i mean there is no Desktop,Documents, ....in the USERNAME folder.as shown in the shreenshot.
http://img301.imageshack.us/img301/7...reenshotxx.png

Last edited by shikhar623; 10-21-2010 at 03:25 PM.
 
Old 10-21-2010, 03:44 PM   #22
fbobraga
Member
 
Registered: Jul 2010
Location: São Paulo - Brasil
Distribution: Debian 7 / Crunchbang 11
Posts: 229

Rep: Reputation: 41
Quote:
Originally Posted by shikhar623 View Post
the USERNAME got opened with NAUTILUS.
but the USERNAME directory contains ony two files.
i mean there is no Desktop,Documents, ....in the USERNAME folder.as shown in the shreenshot.
http://img301.imageshack.us/img301/7...reenshotxx.png
as said, nautilus need to be open as root to access the /home/USERNAME - open it in the shell (not by the menu!) issuing the command:
Code:
sudo nautilus
(as instructed, issuing just the command nautilus after the sudo -i, in the same shell/terminal, is equivalent to it - note the change of "$" to "#" after the sudo -i command: this shows that the next commands will be run by the user root [in the LiveCD password isn't asked to issue sudo])

Last edited by fbobraga; 10-21-2010 at 03:55 PM.
 
Old 10-21-2010, 03:50 PM   #23
shikhar623
LQ Newbie
 
Registered: Oct 2010
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by fbobraga View Post
as said, nautilus need to be open as root to access the /home/USERNAME - open it in the shell (not by the menu!) issuing the command:
Code:
sudo nautilus
(issuing just the command nautilus after the sudo -i, in the same shell, is equivalent to it)
i did the same way. opened nautilus from the same terminal as root.
 
Old 10-21-2010, 03:53 PM   #24
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,604

Rep: Reputation: 446Reputation: 446Reputation: 446Reputation: 446Reputation: 446
Quote:
Originally Posted by shikhar623 View Post
the USERNAME got opened with NAUTILUS.
but the USERNAME directory contains ony two files.
i mean there is no Desktop,Documents, ....in the USERNAME folder.as shown in the shreenshot.
http://img301.imageshack.us/img301/7...reenshotxx.png
Now that looks like you did not do an encrypted install, but only encrypted your 'home' directory.
 
Old 10-21-2010, 03:54 PM   #25
shikhar623
LQ Newbie
 
Registered: Oct 2010
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by crts View Post
Now that looks like you did not do an encrypted install, but only encrypted your 'home' directory.
now how can i open the encrypted HOME Dir.?
 
Old 10-21-2010, 04:00 PM   #26
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,604

Rep: Reputation: 446Reputation: 446Reputation: 446Reputation: 446Reputation: 446
I am not sure if this will work since I never encrypt my /home. I always encrypt the whole disk. You could try the following as root
Code:
mount --bind /dev /mnt/dev
mount -t devpts devpts /mnt/dev/devpts
mount -t tmpfs shm /mnt/dev/shm
mount -t proc proc /mnt/proc
mount -t sysfs sys /mnt/sys
chroot /mnt
mount /home
Before you try to mount you might need to issue
Code:
/etc/init.d/cryptdisks start
Exit the chroot environment
Code:
exit
 
Old 10-21-2010, 04:06 PM   #27
fbobraga
Member
 
Registered: Jul 2010
Location: São Paulo - Brasil
Distribution: Debian 7 / Crunchbang 11
Posts: 229

Rep: Reputation: 41
this may help: https://help.ubuntu.com/community/En...ata%20Manually

or http://ubuntuforums.org/showthread.php?t=1337693

Last edited by fbobraga; 10-21-2010 at 04:18 PM.
 
Old 10-21-2010, 04:31 PM   #28
shikhar623
LQ Newbie
 
Registered: Oct 2010
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by crts View Post
I am not sure if this will work since I never encrypt my /home. I always encrypt the whole disk. You could try the following as root
Code:
mount --bind /dev /mnt/dev
mount -t devpts devpts /mnt/dev/devpts
mount -t tmpfs shm /mnt/dev/shm
mount -t proc proc /mnt/proc
mount -t sysfs sys /mnt/sys
chroot /mnt
mount /home
Before you try to mount you might need to issue
Code:
/etc/init.d/cryptdisks start
Exit the chroot environment
Code:
exit
http://img41.imageshack.us/img41/2705/screenshot2ae.png
the first command did not work.
 
Old 10-21-2010, 04:35 PM   #29
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,604

Rep: Reputation: 446Reputation: 446Reputation: 446Reputation: 446Reputation: 446
Quote:
Originally Posted by shikhar623 View Post
I was assuming that /dev/sda7 is mounted on /mnt. Replace /mnt with whereever you mounted /dev/sda7.
You might want to also check out the link provided by fbobraga.
 
Old 10-21-2010, 04:42 PM   #30
shikhar623
LQ Newbie
 
Registered: Oct 2010
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by crts View Post
I am not sure if this will work since I never encrypt my /home. I always encrypt the whole disk. You could try the following as root
Code:
mount --bind /dev /mnt/dev
mount -t devpts devpts /mnt/dev/devpts
mount -t tmpfs shm /mnt/dev/shm
mount -t proc proc /mnt/proc
mount -t sysfs sys /mnt/sys
chroot /mnt
mount /home
Before you try to mount you might need to issue
Code:
/etc/init.d/cryptdisks start
Exit the chroot environment
Code:
exit
having problem in last command "mount /home"
returns an error.do i need to edit /etc/fstab file?
http://img686.imageshack.us/img686/5...eenshot3xi.png
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
recover data from ext3 partition wolfgangsz Linux - General 1 12-30-2009 09:47 PM
Recover data on ext3 partition on Ubuntu IMNOboist Linux - Hardware 1 04-26-2009 08:48 AM
Recover encrypted LUKS partition itinlopez Linux - General 3 11-30-2008 02:20 AM
How to Recover Data from an ext3 partition harikrishnan81 Linux - Hardware 1 06-27-2008 05:54 AM
How to recover Data from LVM+ext3 partition ? neel.gurjar Linux - Server 3 06-20-2008 04:54 PM


All times are GMT -5. The time now is 12:57 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration