LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-31-2004, 11:08 AM   #1
suguru
Member
 
Registered: Dec 2003
Location: Voluntarily move into diaster relief areas.
Distribution: Upgraded from Suse 10 to Ubuntu.
Posts: 104

Rep: Reputation: 15
Clone root to = or > partition on diff type hd quickly!


I have 2 hds call them B for backup U for use. The root is on partition
2 of both of them. They are of different size. I just put extra partitions
on the larger and keep other partitions the same size. Backing up a partition
is easy I just give the command dd if=/dev/U# of=/dev/B#. However U, the
larger one, must be reconfigured because in a past life it had Fat 32 not
Fat 32 LBA partitions. It has now crashed probably because of the non
LBA. I would like to get it running the same as root in B. First step was
dd if=/dev/B2 of=/dev/U2. Then I edited /etc/lilo.conf and /etc/fstab. I
must have forgotten something(s). When U boots it just shows L 99 99 99...
and dies.

Can someone please tell me what all I forgot so that U boots again with
the same configuration as B except for the devices which I have already
changed in /etc/fstab?

FWIW here is the history. I got U running correctly
and then it crashed. I cloned it to B by booting knoppix cd and then
dd if=/dev/U of=/dev/B. I then edited things and got B running perfectly
with Fat 32 LBA instead of the Fat 32 that had been cloned from the
crashed U. I then improved B2 to be a better root and put more
information on U at Fat32 nonLBA places. I know many will want to
recommend just backup everything and clone the whole B to U with dd but
I want to know how to do it the quick way like I did when I got B running
in the first place.
Thanks,
 
Old 07-31-2004, 02:47 PM   #2
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
You are not really trying to run (and/or store your 1:1 backup) from a fat partition - are you?
For all I know - this is not doable or even advisable...( there is umsdos tough...)
For running linux you can use a variety of filesystems - but neither fat nor fat32 is among them.
You can access these filesystems - but not run a system from them!

The most common linux-filesystems are ext2 ext3 reiserfs xfs ...

To clarify this issue, please post the output of these commands:

fdisk -l /dev/hda
fdisk -l /dev/hdb
fdisk -l /dev/hdc
fdisk -l /dev/hdd

it will list the layout and filesystem-information from each disk - like this (from my machine):

Jonathan:/home/jochen# fdisk -l /dev/hda

Platte /dev/hda: 120.0 GByte, 120060444672 Byte
255 Köpfe, 63 Sektoren/Spuren, 14596 Zylinder
Einheiten = Zylinder von 16065 * 512 = 8225280 Bytes

Gerät Boot Start End Blocks Id System
/dev/hda1 * 1 1945 15623181 7 HPFS/NTFS
/dev/hda2 1946 6808 39062047+ 83 Linux
/dev/hda3 6809 9240 19535040 83 Linux
/dev/hda4 9241 14596 43022070 5 Erweiterte
/dev/hda5 9241 9276 289138+ 83 Linux
/dev/hda6 9277 14596 42732868+ 83 Linux


From there we could go farther...
To back up your root filesystem to another disk (make a 1:1 copy), you would use something like:

mkdir /mnt/target

mount your drive partition (which needs to be formatted...) on /mnt/target

cd / | cp -ax / /mnt/target

--> because that is necessary too - to mount it before you try to write to it

this first creates the directory /mnt/target - then changes its working-directory to / directory - and then copies _everything_ under there to the directory /mnt/target while keeping the original permissions of all files - something that cannot be done using fat(32)
 
Old 07-31-2004, 03:50 PM   #3
suguru
Member
 
Registered: Dec 2003
Location: Voluntarily move into diaster relief areas.
Distribution: Upgraded from Suse 10 to Ubuntu.
Posts: 104

Original Poster
Rep: Reputation: 15
Clone Root Q not Linux on Fat but hd has Fat

Thanks for replying with something for me to do.
I don't believe I indicated that I was trying to boot from Fat only that the LBA problem may have
caused dirve U or Use to crash.
In addition to the output you asked for I have included a cat to /hda2 which is B or Bak and a
cat of /hdb2 which is Use. I use Fat32 like many people to keep my data files so that I can
access them even when I am running the puny Lowest Common Denominator OS WinXp.
I believe that I should have made all the Fat32 partitions LBA before I started but no use crying
over spilled milk or historical use of a puny LCD OS. Please get on the point and tell me what I
forgot to do to get the cloned root to boot. WinXP was a past choice because it was easy to
get going. Now Knoppix hd install is a good choice for the same reason although I hope we
can share information so that it will not also be a dead end.

root@B:/home/B# fdisk -l /dev/hda

