Re: remove /boot by mistake, /,/usr and /home on partitions with LVM and crypt



On Sat, May 3, 2008 at 5:21 PM, Yahong Chen <tsyjcyh@xxxxxxxxx> wrote:

Hi,

A lap-top with two OSes: WindowsXP and Debian/Linux R4.0 Ecth. Under
Debian, I removed all the sub directories and files of /boot by
mistake, and want to rescue the system. The hard disk partitions of
the interest system on is

##BEGIN
Disk /dev/hda: 60.0 GB, 60011642880 bytes
255 heads, 63 sectors/track, 7296 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 1084 8707198+ 7 HPFS/NTFS
/dev/hda2 1085 2016 7486290 83 Linux
/dev/hda3 2017 2028 96390 83 Linux
/dev/hda4 2029 7296 42315210 5 Extended
/dev/hda5 2029 2150 979933+ 8e Linux LVM
/dev/hda6 2151 2393 1951866 83 Linux
/dev/hda7 2394 3366 7815591 83 Linux
/dev/hda8 3367 3731 2931831 8e Linux LVM
/dev/hda9 3732 5555 14651248+ 8e Linux LVM
/dev/hda10 5556 5682 1020096 8e Linux LVM
/dev/hda11 5683 5810 1028128+ 8e Linux LVM
/dev/hda12 5811 5937 1020096 8e Linux LVM
/dev/hda13 5938 7296 10916136 b W95 FAT32
##END

and /etc/fstab:

##BEGIN
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/mapper/hda6_crypt / reiserfs notail 0 1
/dev/hda3 /boot reiserfs notail 0 2
/dev/mapper/hda7_crypt /usr reiserfs defaults 0 2
/dev/mapper/home_crypt /home ext3 defaults 0 0
/dev/mapper/swap_crypt none swap sw 0 0
/dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/hda2 /mnt/multimedia reiserfs defaults 0
2
/dev/vgresource/lvresource /mnt/resource ext3 defaults 0
2
#/dev/hda1 /mnt/hda1 ntfs defaults 0 0
/dev/hda13 /mnt/hda13 vfat
iocharset=utf8,rw,auto,user,umask=0 0 0
##END

and /etc/crypttab:

##BEGIN
hda6_crypt /dev/hda6 none luks
swap_crypt /dev/vgswap/lvswap /dev/random swap
hda7_crypt /dev/hda7 none luks
home_crypt /dev/vghome/lvhome none luks
##END

where the PVs of vghome are hda8, hda10, hda11 and hda12. The PV(s) of
vgresource are hda9.

I tried to make a new installation of basic Debian/Linux system on
another hard disk and attached the hard disk which the broken system
on as a mobile hard disk (use USB line). The sub-directories and
files of /boot of the new system were copied to the corresponding
place of old one and reinstalled GRUB on the hard disk and modified
device.map and menu.1st. After doing so, boot from the hard disk, the
last screen display gives:

##BEGIN
Begin: Mounting root file system ... ...
Begin: Running /scripts/local-top ... ...
device-mapper: ioctl: 4.7.0 - ioctl (2006-06-24) initialised:
dm-devel@xxxxxxxxxx
Done
Begin: Waiting for root filesystem ... ...
Done
Check root= bootarg cat /proc/cmdline
or missing modules, devices: cat /proc/modules ls /dev
ALERT! /dev/mapper/hda6_crypt does not exist. Dropping to a shell


BusyBox v1.1.3 (Debian 1:1.1.3-4) Built-in shell (ash)
Enter 'help' for a list of built-in commands

/bin/sh: can't access tty; job control turned off
(initramfs) _
##END

What should I do next? Thanks in advance!

PS:
1. Though I could access most files even those on the crypted
partitions of the broken system and now I have another new system, I
really want to rescue and use the old one.
2. After I mistakenly 'rm -r /boot' on the old system, I've tried
several rescue ways:
1). undelete: remount /dev/hda3 readonly,
# debugfs /dev/hda3
debugfs 1.40-WIP (14-Nov-2006)
/dev/hda3: Bad magic number in super-block while opening
filesystem
debugfs: lsdel
lsdel: Filesystem not open
debugfs: open /dev/hda3
/dev/hda3: Bad magic number in super-block while opening
filesystem
debugfs:
Then I gave up. And try
2). reinstall kernel using "synaptic", the machine halted at the
last
minute because overheat (almost complete the kernel reinstallation.
:-( old computer, about 5 years, CPU is AMD Athlon 1800+ Mobile).


--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact
listmaster@xxxxxxxxxxxxxxxx


there might be a way to fix it. but it is not going to be easy. the best way
to do is
to make a new install. as long as the data is there. it should be ok for me
=)


Relevant Pages

  • remove /boot by mistake, /,/usr and /home on partitions with LVM and crypt
    ... WindowsXP and Debian/Linux R4.0 Ecth. ... another hard disk and attached the hard disk which the broken system ... Waiting for root filesystem ... ... debugfs 1.40-WIP ...
    (Debian-User)
  • Re: Lost root password
    ... Assuming your root filesystem is vxfs, ... Mount the root filesystem of the hard disk; ...
    (comp.unix.unixware.misc)
  • Re: update CE application during runtime
    ... distributing it on the hard disk itself. ... root of the filesystem. ... will be used the next time it's executed in place of the ROM ... "path" includes a folder on this flash filesystem. ...
    (microsoft.public.windowsce.app.development)
  • Re: cloning a FreeBSD HDD
    ... possible just to dump a filesystem to a different hard disk i.e. ... But /dev/ad2 will have a dumpfile on it, not a filesystem. ... boot0sio or mbr is located in absolute sector 0 of the disk. ... a partition starts at the start of the slice to be confusing) with the ...
    (freebsd-hackers)
  • Re: Change owner and permissions for second hard disk
    ... >>What filesystem are you using for the second hard disk? ... > my first hard disk and to replace it with a windows 98 disk. ... Either grants the group users read/write to the vfat partition/disk. ...
    (comp.os.linux)