PDA

View Full Version : LVM Boot problems


bschultz
29th April 2007, 23:56
I have a single hard drive in my Debian Etch server. On install, I selected to use LVM with a separate home directory. I tried to add a second internal drive to the server today, and on reboot, it wouldn't boot up. I get an error message saying


/dev/mapper/mail-root does not exist


mail is the hostname of this server. It also says that a uuid device can't be found.

How do I get this machine to boot properly? If that isn't possible, how do I get a backup of the /var/www directory before I do a fresh install of Etch? I don't have a backup of the web directory, yet...that's what the second drive was for!

bschultz
30th April 2007, 04:56
After booting to a recovery CD, I started ssh and tried to backup my websites. Nothing was there. /var/www did not exist!

So, I did a fresh install of Etch...but, how to avoid this from happening again when I try to install the second hard drive?

falko
30th April 2007, 16:03
How did you add the second HDD to LVM?
Did you take a look at this tutorial?

bschultz
30th April 2007, 16:40
I hadn't even gotten that far. All I did was plug in the drive and turn the machine back on. That's when it wouldn't boot. I'll check the how-to section more throughly before I try again to plug in the second drive.

falko
1st May 2007, 21:08
I somehow forgot to post the link... :o
http://www.howtoforge.com/linux_lvm

bschultz
2nd May 2007, 04:36
No I didn't. I actually hadn't found that how-to. Now that I've re-installed (after the problem of no /dev/mapper/mail-root and no websites)...I did the Etch install with LVM configured with separate home directory. Now, when I did the re-install, I had the second drive plugged in. Now, after the install, the drive doesn't show up on the system


mail:~# fdisk -l

Disk /dev/hda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 31 248976 83 Linux
/dev/hda2 32 14593 116969265 5 Extended
/dev/hda5 32 14593 116969233+ 8e Linux LVM

Disk /dev/dm-0: 7168 MB, 7168065536 bytes
255 heads, 63 sectors/track, 871 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-0 doesn't contain a valid partition table

Disk /dev/dm-1: 1786 MB, 1786773504 bytes
255 heads, 63 sectors/track, 217 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-1 doesn't contain a valid partition table

Disk /dev/dm-2: 110.8 GB, 110817705984 bytes
255 heads, 63 sectors/track, 13472 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-2 doesn't contain a valid partition table


Disk 1 (boot disk) is 120 GB
Disk 2 (second drive...not showing) is 80 GB

Any ideas how I should proceed next? Falko, thanks for everything!

falko
2nd May 2007, 16:15
Now, after the install, the drive doesn't show up on the system

If it doesn't show up, you should control alll plugs again. If that doesn't work, it might be a driver problem. What kind of HDD is this?

bschultz
2nd May 2007, 16:28
It's a Western Digital drive. If I pull the plugs and plug them back in, what are the odds of the original problem coming back? I already would have done that, but was trying to not run the threat of having the same problem.

bschultz
8th May 2007, 01:37
I tried to re-seet the plugs, and found the problem. The IDE cable connection came apart in my hands! That might explain why it didn't work. I got a new cable and just went through the back-up how-to, and everything went GREAT. Thanks, Falko. Any chance of a how-to to set this up as a cron with a rotation of the backups to keep 1 or 2 of the backups around?

Thanks again!

falko
8th May 2007, 17:58
Any chance of a how-to to set this up as a cron with a rotation of the backups to keep 1 or 2 of the backups around?

Thanks again!
You mean something like this? http://www.howtoforge.com/linux_lvm_snapshots
You could use a find script like this to rotate the backups:

#!/bin/sh
for file in "$( /usr/bin/find /home/somedir -type f -mtime +2 )"
do
/bin/rm -f $file
done
This will delete all file older than two days, for example.