Disk /dev/hda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 2813 22595391 7 HPFS/NTFS
/dev/hda2 2814 3960 9213277+ 83 Linux
/dev/hda3 16710 19457 22073310 5 Extended
/dev/hda4 3961 16709 102406342+ c W95 FAT32 (LBA)
/dev/hda5 16710 19457 22073278+ c W95 FAT32 (LBA)

Partition table entries are not in disk order
root@B:/home/B# fdisk -l /dev/hdb

Disk /dev/hdb: 251.0 GB, 251000193024 bytes
255 heads, 63 sectors/track, 30515 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 2813 22595391 7 HPFS/NTFS
/dev/hdb2 2814 3960 9213277+ 83 Linux
/dev/hdb3 16710 29963 106462755 b W95 FAT32
/dev/hdb4 3961 16709 102406342+ 1b Hidden W95 FAT32

Partition table entries are not in disk order
root@B:/home/B#
root@B:/home/B# fdisk -l /dev/hdc
root@B:/home/B# fdisk -l /dev/hdd
root@B:/home/B# fdisk -l /dev/sr0
root@B:/home/B# fdisk -l /cdrom
root@B:/home/B# cat /etc/fstab
# /etc/fstab: filesystem table.
#
# filesystem mountpoint type options dump pass
/dev/hda2 / ext3 defaults,errors=remount-ro 0 1

proc /proc proc defaults 0 0
/dev/fd0 /floppy vfat defaults,user,noauto,showexec,umask=022 0 0
usbdevfs /proc/bus/usb usbdevfs defaults 0 0
sysfs /sys sysfs defaults 0 0

/dev/sr0 /cdrom iso9660 defaults,ro,user,noexec,noauto 0 0
/dev/sr1 /cdrom1 iso9660 defaults,ro,user,noexec,noauto 0 0

/dev/dvd /dvd iso9660 defaults,ro,user,noexec,noauto 0 0
/dev/cdaudio /cdaudio iso9660 defaults,ro,user,noexec,noauto 0 0
/dev/cdrom1 /mnt/auto/cdrom1 auto users,noauto,exec,ro 0 0
#js
/dev/sda1 /mnt/sda1 vfat auto,users,rw,exec,umask=0 0 0
# Added by KNOPPIX
/dev/hda1 /mnt/hda1 ntfs noauto,users,exec,ro,umask=000 0 0
# Added by KNOPPIX
/dev/hda4 /mnt/hda4 vfat noauto,users,exec,umask=000 0 0
# Added by KNOPPIX
/dev/hda5 /mnt/hda5 ext3 noauto,users,exec 0 0
# Added by KNOPPIX
/dev/hdb1 /mnt/hdb1 auto noauto,users,exec 0 0
# Added by KNOPPIX
/dev/hdb2 /mnt/hdb2 ext3 noauto,users,exec 0 0
# Added by KNOPPIX
/dev/hdb3 /mnt/hdb3 vfat noauto,users,exec,umask=000 0 0
# Added by KNOPPIX
/dev/hdb4 /mnt/hdb4 vfat noauto,users,exec,umask=000 0 0
root@B:/home/B#
root@B:/home/B# cat /mnt/hdb2/etc/fstab
# /etc/fstab: filesystem table.
#
# filesystem mountpoint type options dump pass
/dev/hda2 / ext3 defaults,errors=remount-ro 0 1

proc /proc proc defaults 0 0
/dev/fd0 /floppy vfat defaults,user,noauto,showexec,umask=022 0 0
usbdevfs /proc/bus/usb usbdevfs defaults 0 0
sysfs /sys sysfs defaults 0 0

/dev/sr0 /cdrom iso9660 defaults,ro,user,noexec,noauto 0 0
# /dev/sr1 /cdrom1 iso9660 defaults,ro,user,noexec,noauto 0 0

/dev/dvd /dvd iso9660 defaults,ro,user,noexec,noauto 0 0
/dev/cdaudio /cdaudio iso9660 defaults,ro,user,noexec,noauto 0 0
# /dev/cdrom1 /mnt/auto/cdrom1 auto users,noauto,exec,ro 0 0
#js /dev/sda1 /mnt/sda1 vfat auto,users,rw,exec,umask=0 0 0
# Added by KNOPPIX
/dev/hda1 /mnt/hda1 ntfs noauto,users,exec,ro,umask=000 0 0
# Added by KNOPPIX
/dev/hda4 /mnt/hda4 vfat noauto,users,exec,umask=000 0 0
# Added by KNOPPIX /dev/hda5 /mnt/hda5 ext3 noauto,users,exec 0 0
# Added by KNOPPIX /dev/hdb1 /mnt/hdb1 auto noauto,users,exec 0 0
# Added by KNOPPIX /dev/hdb2 /mnt/hdb2 ext3 noauto,users,exec 0 0
# Added by KNOPPIX /dev/hdb4 /mnt/hdb4 vfat noauto,users,exec,umask=000 0 0
# Added by KNOPPIX
/dev/hda3 /mnt/hda3 vfat noauto,users,exec,umask=000 0 0
root@B:/home/B#
 
