FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 05-03-2008, 09:21 AM
"Yahong Chen"
 
Default remove /boot by mistake, /,/usr and /home on partitions with LVM and crypt

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@redhat.com
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@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 05-03-2008, 12:07 PM
paragasu
 
Default 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@gmail.com> 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@redhat.com

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@lists.debian.org

with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org




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 =)
 
Old 05-03-2008, 03:46 PM
Pigeon
 
Default remove /boot by mistake, /,/usr and /home on partitions with LVM and crypt

On Sat, May 03, 2008 at 05:21:08PM +0800, Yahong Chen wrote:
> 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.

That won't work, you need to regenerate an initrd that matches the
system you're trying to boot with it. Boot the broken system in
rescue mode, chroot to it and reinstall the kernel, that should
do it.

--
Pigeon

Be kind to pigeons
Pigeon's Nest - http://pigeonsnest.co.uk/
Lucy Pinder Television - http://www.lucy-pinder.tv/
GPG key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x21C61F7F
 

Thread Tools




All times are GMT. The time now is 07:44 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org