LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 01-18-2020, 06:32 PM   #1
ulisesgs
LQ Newbie
 
Registered: Jan 2020
Posts: 1

Rep: Reputation: Disabled
recover data from LVM - Logical Volume disk


Hi
I am new in this.
But I created a logical volume in another machine. And I sore information.
Something was wring with that machine that I ave to disconnect physical disk and connected in another machine. But I did not export any logical volume, volume group or Physical group.
I connect disk in another machine; an I can see my phycial volume, volume group even my logical volume; but when I mount Logical volume there is no data in "disk".

this what i did:
root@ugilHomeServ:/dev/disk/by-uuid# lvscan
ACTIVE '/dev/sysvg/lvswap' [16.00 GiB] inherit
ACTIVE '/dev/sysvg/lvroot' [20.00 GiB] inherit
ACTIVE '/dev/sysvg/lvhome' [40.00 GiB] inherit
ACTIVE '/dev/sysvg/lvtmp' [40.00 GiB] inherit
ACTIVE '/dev/sysvg/lvusr' [60.00 GiB] inherit
ACTIVE '/dev/sysvg/lvusr-local' [60.00 GiB] inherit
ACTIVE '/dev/sysvg/lvopt' [80.00 GiB] inherit
ACTIVE '/dev/sysvg/lvvar' [80.00 GiB] inherit
ACTIVE '/dev/sysvg/lvback-sys' [80.00 GiB] inherit
ACTIVE '/dev/sysvg/lvBackUp' [454.57 GiB] inherit
ACTIVE '/dev/virtualsys/win' [100.00 GiB] inherit
ACTIVE '/dev/virtualsys/rhel' [100.00 GiB] inherit
ACTIVE '/dev/virtualsys/centos' [100.00 GiB] inherit
ACTIVE '/dev/virtualsys/fedora' [100.00 GiB] inherit
ACTIVE '/dev/virtualsys/backup' [65.75 GiB] inherit
ACTIVE '/dev/backupsys/lvmusic' [100.00 GiB] inherit
ACTIVE '/dev/backupsys/lvmovies' [100.00 GiB] inherit
ACTIVE '/dev/backupsys/lvpictures' [100.00 GiB] inherit
ACTIVE '/dev/backupsys/lvdocs' [165.75 GiB] inherit

root@ugilHomeServ:/dev/disk/by-uuid# lvchange -ay /dev/backupsys/lvdocs
root@ugilHomeServ:/dev/disk/by-uuid# mkdir /media/lvdocs
root@ugilHomeServ:/dev/disk/by-uuid# mount /dev/backupsys/lvdocs /media/lvdocs
root@ugilHomeServ:/dev/disk/by-uuid#
root@ugilHomeServ:/dev/disk/by-uuid#
root@ugilHomeServ:/dev/disk/by-uuid#
root@ugilHomeServ:/dev/disk/by-uuid# ls -la /media/lvdocs
total 8
drwxr-xr-x 2 root root 4096 dic 31 12:19 .
drwxr-xr-x 4 root root 4096 ene 18 18:12 ..

There is no data!!!!!

root@ugilHomeServ:/dev/disk/by-uuid# df -h
Filesystem Size Used Avail Use% Mounted on
udev 3.9G 0 3.9G 0% /dev
tmpfs 793M 9.5M 784M 2% /run
/dev/sdb1 917G 9.2G 861G 2% /
tmpfs 3.9G 138M 3.8G 4% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sdb5 1.8T 68M 1.7T 1% /kalid
/dev/sdb6 1.8T 68M 1.7T 1% /jenka
/dev/sdb7 905G 72M 859G 1% /jean
/dev/sdb4 1.8T 68M 1.7T 1% /ugil
tmpfs 793M 108K 793M 1% /run/user/1000
/dev/mapper/backupsys-lvdocs 164G 60M 155G 1% /media/lvdocs

Is there a way to recover my data?; is it possible?
 
Old 01-18-2020, 07:27 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
From here, it's impossible to find out what happened.

You could use a filesystem debugger to see if there is anything left. If this is an ext4 filesystem, use debugfs. It's not hard to use, and you will find plenty of tutorials and other info. For xfs, the debugger is xfs_db (a bit less intuitive in my opinion).

By the way, what about the other backupsys volumes?
 
Old 01-19-2020, 09:47 AM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Don't be concerned about the lack of exporting. All that does is make the LVs invisible so that removal of the disk won't come as a surprise to the current system and the LVs won't be seen automatically when the disk is connected to a new system. But, if the filesystems were never unmounted, then data might not have actually been written to the drive. Did you properly shut down that first system, or just "pull the plug" and disconnect the disk? In that case, fsck would see the unclean filesystem, and you might have to use tools like photorec to search for file data in that filesystem.

Another possibility is that the filesystem was not mounted when you were writing the files, and those files were actually stored under the mount point directory.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Recover Data From Striped Logical Volume Group With Failing Drive r00tk1ll Linux - Hardware 28 05-05-2016 08:46 AM
LVM Mount Physical Volume/Logical Volume without a working Volume Group mpivintis Linux - Newbie 10 01-11-2014 07:02 AM
Data recovery from missing LVM logical volume kta Linux - Software 2 07-20-2013 06:07 PM
Extended LVM Volume group and Logical Volume. But space not usable linuxlover.chaitanya Linux - Server 1 11-19-2012 09:37 AM
can't recover LVM volume: Please specify a *single* volume group to restore SoftDux Linux - General 1 08-04-2011 03:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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