Old 07-31-2004, 04:41 PM   #4
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
...so: you have a working system on /dev/hda2 and another on /dev/hdb2 - and you can not boot the first - but you would like to do that
and
you can not boot the second because it somehow "crashed"

...is this correct - I'm confused by the your use of A and B - please use the device-names!

again - you do _not_ back up a partition with "dd" - at least not if they are not _exactly_ the same size and filesystem. What dd does is a direct read/write to the raw device - as far as I know.
(I have used it to make copies of my boot-diskettes to hd - this creates an image of the device - in that case of the whole floppy - on harddisc and you can write it back the same way with dd)

...no - you did back up the whole disc - all partitions - at once - from /dev/hda to /dev/hdb - with "dd" !
...uuhh - is this what you did?

On which device are your backed up data and on which are the originals?
Can you verivy that on either one the data are still usable?
I'm specifically asking for the data on the linux-partition for now!

another thing - you did not have (and still do not) a swap-partition? Why?
 
Old 07-31-2004, 05:28 PM   #5
suguru
Member
 
Registered: Dec 2003
Location: Voluntarily move into diaster relief areas.
Distribution: Upgraded from Suse 10 to Ubuntu.
Posts: 104

Original Poster
Rep: Reputation: 15
Bak is working as hda Use has crashed is now hdb

>...no - you did back up the whole disc - all partitions - at once - from /dev/hda to /dev/hdb - with "dd" !
...uuhh - is this what you did?
<When Use now hdb crashed I backed it up to Bak now hda by booting knoppix and doing
dd if=hdb of=hda Then I worked until I got Bak running correctly. Then I did
dd if=hda2 of=hdb2 so that I put the latest copy of root from Bak unto the crashed Use.
Then I edited the /etc/fstab on hdb which is Use.
Then I edited the /etc/lilo.config on hdb which is Use.
Then I removed hda and put Use on the end of the cable to make it hda under cable select jumpers.
I thought it would boot but instead it just gives L 99 99 ...

>Can you verivy that on either one the data are still usable?
>I'm specifically asking for the data on the linux-partition for now!
< All data partitions and the linux root is ok now on hda which is Bak.

>another thing - you did not have (and still do not) a swap-partition? Why?
<Just an oversight. I should have also had /home. Better yet would be to make /home point to
hda5 when I am running Bak and hdb3 when I am running Use. Can you tell me how to do this?
Maybe ln ... /home /dev/hda5 or /mnt/hda5 would do it when I am running Bak?

Also maybe I need to run lilo for Use when I have booted from hda or the knoppix cd but I
didn't know how to run lilo for the drive unless it booted.

Kent West a university network just sent me this.
Boot into Knoppix.

mount /dev/hda2 /mnt/hda2
cd /mnt/hda2
mount /dev/hda3 /mnt/hda2/usr (assuming /usr is a separate partition,
and is on hda3)
cd /
chroot /mnt/hda2
lilo
exit
reboot

Since hda=Bak is running I will try it without the boot from Knoppix cd.

Last edited by suguru; 07-31-2004 at 05:40 PM.
 
Old 07-31-2004, 05:54 PM   #6
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
This will take me a while and it is getting very late now - I will be back tomorrow...maybe someone else is here to answer?
 
Old 07-31-2004, 07:42 PM   #7
suguru
Member
 
Registered: Dec 2003
Location: Voluntarily move into diaster relief areas.
Distribution: Upgraded from Suse 10 to Ubuntu.
Posts: 104

Original Poster
Rep: Reputation: 15
Debbin-knoppix howto crash recovery didn't work

Thanks jomen perhaps someone else can help. Here are the latest attempt results and questions.

