Mount an ISO made with dd if=/dev/sda2 of=/backups/backup.iso
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I was not able to find the rootfs type in "man mount". Even if this worked, how would you get your volumes without telling LVM about them? Maybe dd out to another drive and boot from it?
I may be wrong but from the code that you present it appears that you have failed to direct the output 'of=' to /dev/sdb1 your output command should be of=/dev/sdb1/backups/backup.iso.
I don't understand why you are using the extension '.iso' since this is a file system for CDs and DVDs and I would suspect that both your sda1 and sdb1 are formatted as ext3 or ext4. The 'normal' use of the 'dd' command is to name the output file as a '.image' file, not that it makes any difference, in linux, what the file ending is - it is the first characters of a file that determine what or how the file can be read.
So unfortunately it appears that you have written, or at least tried to write 250GB to a file on your sda drive. I somehow doubt that you were successful since even if it worked it would have taken about 2 and 1/2 hours minimum.
If you seriously want to duplicate (clone) your sda drive to a file on your sdb drive then I would suggest that you boot your machine with a liveCD so that your sda drive is not mounted.
By the way what distro are your using, and does it still boot.
You can not mount an entire disk image since it can not deal with the MBR/partition table. However you can ignore it by offseting the number of bytes. I've never tried to mount an LVM as a loopback device but this post looks like it might work. Trying to mount a volume group with the same name might cause problems.
Our distro:
[root@ vm]# cat /etc/redhat-release
CentOS release 5.4 (Final)
[root@ vm]#
[root@ vm]# uname -a
Linux 2.6.18-164.11.1.el5.centos.plus #1 SMP Wed Jan 20 18:49:35 EST 2010 x86_64 x86_64 x86_64 GNU/Linux
[root@ vm]#
It's everything working well (machine is booting well) except I can't get a VMWare disk (from ISO) I deleted by mistake (from sda). We have a little old manual backup of that VM disk and it is already running but we have several specific oracle and informix configurations made last week on that VM and we didn't made an howto yet, so we are trying not to loose all week work. ISO backup is made every night. Unfortunatly this backup solution kind is recent for me, so I never tried to restore it before... I know it is a big mistake not to try it before, but its the truth.
Now I'm running another dd command every day and already tested it well (dd if=/dev/VolGroup00/LogVol00 of=/backups/backup.work.partition.iso)
This way we have all working structure available in seconds with mount -o loop ./backup.work.partition.iso /mnt/iso
[root@ vm]# ls -la /mnt/iso
total 236
drwxr-xr-x 27 root root 4096 Feb 26 11:08 .
drwxr-xr-x 4 root root 4096 Feb 26 15:30 ..
-rw------- 1 root root 13 Feb 26 11:07 .asterisk_history
-rw-r--r-- 1 root root 0 Feb 26 11:08 .autofsck
-rw-r--r-- 1 root root 0 Oct 26 09:25 .autorelabel
drwxr-xr-x 5 root root 4096 Oct 24 11:06 BACKUP
drwxr-xr-x 2 root root 4096 Jan 22 23:22 backups
drwxr-xr-x 2 root root 4096 Feb 6 06:44 bin
drwxr-xr-x 2 root root 4096 Jan 2 2002 boot
drwxr-xr-x 4 root root 4096 Jan 2 2002 dev
drwxr-xr-x 97 root root 12288 Feb 26 17:00 etc
drwxr-xr-x 8 root root 4096 Dec 15 12:14 home
drwxr-xr-x 11 root root 4096 Feb 11 23:39 lib
drwxr-xr-x 7 root root 4096 Feb 11 23:39 lib64
drwx------ 2 root root 16384 Jan 2 2002 lost+found
drwxr-xr-x 2 root root 4096 Mar 11 2009 media
drwxr-xr-x 2 root root 4096 Jan 21 2009 misc
drwxr-xr-x 4 root root 4096 Feb 26 15:30 mnt
dr-xr-xr-x 2 root root 4096 Jan 17 2002 net
drwxr-xr-x 4 root root 4096 Dec 16 11:15 opt
drwxr-xr-x 2 root root 4096 Jan 2 2002 proc
drwxr-x--- 10 root root 4096 Feb 26 17:00 root
drwxr-xr-x 2 root root 12288 Feb 6 06:44 sbin
drwxr-xr-x 2 root root 4096 Jan 2 2002 selinux
drwxr-xr-x 2 root root 4096 Mar 11 2009 srv
drwxr-xr-x 2 root root 4096 Jan 2 2002 sys
drwxrwxrwt 9 root root 4096 Feb 26 17:00 tmp
drwxr-xr-x 15 root root 4096 Jan 2 2002 usr
drwxr-xr-x 23 root root 4096 Jan 1 22:38 var
drwxr-xr-x 2 root root 4096 Dec 10 19:28 .vmware
[root@ vm]#
minrich, /backups/backup.iso points to /dev/sdb1 (/dev/sdb1 /backups ext3 defaults 1 2). This way we are making a copy of /dev/sda2 to /dev/sdb1 (at least I thought...).
michaelk, the article seems what I need. Why do you say "Trying to mount a volume group with the same name might cause problems."? Do you think I should test to mount it on another machine?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.