Here is what I did and what happened.
knoppix@ttyp0[knoppix]$ su
root@ttyp0[knoppix]# mount /dev/hda2 /mnt
root@ttyp0[knoppix]# mount
/dev/root on / type ext2 (rw)
/dev/scd0 on /cdrom type iso9660 (ro)
/dev/cloop on /KNOPPIX type iso9660 (ro)
/ramdisk on /ramdisk type tmpfs (rw,size=405304k)
/proc/bus/usb on /proc/bus/usb type usbdevfs (rw,devmode=0666)
automount(pid512) on /mnt/auto type autofs (rw,fd=4,pgrp=512,minproto=2,maxproto=4)
/dev/hda2 on /mnt/hda2 type ext3 (rw,nosuid,nodev)
/dev/hda3 on /mnt/hda3 type vfat (rw,nosuid,nodev,umask=000,uid=1000,gid=1000)
/dev/hda2 on /mnt type ext3 (rw)
root@ttyp0[knoppix]# chroot /mnt lilo
Warning: '/proc/partitions' does not exist, disk scan bypassed
Warning: Unable to determine video adapter in use in the present system.
Added Linux *
Added Linux(2.4)-1
Added Linux(2.6)-2
Warning: CHANGE AUTOMATIC assumed after "other=/dev/hda1"
Fatal: First sector of /dev/hda1 doesn't have a valid boot signature

After I rebooted I again got L 99 99 99 99...
Previously I had a mess on this hda which is Use. I used the acronis boot selector
that I got with an older Suse Office Pack. Then I used M$ boot selection after that
instead of lilo. Perhaps I need to rewrite the MBR. Any suggestions would be
appreciated from anyone since jomen has retired for the night and hasn't used
dd before to clone the root partition.
 
Old 08-01-2004, 01:33 AM   #8
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
Hey, I just checked if someone was kind enough and able to help in the meantime - does not look like it - so here we go for the rather long solution (sorry):

Since I have just done all this myself to verivy the procedure is correct, I can just as well talk you through it step by step...

We could spare all the rest right now, if your machine does not have a floppy drive - but it does...

First the decription - then the way step by step:

We are going to make a boot-floppy from within Knoppix with the help of "mkrescue"
For that we will need to know a few things...

? your (kind of) working linux is on /dev/hdb2 - am I right ? - otherwise change all my references to /dev/hda2

1.) is your lilo.conf on your harddisk working? (I think it just needs to be a syntactically valid file, since you pass everything needed for the rescue-floppy via command-line, but I did not check that)

2.) where (probably in /boot) is the kernel-image you want to boot?

3.) does the boot-process use a initrd (initial RAM-disk) - it would probably also be in /boot
(you never mentioned what kind of linux you had...but an initrd-setup is mostly done with the aid of a separate /boot partition - which you do not have ...)

4.) where (which partition on which disk) is your root-partition, that is supposed to be working and going to be booted to? (/dev/hdb2 am I right?)

First: you will need a floppy - to become your rescue-floppy!
We boot Knoppix - open terminal - su to root - mount your /dev/hdb2 - change the /etc/lilo.conf symlink in Knoppix to point to _your_ /etc/lilo.conf on /dev/hdb2 (which is mounted on /mnt/hda2) - make the rescue-floppy (and another one) - just to be sure that one of them will boot (where we are now - we can be paranoid ) - shut down Knoppix and reboot from your rescue-floppy - then we reinstall lilo from within your working system and then the worst will be over and done with!

Now for the more detailed way - should you need it:

-get Knoppix up

-mount the linux-partition (/dev/hdb2) on /mnt/hdb2 - just clicking the icon will do that, if you are in a graphical environment (KDE is the standard if you just put the CD in and boot)

-open a terminal - change to root (su)

-type "mc" - I hope you do know this filemanager - if you dont - play around a little to get familiar with it

-go to /etc/lilo.conf (in/on the Knoppix-filesystem - not the one on /mnt/hda2 !)
this - as you will see - is actually a link which points to /KNOPPIX/etc/lilo.conf

-change that link to point to /etc/lilo.conf on _your_ harddisk
(to point to /mnt/hda2/etc/lilo.conf)
(because using the file from Knoppix does not work - it would need to be edited and the command we are going to use is specifically asking for the _original_ /etc/lilo.conf - according to the manual-page)

...with "mc" its done by: F9 - select the File-menu - enter - edit Symlink...be careful to write this correctly - if you mistyped something, the link will point nowhere - if the link is red after your edit - you have mistyped something...

-check out your /boot partition again - just to verify the names of the kernel-image and possibly the initrd

-put the floppy in the drive

-type: mkrescue --initrd "" --kernel /mnt/hdb2/boot/_name_of_your_kernel --root /dev/hdb2

(if you need the initrd-option - give the full pathname to it like for the kernel-image instead of "" - this parameter is really needed and cannot be left out! -it stands for a non existent path)

-press enter and answer the warning message about destroying all data on the floppy by pressing enter again - them watch/hear your floppy being written while you cross your fingers...

-if the command finished successful - take the floppy out and put the next one in (...the paranoid part...)

-do it again...

(maybe I should say it: the floppy will not be - and does not have to be - mounted!)

-say "thank you and good bye" to Knoppix

-boot from the floppy you just made - which will take quite a time

-you should be in your system as you are used to it - reinstall lilo to harddisk and then you can go about fixing your other harddisk...

-tell me, if it worked out O.K. - please! - else - ask again with your specific problem...
 
Old 08-01-2004, 05:41 PM   #9
suguru
Member
 
Registered: Dec 2003
Location: Voluntarily move into diaster relief areas.
Distribution: Upgraded from Suse 10 to Ubuntu.
Posts: 104

Original Poster
Rep: Reputation: 15
Mkrescue to CD for hda generated by knoppix-install

< My system was originally made by starting knoppix then giving the command
knoppix-install

<I don't have a floppy but I have a DVD-RW & a CD-RW
I will try to reword what you said.
To repair the hd Use, I will remove Bak so Use will become hda.

-get Knoppix up

-mount the linux-partition (/dev/hda2) on /mnt/hda2 by just clicking the icon in KDE

<-open a terminal as root

<I don't like "mc" so I do
cd /etc/lilo.conf
ll should say /etc/lilo.conf is a link which points to /KNOPPIX/etc/lilo.conf and not mention /mnt/hda2

< Do ln -s /etc/lilo.conf /mnt/hda2/etc/lilo.conf
-change that link to point to /etc/lilo.conf on _your_ harddisk
<- Isn't this easier than with "mc" its done by: F9 - select the File-menu - enter - edit Symlink...be careful to write this correctly - if you mistyped something, the link will point nowhere - if the link is red after your edit - you have mistyped something...

<Do ll /boot
-check out your /boot partition again - just to verify the names of the kernel-image and possibly the initrd

<I don't have a floppy nor a floppy drive put the floppy in the drive
Can this make a bootable CD instead of a bootable floppy?
locate initrd gives more than two pages so I have to use > InitrdLocated.txt What exactly am I looking for to put in "????" ?
is it /boot/initrd.img without any quotes? This is a link which points to whatever I choose to boot.
I have two of them since knoppix 3.4 allows me to boot into 2.4.26 or 2.6.6

-type: mkrescue --iso --initrd "????" --kernel /mnt/hda2/boot/_name_of_your_kernel --root /dev/hdb2

(if you need the initrd-option - give the full pathname to it like for the kernel-image instead of "" - this parameter is really needed and cannot be left out! -it stands for a non existent path)

< updatedb
locate rescue.iso
cdrecord /dev/0,0 rescue.iso

-if the command finished successful - take the CD out and put the next one in (...the paranoid part...)

-do it again...

(maybe I should say it: the CD will not be - and does not have to be - mounted!)

-say "thank you and good bye" to Knoppix
< Hit K button and choose shutdown.

-boot from the CD you just made or from the hd that has a new lilo

-you should be in your system as you are used to it - reinstall lilo to harddisk and then you can go about fixing your other harddisk...
< Not as I am used to it. I usually see the gui come up but I have worked
with a cli also.

-tell me, if it worked out O.K. - please! - else - ask again with your specific problem...


<Thanks jomen for all of your help. I hope you can edit this reply so
that it just contains the bash commands to rewrite the lilo on the hd Use
which I will install as hda for the rescue. I hope you can also give me
the bash commands to write a rescue CD.

<Some day soon I want to move up to Grub. Would it be easier to just
rescue using Grub rather than writing Lilo?

Last edited by suguru; 08-01-2004 at 05:53 PM.
 
Old 08-02-2004, 10:04 AM   #10
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
As I'm writing this, my system is up and runnig just as usual - booted by using the Rescue-CD I just made using Knoppix - just to try if it really works as it should. It does...

I will start from the end of your post:

Grub and lilo do the same thing and if there are problems, you do need to know your way around in any case - rescuing a case like yours would not become easier to solve as it is now - it makes no difference which one you use in that respect...

I will not reedit my post - but rather _explain_ what to do!

If you want to move your disk from being /dev/hdb to being /dev/hda - do it and change everything accordingly.
This brings me to another point - until you resolved the problem, you should keep everything as simple as possible - starting with your hardware-setup...What I'm suggesting is: completely take out the disk you do not want to use now - that is one source of error removed...


I'll mention the writing of the rescue-CD later on...


? What is that supposed to mean ?: ( I will quote my text and yours )

quote:

"-you should be in your system as you are used to it - reinstall lilo to harddisk and then you can go about fixing your other harddisk...
< Not as I am used to it. I usually see the gui come up but I have worked
with a cli also."

/quote

? can you boot up now or not or what are you trying to tell me ?



Now for the explanation:

I was just trying to be specific and easy at the same time...
Sometimes you seem to know your way around very well - and sometimes...well...
If you do not like "mc" - so be it... - just use it anyway for this one time
For me its easier doing it with "mc" - keeping in mind that I cannot be sure that the layout of your Filesystem as well as your Knoppix is the way it is here, where I tried it.

With "mc" - I just get a better "picture" of what is where...if it is a link or a file ... where does it point ...can I even change it or write to it ...after all, Knoppix is a CD and one cannot write to or change every file...

The other thing is _just_ the thing with the link - I was not trying to be wise here, but to make sure that it was working out as it needs to...
To be able to do:

ln -s /etc/lilo.conf /mnt/hda2/etc/lilo.conf

you would first have to remove the link (because it is alredy there - but pointing to a different file --> to the lilo.conf on the Knoppix-CD) - otherwise there would have been an error here - if you'd have tried - you'd have known this...and since I did it with "mc" - I could just edit it instead of removing and recreating it.

You did not tell me about the fact, that you do actually _not_ have a floppy-drive - and I was assuming you did by reading your second post - where you included the output of "cat /etc/fstab" - there is a "/dev/fd0 /floppy..." in there...!


Now for the facts - you should KNOW if your system boots up using an initrd or not!

In case you do not know: when your system was working and had (and therefore still has)
a working "/etc.lilo.conf" you would find it mentioned in that file - complete with name and path to it...
Mostly it will be in the /boot directory where also all your kernel-images are - but this could be different on your system...how should I know ?

I need to get something clarified here: you said in your last post

quote:

"is it /boot/initrd.img without any quotes? This is a link which points to whatever I choose to boot.
I have two of them since knoppix 3.4 allows me to boot into 2.4.26 or 2.6.6

/quote

you are looking in the wrong place here - I was talking about using _your_ kernel-image on _your_ system - which possibly is booted using an initrd - wich would also be on _your_system - which I was referring to as /dev/hdb2 --> mounted on /mnt/hdb2 under Knoppix.

So - to find _your_ kernel-image, you would need to look for it in:
/mnt/hdb2/boot/_your_kernel_image and similarily you would find the lilo.conf I was going to use in: /mnt/hdb2/etc/lilo.conf - which should be _your_ working (!) lilo.conf

if you read the man-page of mkrescue you will find explained there the use of the options --initrd and --kernel as _always_ needing to be used together. That means - if you do _not_ have an initrd, this parameter still needs to be there - only pointing to "" which is a non existant path (just no path, since it is not there).
if you do have an initrd - for instance called _your_initrd_ and located in /mnt/hdb2/boot/ the initrd-option would be: --initrd /mnt/hdb2/boot/_your_initrd_ (all this as seen from Knoppix looking onto _your_ harddisk - which you want to be able to boot.


Writing the CD:
My assumption here is: you booted Knoppix with the default kernel (2.4.x) and not the optional kernel 2.6.x - there are problems using 2.6.x for me and you want to be as sure as possible, that this will work out!

with mkrescue create the rescue-disk-image like this:

cd

mkrescue --initrd "" --kernel /mnt/hdb2/boot/_name_of_your_kernel_image --root /dev/hdb2 --iso

this will leave a file called rescue.iso in the current directory (root's home)

cdrecord -scanbus --> to find where your CD-Writer is - mine is at: dev=0,1,0 and I will use that name here

if you are using an re-writable - blank it first to be sure nothing is on there:

cdrecord -v dev=0,1,0 speed=(depends on your writer and the CD used) blank=fast

then burn the CD:

cdrecord -v dev=0,1,0 speed=(depends on your writer and the CD used) ./rescue.iso


and my last comment:

It is quite possible that all of this will not work - because of the way you moved the contents of your disk and your disks partitions around.
Because you commented on that - referring to me - by saying: "and hasn't used dd before to clone the root partition." - I would really like to learn, WHY you did it this way?
You surely messed _something_ up by doing that - you wrote all the raw data from one disk directly - without going throug the filesystems (as I understand dd) - to another disk, which did not even have the same size. Also - existing filesystems and partitions on the target where not respected doing it this way. Of course you will have problems accessing your data on the target because of that. The good thing is: it will still be there - with exactly the same layout and location the other disk had...


Why do I say this?

The chroot approach - suggested to you by Ken West - should have worked, but did not, from what I gather...

this would have been a quick and short solution, but - probably because of _how_ you copied your data - it did not work

I would have done it slightly different:

make sure /dev/hdb2 is _not_ mounted - else unmount it (you mounted it on /mnt - while it was alredy mounted on /mnt/hda2 - as you can see in your fourth post)

mount /dev/hdb2 /mnt/hdb2 --> make sure it is mounted read/write on there...

cd /mnt/hdb2

chroot /mnt/hdb2 /usr/bin/env -i HOME=/root PATH=/bin:/usr/bin:/sbin:/usr/sbin

--> change the system root to be on /dev/hdb2 - just as it would be, if you booted the system, clean the environment of any Variables and set a Path

bash --login --> to read the environment from _your_ system

lilo -v

exit --> to log out of bash...

exit --> to leave chroot

reboot


and the really last one:

a swap partition is used for paging out contents of system-RAM - effectively providing you with as much as you need or want - typically it is set up to be twice as big as your system has RAM installed...(called the pagefile.sys in Windows...)

good luck
 
Old 08-02-2004, 05:01 PM   #11
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
about the "being paronoid" thing:
I had in mind the tendency of floppy discs to fail just when you need them and was trying to make sure to have one working floppy, should this be happening...
It's so much easier to just repeat the command one more time than to go throug the whole procedure again, should you find out, that the floppy you just made was not working due to some flaw with/on the floppy...
It has happened to me a couple of times - and that is why I wanted to on the safe side by doing two identical floppys.
No need to do that with CD-s - they have till this day never failed on me (just my experience).
 
Old 08-03-2004, 06:10 PM   #12
suguru
Member
 
Registered: Dec 2003
Location: Voluntarily move into diaster relief areas.
Distribution: Upgraded from Suse 10 to Ubuntu.
Posts: 104

Original Poster
Rep: Reputation: 15
Thanks Jomen, Only short answers please, A friend restored

Thanks Jomen but this got too complicated for me to follow, I gave up after your last long post
and just took it to a friend who restored it. He couldn't get the procedure Kent West to work so
I am not exactly sure what finally made it work. But he did cp .bash_history HowISaved.txt

When I have time, I will try to post it. I think the majority of the of the problem came from
use of Partition Magic and various linux partition utilities and WinXp inself which BTW is no longer
valid.

We all have different talents. That is why helping each other helps all of us.
Jomen comment that Sometimes you seem to know your way around very well - and sometimes...well...
Is insightful. I was probably running Unix before most of you were born. But I have had to run a
lot of other operating systems and most of my work has been in capacities where if we had been
together in the past many of you would have called me boss or professor because
something other than technical details occupies most of my thought. I know many but not all
concepts in computing but I am much weaker when it comes to exact commands in linux.

Since I haven't replied to many technical questions yet, I would like to offer something else
here until I can offer more technical advice.
One of the weaknesses of linux is that users who help other users often
assume that they can help others by sweeping over a solution with a prose description. It has
been my experience that when many hear this they just say "linux is too complicated for me"
and go back to an inferior OS.

Hint to everyone. I am a teacher and a teacher of teachers. When someone asks a question,
may I suggest that we all give the shortest and most exact answer possible. A prose
description is not exact. A list of commands with variables in brackets if necessary followed
by a prose rationale of why to do it that way helps me more than anything.

Example:
dd if=[input device or partition] of=[output device or partition]
this is what I was trying to do when I said that I had done
dd if=hdb of=hda Then I worked until I got Bak running correctly. Then I did
dd if=hda2 of=hdb2 so that I put the latest copy of root from Bak unto the crashed Use

The first dd from hdb to hda copied the whole disk. This works great. The only disadvantage
is that every time you boot with both drives you get an error message of duplicate drive id's
but then linux goes ahead and runs normally.
When the disk that had been copied died then the second dd copied only the linux partition at
hda2 to hdb2 . I don't think there is a problem in doing this because they are obviously the
same size since Bak was a mirror image of Use. Something went wrong with my explaination
and Jomen chased some irrelevant trails. Mostly the problem lies in things that aren't said
therefore assumed. For instance, I said that I cloned root with dd. Then I said that the hd
had a problem with Fat 32 instead of Fat 32 LBA. Jomen thought that I might be trying to
run from a Fat instead of a linux partition. I didn't say that the Fat was another partition
because I assumed anyone at this level would know that. If someone has a good way we
can communicate better by setting up ways to avoid assumptions, I would like to hear it.

To finalize the technical problem.
The problem must have been in the mbr and in the first part of WinXP. I should have recognized
that earlier, concentrated on fixing the partition tables and never even used
dd if=hda2 of=hdb2 to put the latest copy of root from Bak unto the crashed Use

The problem was Partition Magic said there wasn't a problem and none of the linux partitioning
tools complained either. The one thing that I had done differently on Use was that I used
m$ boot to decide which OS to choose and when M$ puked out as usual I must have have
lost more than I thought.

Next time I will try to remember and use Grub instead of doing another time consuming
experiment with M$.

Last edited by suguru; 08-04-2004 at 02:17 PM.
 
Old 08-04-2004, 06:57 PM   #13
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
Thank you for answering - even if what I suggested to resolve your problem was appearantly not really helpful.

Sorry - this is not a short one eighter!

I should have read more carefully, what your problem was - I was answering questions you never asked, because I just assumed and went from there without really checking back.
Your use of "dd" was correct for what you did and I should have seen that...and not commented on it the way I did...
I assumed the wrong thing for your use of "crash" for instance - and that lead to other wrong assumptions...but still - the essence of it all was trying to create a bootable CD or -Floppy
and should have worked.
Anyway - a bootable CD or Floppy always comes in handy - it could have saved you from your trouble in the first place and will more than likely be necessary, if you ever install a copy of windows onto a disk with linux already on there.

As to my "explanation" on solving the problem:

I thought, that explainig what to do - and why - would be better than just writing a set of commands to issue to solve the problem.
I also did it this way because I was not sure, what really was wrong with your system - and by explaining in greater detail what to do (not just giving commands to issue - they could have failed because the layout of your system might have been different from what I assumed) you would be able to get the desired result - even if your system was different from what I thought.

I do not doubt your talents and abilities - I'm far from that! Not in the field discussed here nor in any other. You asked a question and I was trying to help.
I apologize for any expression which came out the wrong way!
Please take into account, that english is not my native language while weighing my words.
I'm not the person, that would like to appear as the one who just knows - and someone who has some problem does not. I try to avoid that by explainig things - to set the one asking into a position to solve whatever problem was there - and I only do that in case I seriously believe, that I'm able to help, because I - in fact - do know what the problem is and how to solve it (most of the time by having learned it the "hard" way)

Since you are a teacher, you are aware that understanding any problem is the key to solve it - as opposed to getting an answer, which (just) solves the problem without having the chance to know 1.) what caused it and 2.) why it is now solved. This is not a good way to learn.
I'm not saying that you or anyone is not able to deduce from the demonstation of how to get some problem solved - but knowing the background will help with that.
If one understood something - the problem will have disappeared next time one encounters a similar situation.

I may be getting wrong what you said and therefore - another time - assume things in this post, which you where not communicating.

The one assumtion I always had and will have while answering questions is: whoever is asking wants to learn something and I will give answers to questions with this in mind.
That is the point where I do not agree, when you say: "A prose description is not exact"
It can be even better than just giving out a solution!
 
Old 08-09-2004, 12:53 PM   #14
suguru
Member
 
Registered: Dec 2003
Location: Voluntarily move into diaster relief areas.
Distribution: Upgraded from Suse 10 to Ubuntu.
Posts: 104

Original Poster
Rep: Reputation: 15
Jomen Thanks, Everyone Pls give commands & explain

Jomen Thanks so much for all your help. Everyone Please give exact, regular expression or
BNF type commands & explain why you did it this way. Usually in Linux there is more than
one way to do things. Jomen is right. Helping someone think things through is a great
teaching methodology. I use it often when I am interacting face to face with someone. But
when a computer is down, people usually just want to get it up ASAP and then reason about
how it was done later when the don't have the pressure of a crash. The turnaround time
and lack of face to face encounters on linuxquestions make sweeping prose a poor fit IMHO.
Face to face, I can tell immediately by the expression when I or they don't understand.

Windows help desk etc usually don't help users reason things through. They often just say
click on this, then that and don't usually explain why. If we can help people get going just as
fast with Linux there will be plenty of time to digest our explainations as they continue to
use Linux instead of being frustrated and down for a long period. I can't count the number
of times I have gone to Google and type things like recover OR recovery disk and got back
thousands of references to things like "make a recovery disk." Yes that is what I wanted to
do in the first but anything less than exact commands doesn't help me do what I already
knew I wanted to do.

BTW please don't anyone worry about their English. We native speakers are only 9% of the
world's population. In informal situtations like this we should be making more effort to
understand than your effort to write correctly. However if you are selling something and
enclose a manual with the same mistakes all the native speakers and most others get upset.

Last edited by suguru; 08-09-2004 at 01:01 PM.
 
  


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
installing redhat 8.0 when text login in I cannot type password?? I type root scrist Linux - General 4 04-22-2006 02:20 AM
Is there some command to clone root a/c DriveMeCrazy AIX 1 09-05-2005 06:09 AM
Quickly switching to root artificialGekko Linux - Newbie 9 03-09-2005 06:44 AM
can i use dd to clone a partition? dr_zayus69 Linux - Software 1 01-25-2005 04:57 PM
root (hd 0,0)Filesystem type unknown, partition type 0x7chainloader +1 ece30675 Linux - Distributions 5 07-20-2004 09:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:28 AM.

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