Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.os.linux.setup > #2581 > unrolled thread
| Started by | Harry <simonsharry@gmail.com> |
|---|---|
| First post | 2012-04-12 03:29 -0700 |
| Last post | 2012-04-19 18:50 -0700 |
| Articles | 20 on this page of 81 — 10 participants |
Back to article view | Back to comp.os.linux.setup
No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-12 03:29 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! Richard Kettlewell <rjk@greenend.org.uk> - 2012-04-12 11:46 +0100
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-12 04:08 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! Richard Kettlewell <rjk@greenend.org.uk> - 2012-04-12 12:36 +0100
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-12 05:25 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! Richard Kettlewell <rjk@greenend.org.uk> - 2012-04-12 13:49 +0100
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-12 06:09 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! Richard Kettlewell <rjk@greenend.org.uk> - 2012-04-12 19:18 +0100
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-12 11:49 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! Doug Freyburger <dfreybur@yahoo.com> - 2012-04-12 18:27 +0000
Re: No success repairing my ext4 file system so far, PLEASE HELP! Doug Freyburger <dfreybur@yahoo.com> - 2012-04-12 18:51 +0000
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-12 12:12 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! "David W. Hodgins" <dwhodgins@nomail.afraid.org> - 2012-04-12 17:15 -0400
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-12 20:30 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-13 06:58 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-13 07:13 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! Robert Nichols <SEE_SIGNATURE@localhost.localdomain.invalid> - 2012-04-13 19:29 -0500
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-13 21:27 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! Robert Nichols <SEE_SIGNATURE@localhost.localdomain.invalid> - 2012-04-14 07:58 -0500
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-14 06:35 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! Robert Nichols <SEE_SIGNATURE@localhost.localdomain.invalid> - 2012-04-14 19:59 -0500
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-14 19:58 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-14 20:13 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! Robert Nichols <SEE_SIGNATURE@localhost.localdomain.invalid> - 2012-04-15 15:14 -0500
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-16 02:39 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! Robert Nichols <SEE_SIGNATURE@localhost.localdomain.invalid> - 2012-04-16 08:50 -0500
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-16 08:02 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-16 10:39 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-16 11:08 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! Robert Nichols <SEE_SIGNATURE@localhost.localdomain.invalid> - 2012-04-16 15:58 -0500
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-16 23:02 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! Robert Nichols <SEE_SIGNATURE@localhost.localdomain.invalid> - 2012-04-17 10:58 -0500
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-18 21:53 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! Doug Freyburger <dfreybur@yahoo.com> - 2012-04-19 16:45 +0000
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-19 18:34 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! Doug Freyburger <dfreybur@yahoo.com> - 2012-04-20 17:19 +0000
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-21 20:37 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! Doug Freyburger <dfreybur@yahoo.com> - 2012-04-25 16:01 +0000
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-28 16:32 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! Doug Freyburger <dfreybur@yahoo.com> - 2012-04-16 19:15 +0000
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-16 21:20 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-13 21:40 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-13 21:56 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! Doug Freyburger <dfreybur@yahoo.com> - 2012-04-16 18:47 +0000
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-16 20:19 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! unruh <unruh@invalid.ca> - 2012-04-13 15:22 +0000
Re: No success repairing my ext4 file system so far, PLEASE HELP! J G Miller <miller@yoyo.ORG> - 2012-04-13 17:13 +0000
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-13 21:58 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! unruh <unruh@invalid.ca> - 2012-04-12 15:50 +0000
Re: No success repairing my ext4 file system so far, PLEASE HELP! The Natural Philosopher <tnp@invalid.invalid> - 2012-04-12 21:37 +0100
Re: No success repairing my ext4 file system so far, PLEASE HELP! unruh <unruh@invalid.ca> - 2012-04-12 15:46 +0000
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-12 09:35 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! unruh <unruh@invalid.ca> - 2012-04-12 18:57 +0000
Re: No success repairing my ext4 file system so far, PLEASE HELP! Doug Freyburger <dfreybur@yahoo.com> - 2012-04-12 15:59 +0000
Re: No success repairing my ext4 file system so far, PLEASE HELP! unruh <unruh@invalid.ca> - 2012-04-12 16:39 +0000
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-12 09:53 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! unruh <unruh@invalid.ca> - 2012-04-12 19:03 +0000
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-12 09:48 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! unruh <unruh@invalid.ca> - 2012-04-12 19:07 +0000
Re: No success repairing my ext4 file system so far, PLEASE HELP! Richard Kettlewell <rjk@greenend.org.uk> - 2012-04-12 18:43 +0100
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-12 10:55 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! Doug Freyburger <dfreybur@yahoo.com> - 2012-04-12 18:07 +0000
Re: No success repairing my ext4 file system so far, PLEASE HELP! Richard Kettlewell <rjk@greenend.org.uk> - 2012-04-12 19:20 +0100
Re: No success repairing my ext4 file system so far, PLEASE HELP! unruh <unruh@invalid.ca> - 2012-04-12 19:11 +0000
Re: No success repairing my ext4 file system so far, PLEASE HELP! Richard Kettlewell <rjk@greenend.org.uk> - 2012-04-12 20:39 +0100
Re: No success repairing my ext4 file system so far, PLEASE HELP! Doug Freyburger <dfreybur@yahoo.com> - 2012-04-13 16:50 +0000
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-13 21:24 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! Doug Freyburger <dfreybur@yahoo.com> - 2012-04-16 19:04 +0000
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-16 21:44 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! unruh <unruh@invalid.ca> - 2012-04-17 17:18 +0000
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-17 18:41 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! unruh <unruh@invalid.ca> - 2012-04-12 19:09 +0000
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-12 10:46 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! unruh <unruh@invalid.ca> - 2012-04-12 19:13 +0000
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-12 12:21 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! unruh <unruh@invalid.ca> - 2012-04-12 20:12 +0000
Re: No success repairing my ext4 file system so far, PLEASE HELP! g.fink@gmx.net (Gernot Fink) - 2012-04-12 18:20 +0000
Re: No success repairing my ext4 file system so far, PLEASE HELP! The Natural Philosopher <tnp@invalid.invalid> - 2012-04-12 21:35 +0100
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-19 06:43 -0700
Re: No success repairing my ext4 file system so far, PLEASE HELP! Bob <SEE_SIGNATURE@localhost.localdomain.invalid> - 2012-04-19 11:29 -0500
Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-19 18:50 -0700
Page 3 of 5 — ← Prev page 1 2 [3] 4 5 Next page →
| From | Harry <simonsharry@gmail.com> |
|---|---|
| Date | 2012-04-16 21:20 -0700 |
| Message-ID | <13248645.323.1334636445062.JavaMail.geo-discussion-forums@pbph10> |
| In reply to | #2659 |
On Tuesday, April 17, 2012 12:45:46 AM UTC+5:30, Doug Freyburger wrote:
> Robert Nichols wrote:
> > Harry wrote:
> >> $ pvck -vv /dev/sdb2
> >
> >> Found label on /dev/sdb2, sector 1, type=LVM2 001
> >> Found text metadata area: offset=4096, size=1044480
> >> Found LVM2 metadata record at offset=1006080, size=42496,
> >> offset2=0 size2=0
> >> Found LVM2 metadata record at offset=991232, size=14848, offset2=0
> >> size2=0
> >
> > That is all perfectly normal. It's hard to understand why it's not working.
> > Try setting aside the /etc/lvm directory (rename it to /etc/xxlvm) to force
> > the system to work only with the physical devices and not rely on previously
> > cached data. Then see what 'pvscan', 'vgscan', and 'lvscan' can find. The
> > vgscan should repopulate the /etc/lvm directory with good data.
>
> If it was the beginning of /dev/sdb2 that was overwritten not the
> beginning of the disk then the first LVM label was trashed. It's a huge
> if but maybe that's what happened.
No, I can assure you the dd command I had issued was:
$ dd if=/dev/sdb of=/dev/sda bs=446 count=1
At the time this command was issued,
a) sdb was the 250G disk with a freshly installed F16;
b) sda was the 80G disk
Because I switched the cables in my system later, it is sdb that is the 80G disk that we're trying to fix now.
> I see in the man page for the Red Har version of "pvck" that it
> supports "--labelsector sector". Above is a list of those sectors.
> They should act something like the alternative super blocks discussed
> earlier when we were thinking about an ext4 filesystem.
>
> I don't see that switch in the man page for any of the other related
> commands. Sigh.
>
> Have you tried "lvscan" in the hopes that it uses those alternate labels?
$ lvscan --all
No volume groups found
[toc] | [prev] | [next] | [standalone]
| From | Harry <simonsharry@gmail.com> |
|---|---|
| Date | 2012-04-13 21:40 -0700 |
| Message-ID | <28e10051-70f6-44ef-a619-00fb012b46f3@a8g2000pbe.googlegroups.com> |
| In reply to | #2621 |
On Apr 13, 7:13 pm, Harry <simonsha...@gmail.com> wrote:
> On Apr 13, 6:58 pm, Harry <simonsha...@gmail.com> wrote:
>
> > On Apr 13, 8:30 am, Harry <simonsha...@gmail.com> wrote:
>
> > Guys, I am still somewhat hopeful but don't know what to do or who to
> > ask now.
>
> > Is there any other forum (LVM-related) where I could try asking?
>
> > This is not my area of expertise at all; I use Linux only as an
> > applications user.
>
> > Please help your fallen comrade out...
>
> Based on the contents of /etc/lvm/backup/vg_XYZ (which I provide here,http://superuser.com/questions/411697/lvm-volume-with-corrupt-mbr-how...
> ), is there any way I could programmtically conduct a binary search
> for the correct start of the lv_root? For example,
>
> StartLocation = some 'good' value
> dmsetup create foo --table "0 146997248 linear /dev/sdb2
> $StartLocation"
> if mount -o ro /dev/mapper/foo /mnt succeeds,
> BINGO!
> else
> StartLocation = StartLocation + some 'good' Increment
> dmsetup remove foo
> fi
>
> Based on your recommendations I could try some good values of
> StartLocation and Increment, instead of a brute-force search of the
> entire 80G pv.
Based on Richard's response (at
http://superuser.com/questions/411697/lvm-volume-with-corrupt-mbr-how-to-mount-and-recover-data-from-it
), I wrote the following script.
------------------------------------------------------
#!/bin/bash
set -u
(( extent_size = 65536 ))
(( pe_start = 2048 ))
# current sector
(( curr = 0 ))
(( Increment = 1 ))
(( maxExtentCount = 126 + 2243 ))
# Clean up any previously existing foo.
if [ -b /dev/mapper/foo ]; then
dmsetup remove foo
fi
while : ; do
(( StartLocation = pe_start + curr * extent_size ))
echo -n "Trying curr = $curr ,StartLocation = $StartLocation ..."
if dmsetup create foo --table "0 146997248 linear /dev/sdb2
$StartLocation" &>/dev/null ; then
if mount -o ro /dev/mapper/foo /mnt &>/dev/null ; then
echo
echo 'BINGO'
break
else
echo " mount failed"
fi
dmsetup remove foo
else
echo " dmsetup failed"
fi
(( curr = curr + Increment ))
if [ $curr -gt $maxExtentCount ]; then
echo "reached maxExtentCount, quitting"
break
fi
done
# Clean up
if [ -b /dev/mapper/foo ]; then
dmsetup remove foo
fi
------------------------------------------------------
No success, though. The above loop printed 'dmsetup failed' 2370
times before quitting.
Trying curr = 0 ,StartLocation = 2048 ... dmsetup failed
Trying curr = 1 ,StartLocation = 67584 ... dmsetup failed
Trying curr = 2 ,StartLocation = 133120 ... dmsetup failed
Trying curr = 3 ,StartLocation = 198656 ... dmsetup failed
Trying curr = 4 ,StartLocation = 264192 ... dmsetup failed
...
Trying curr = 2366 ,StartLocation = 155060224 ... dmsetup failed
Trying curr = 2367 ,StartLocation = 155125760 ... dmsetup failed
Trying curr = 2368 ,StartLocation = 155191296 ... dmsetup failed
Trying curr = 2369 ,StartLocation = 155256832 ... dmsetup failed
reached maxExtentCount, quitting
I am not sure if I'm incrementing 'curr' in proper units (sectors/
blocks/extent_size/bytes). Where is this volume backup file
documented, btw? (Googled for it, couldn't find it.)
I would like to understand LVM and even regular partitioning more
thoroughly. Would someone kindly suggest the smallest number of
resources (books, links to online articles/tutorials, etc) that would
teach me not just the commands but the concepts behind them. Anything
and everything above the BIOS and assembly-language I would like to
understand. For example, I won't want to understand the boot code in
the first 446 bytes of MBR but everything else you guys know about
partitioning and LVM.
[toc] | [prev] | [next] | [standalone]
| From | Harry <simonsharry@gmail.com> |
|---|---|
| Date | 2012-04-13 21:56 -0700 |
| Message-ID | <85a6427b-2346-45c4-a19e-fb702e728db8@k10g2000pbk.googlegroups.com> |
| In reply to | #2621 |
On Apr 13, 7:13 pm, Harry <simonsha...@gmail.com> wrote:
> On Apr 13, 6:58 pm, Harry <simonsha...@gmail.com> wrote:
>
> > On Apr 13, 8:30 am, Harry <simonsha...@gmail.com> wrote:
>
> > Guys, I am still somewhat hopeful but don't know what to do or who to
> > ask now.
>
> > Is there any other forum (LVM-related) where I could try asking?
>
> > This is not my area of expertise at all; I use Linux only as an
> > applications user.
>
> > Please help your fallen comrade out...
>
> Based on the contents of /etc/lvm/backup/vg_XYZ (which I provide here,http://superuser.com/questions/411697/lvm-volume-with-corrupt-mbr-how...
> ), is there any way I could programmtically conduct a binary search
> for the correct start of the lv_root? For example,
>
> StartLocation = some 'good' value
> dmsetup create foo --table "0 146997248 linear /dev/sdb2
> $StartLocation"
> if mount -o ro /dev/mapper/foo /mnt succeeds,
> BINGO!
> else
> StartLocation = StartLocation + some 'good' Increment
> dmsetup remove foo
> fi
>
> Based on your recommendations I could try some good values of
> StartLocation and Increment, instead of a brute-force search of the
> entire 80G pv.
-----------------------------------------------
NOTE:
I delete one of my messages (which I posted a few minutes back)
showing the output of the script I wrote. Please ignore that message
and consider this message instead.
-----------------------------------------------
Based on Richard's response (at
http://superuser.com/questions/411697/lvm-volume-with-corrupt-mbr-how...
), I wrote the following script.
------------------------------------------------------
#!/bin/bash
set -u
(( extent_size = 65536 ))
(( pe_start = 2048 ))
# current sector
(( curr = 0 ))
(( Increment = 1 ))
(( maxExtentCount = 126 + 2243 ))
# Clean up any previously existing foo.
if [ -b /dev/mapper/foo ]; then
dmsetup remove foo
fi
while : ; do
(( StartLocation = pe_start + curr * extent_size ))
echo -n "Trying curr = $curr ,StartLocation = $StartLocation ..."
if dmsetup create foo --table "0 146997248 linear /dev/sdb2
$StartLocation" &>/dev/null ; then
if mount -o ro /dev/mapper/foo /mnt &>/dev/null ; then
echo
echo 'BINGO'
break
else
echo " mount failed"
fi
dmsetup remove foo
else
echo " dmsetup failed"
fi
(( curr = curr + Increment ))
if [ $curr -gt $maxExtentCount ]; then
echo "reached maxExtentCount, quitting"
break
fi
done
# Clean up
if [ -b /dev/mapper/foo ]; then
dmsetup remove foo
fi
------------------------------------------------------
No success, though. The above loop ran as follows. Notice, how...
for curr = 0 thru 126, dmsetup succeeds but mount fails
for curr = 126 thru 2369, dmsetup itself fails.
Does that tell you anything else interesting that is not obvious to
me?
Trying curr = 0 ,StartLocation = 2048 ...mount: you must specify the
filesystem type
mount failed
Trying curr = 1 ,StartLocation = 67584 ...mount: you must specify the
filesystem type
mount failed
Trying curr = 2 ,StartLocation = 133120 ...mount: you must specify the
filesystem type
mount failed
Trying curr = 3 ,StartLocation = 198656 ...mount: you must specify the
filesystem type
mount failed
Trying curr = 4 ,StartLocation = 264192 ...mount: you must specify the
filesystem type
mount failed
Trying curr = 5 ,StartLocation = 329728 ...mount: you must specify the
filesystem type
mount failed
...
Trying curr = 125 ,StartLocation = 8194048 ...mount: you must specify
the filesystem type
mount failed
Trying curr = 126 ,StartLocation = 8259584 ...mount: you must specify
the filesystem type
mount failed
Trying curr = 127 ,StartLocation = 8325120 ...device-mapper: resume
ioctl failed: Invalid argument
Command failed
dmsetup failed
Trying curr = 128 ,StartLocation = 8390656 ...device-mapper: resume
ioctl failed: Invalid argument
Command failed
dmsetup failed
Trying curr = 129 ,StartLocation = 8456192 ...device-mapper: resume
ioctl failed: Invalid argument
Command failed
dmsetup failed
Trying curr = 130 ,StartLocation = 8521728 ...device-mapper: resume
ioctl failed: Invalid argument
Command failed
dmsetup failed
...
Trying curr = 2367 ,StartLocation = 155125760 ...device-mapper: resume
ioctl failed: Invalid argument
Command failed
dmsetup failed
Trying curr = 2368 ,StartLocation = 155191296 ...device-mapper: resume
ioctl failed: Invalid argument
Command failed
dmsetup failed
Trying curr = 2369 ,StartLocation = 155256832 ...device-mapper: resume
ioctl failed: Invalid argument
Command failed
dmsetup failed
reached maxExtentCount, quitting
I am not sure if I'm incrementing 'curr' in proper units (sectors/
blocks/extent_size/bytes). Where is this volume backup file
documented, btw? (Googled for it, couldn't find it.)
I would like to understand LVM and even regular partitioning more
thoroughly. Would someone kindly suggest the smallest number of
resources (books, links to online articles/tutorials, etc) that would
teach me not just the commands but the concepts behind them. Anything
and everything above the BIOS and assembly-language I would like to
understand. For example, I won't want to understand the boot code in
the first 446 bytes of MBR but everything else you guys know about
partitioning and LVM.
[toc] | [prev] | [next] | [standalone]
| From | Doug Freyburger <dfreybur@yahoo.com> |
|---|---|
| Date | 2012-04-16 18:47 +0000 |
| Message-ID | <jmhpgo$lc2$1@dont-email.me> |
| In reply to | #2629 |
Harry wrote: > > I would like to understand LVM and even regular partitioning more > thoroughly. Would someone kindly suggest the smallest number of > resources (books, links to online articles/tutorials, etc) that would > teach me not just the commands but the concepts behind them. Anything > and everything above the BIOS and assembly-language I would like to > understand. For example, I won't want to understand the boot code in > the first 446 bytes of MBR but everything else you guys know about > partitioning and LVM. Partitioning takes an entire disk and divides it up into one or more sub-disks. Then each sub-disk is used like it's a disk. You write an MBR to make it bootable, a table of the partitions, then the first partition starts. The software reads the partition tables and uses the numbers as offsets to calculate block addresses inside each sub-disk. There can be details about primary and extended partitions but that's just more of the same. Those details don't change the simple concepts and offset arithmetic of how partitions work. Paritions are formatted to contain file systems. Files live in file systems. Logical volume manager takes one or more disks and puts them into a pool rather like how virtual membery takes one or more memory module and puts them together into a pool. The entire pool is then divided into extents rather like how memory is divided into pages. There's a table of the extents early on the disk rather like there's a table of the pages early in the main memory. Then virtual disks are created out of the pool (logical volumes) rather like process address spaces are created out of the pages in main memory. Logical volumes are formatted to contain file systems. Files live in file systems. It's the same concept mapped as physical slices one way, as a pool of virtual extents the other way. The two layers do mix and match - It's possible to put either entire drives or partitions into the volume group pool. Both levels work at their own level. Your example showed a disk divided into a 250 MB partition used to directly contain a file system (probably /boot) and the rest in the second partition that formed a volume group. Those are the concepts. Each layer has its own tools. fdisk for partitions. vgcreate/vgscan/vgextend/vgreduce/vgchange for volume groups. lvcreate and the other lv* cmmands because that's the extra layer of virtualization. Then both types return to the file system tools like mkfs.
[toc] | [prev] | [next] | [standalone]
| From | Harry <simonsharry@gmail.com> |
|---|---|
| Date | 2012-04-16 20:19 -0700 |
| Message-ID | <16442467.1765.1334632777969.JavaMail.geo-discussion-forums@pbbph3> |
| In reply to | #2657 |
On Tuesday, April 17, 2012 12:17:52 AM UTC+5:30, Doug Freyburger wrote: > Harry wrote: > > > > I would like to understand LVM and even regular partitioning more > > thoroughly. Would someone kindly suggest the smallest number of > > resources (books, links to online articles/tutorials, etc) that would > > teach me not just the commands but the concepts behind them. Anything > > and everything above the BIOS and assembly-language I would like to > > understand. For example, I won't want to understand the boot code in > > the first 446 bytes of MBR but everything else you guys know about > > partitioning and LVM. > > Partitioning takes an entire disk and divides it up into one or more > sub-disks. Then each sub-disk is used like it's a disk. You write an > MBR to make it bootable, a table of the partitions, then the first > partition starts. The software reads the partition tables and uses the > numbers as offsets to calculate block addresses inside each sub-disk. > There can be details about primary and extended partitions but that's > just more of the same. Those details don't change the simple concepts > and offset arithmetic of how partitions work. > > Paritions are formatted to contain file systems. Files live in file > systems. > > Logical volume manager takes one or more disks and puts them into a pool > rather like how virtual membery takes one or more memory module and puts > them together into a pool. The entire pool is then divided into extents > rather like how memory is divided into pages. There's a table of the > extents early on the disk rather like there's a table of the pages early > in the main memory. Then virtual disks are created out of the pool > (logical volumes) rather like process address spaces are created out of > the pages in main memory. > > Logical volumes are formatted to contain file systems. Files live in > file systems. > > It's the same concept mapped as physical slices one way, as a pool of > virtual extents the other way. > > The two layers do mix and match - It's possible to put either entire > drives or partitions into the volume group pool. Both levels work at > their own level. Your example showed a disk divided into a 250 MB > partition used to directly contain a file system (probably /boot) and > the rest in the second partition that formed a volume group. > > Those are the concepts. Each layer has its own tools. fdisk for > partitions. vgcreate/vgscan/vgextend/vgreduce/vgchange for volume > groups. lvcreate and the other lv* cmmands because that's the extra > layer of virtualization. Then both types return to the file system > tools like mkfs. Thanks. This is definitely a good high-level description. On Tuesday, April 17, 2012 12:17:52 AM UTC+5:30, Doug Freyburger wrote: > Harry wrote: > > > > I would like to understand LVM and even regular partitioning more > > thoroughly. Would someone kindly suggest the smallest number of > > resources (books, links to online articles/tutorials, etc) that would > > teach me not just the commands but the concepts behind them. Anything > > and everything above the BIOS and assembly-language I would like to > > understand. For example, I won't want to understand the boot code in > > the first 446 bytes of MBR but everything else you guys know about > > partitioning and LVM. > > Partitioning takes an entire disk and divides it up into one or more > sub-disks. Then each sub-disk is used like it's a disk. You write an > MBR to make it bootable, a table of the partitions, then the first > partition starts. The software reads the partition tables and uses the > numbers as offsets to calculate block addresses inside each sub-disk. > There can be details about primary and extended partitions but that's > just more of the same. Those details don't change the simple concepts > and offset arithmetic of how partitions work. > > Paritions are formatted to contain file systems. Files live in file > systems. > > Logical volume manager takes one or more disks and puts them into a pool > rather like how virtual membery takes one or more memory module and puts > them together into a pool. The entire pool is then divided into extents > rather like how memory is divided into pages. There's a table of the > extents early on the disk rather like there's a table of the pages early > in the main memory. Then virtual disks are created out of the pool > (logical volumes) rather like process address spaces are created out of > the pages in main memory. > > Logical volumes are formatted to contain file systems. Files live in > file systems. > > It's the same concept mapped as physical slices one way, as a pool of > virtual extents the other way. > > The two layers do mix and match - It's possible to put either entire > drives or partitions into the volume group pool. Both levels work at > their own level. Your example showed a disk divided into a 250 MB > partition used to directly contain a file system (probably /boot) and > the rest in the second partition that formed a volume group. > > Those are the concepts. Each layer has its own tools. fdisk for > partitions. vgcreate/vgscan/vgextend/vgreduce/vgchange for volume > groups. lvcreate and the other lv* cmmands because that's the extra > layer of virtualization. Then both types return to the file system > tools like mkfs. Thanks, Doug. What you wrote above should serve as a good conceptual overview. However, I'd still want to read a book or an online resource that explains things both conceptually and at a practitioner's level. Basically, I'd like to be able to troubleshoot my own problems. Here's one resource I found: http://docs.fedoraproject.org/en-US/Fedora/14/html/Storage_Administration_Guide/index.html But skimming thru it tells me that this won't cover concepts in detail; it uses GUI versions of various tools is another thing. I tend to like O'reilly style presentation/coverage of a topic, and, it seems, there's no (current) book by O'reilly on LVM2. If you/others know of a good O'reilly type of self-learning resource, I'd like to hear about it. Also, I'm hoping I'd be able to do hands on exercises in a virtualized environment (VirtualBox, Xen, etc). If you know of any good tutorial that uses such a setup to teach you LVM, please do share.
[toc] | [prev] | [next] | [standalone]
| From | unruh <unruh@invalid.ca> |
|---|---|
| Date | 2012-04-13 15:22 +0000 |
| Message-ID | <1xXhr.279$KQ2.208@newsfe15.iad> |
| In reply to | #2620 |
On 2012-04-13, Harry <simonsharry@gmail.com> wrote: > On Apr 13, 8:30?am, Harry <simonsha...@gmail.com> wrote: > > Guys, I am still somewhat hopeful but don't know what to do or who to > ask now. > > Is there any other forum (LVM-related) where I could try asking? > > This is not my area of expertise at all; I use Linux only as an > applications user. > > Please help your fallen comrade out... We have tried. If you want to look for a company which specialises in recovering data from hard disks, it may be time to do that.
[toc] | [prev] | [next] | [standalone]
| From | J G Miller <miller@yoyo.ORG> |
|---|---|
| Date | 2012-04-13 17:13 +0000 |
| Message-ID | <jm9mrs$4sg$9@dont-email.me> |
| In reply to | #2620 |
On Friday, April 13th, 2012, at 06:58:19h -0700, Harry explained: > Guys, I am still somewhat hopeful ... Have you tried any of these tools? <http://www.sleuthkit.ORG/sleuthkit/> <http://www.sleuthkit.ORG/autopsy/> <http://www.digital-forensic.ORG/framework/download/>
[toc] | [prev] | [next] | [standalone]
| From | Harry <simonsharry@gmail.com> |
|---|---|
| Date | 2012-04-13 21:58 -0700 |
| Message-ID | <48d95176-c015-43b2-bf36-a4fc81fd067d@is10g2000pbc.googlegroups.com> |
| In reply to | #2624 |
On Apr 13, 10:13 pm, J G Miller <mil...@yoyo.ORG> wrote: > On Friday, April 13th, 2012, at 06:58:19h -0700, Harry explained: > > > Guys, I am still somewhat hopeful ... > > Have you tried any of these tools? > > <http://www.sleuthkit.ORG/sleuthkit/> > > <http://www.sleuthkit.ORG/autopsy/> > > <http://www.digital-forensic.ORG/framework/download/> No, I haven't. But I did try TestDisk in non-modifying mode and it didn't help.
[toc] | [prev] | [next] | [standalone]
| From | unruh <unruh@invalid.ca> |
|---|---|
| Date | 2012-04-12 15:50 +0000 |
| Message-ID | <TQChr.1166$9g4.978@newsfe21.iad> |
| In reply to | #2585 |
On 2012-04-12, Harry <simonsharry@gmail.com> wrote: > On Apr 12, 4:36?pm, Richard Kettlewell <r...@greenend.org.uk> wrote: >> Harry <simonsha...@gmail.com> writes: >> > Richard Kettlewell <r...@greenend.org.uk> wrote: >> >> Harry <simonsha...@gmail.com> writes: >> >>> Then, I used `e2fsck -b SUPERBLOCK /dev/sda`, with each of the >> >>> `SUPERBLOCK` values listed above, like so: >> >> >>> ? ? ? ? [root@localhost liveuser]# e2fsck -b 32768 /dev/sda >> >> >> Did you mean sda or sda1 here? ?(And similarly elsewhere.) >> >> > I meant sda2 throughout; the /dev/sda1 partition is just fine. >> >> Passing the right device name to e2fsck might help, then. >> (How do you expect anyone to help you if you don't describe the >> situation accurately?) >> >> > Fyi, the `fdisk -l` prints this: >> > ? ? Disk /dev/sda: 80.0 GB, 80026361856 bytes >> > ? ? 255 heads, 63 sectors/track, 9729 cylinders, total 156301488 >> > sectors >> > ? ? Units = sectors of 1 * 512 = 512 bytes >> > ? ? Sector size (logical/physical): 512 bytes / 512 bytes >> > ? ? I/O size (minimum/optimal): 512 bytes / 512 bytes >> > ? ? Disk identifier: 0x00000000 >> >> > ? ? ? ?Device Boot ? ? ?Start ? ? ? ? End ? ? ?Blocks ? Id ?System >> > ? ? /dev/sda1 ? * ? ? ? ?2048 ? ? 1026047 ? ? ?512000 ? 83 ?Linux >> > ? ? /dev/sda2 ? ? ? ? 1026048 ? 156301311 ? ?77637632 ? 8e ?Linux LVM >> >> If those IDs are accurate then there's no filesystem in sda2, but rather >> an LVM PV, which would explain why attempts to use ext4 tools on it >> don't work. > > Richard, let me first come out clean with the whole truth. > > Since my original post to superuser.com, I had switched the location > of the problem disk from it being 'sda' originally to being 'sdb' now. > This is because the original 'sdb' had a freshly installed, bootable > OS (Fedora 16) and it was bigger (250 GB) - so I thought I'd make it > my 'primary' disk (or, 'sda'), and keep the older 80 G disk as the > 'secondary' (or, 'sdb') disk. > > However, just before pasting the `fdisk -l` output for you (in my > previous post to you), I simply searched and replaced 'sdb' with 'sda' > in the `fdisk -l` output to make my message on this forum look > consistent with what I posted yesterday on superuser.com. And you expect help? Wi > > Here is the unedited output of `fdisk -l` on the system that has this > problem disk currently: > > Disk /dev/sdb: 80.0 GB, 80026361856 bytes > 255 heads, 63 sectors/track, 9729 cylinders, total 156301488 > sectors > Units = sectors of 1 * 512 = 512 bytes > Sector size (logical/physical): 512 bytes / 512 bytes > I/O size (minimum/optimal): 512 bytes / 512 bytes > Disk identifier: 0x00000000 > > Device Boot Start End Blocks Id System > /dev/sdb1 * 2048 1026047 512000 83 Linux > /dev/sdb2 1026048 156301311 77637632 8e Linux LVM > >> > Can you/somebody please help me? I have not modified the state of the >> > disk in any other way other than first 446 bytes of MBR via the `dd` >> > command, so all the data should literally be sitting there. >> >> If that's what you actually did then it won't have touched the contents >> of any partitions, and certainly not sda2 which is 501MB into the disk. >> However, you seem to have a habit of getting device names wrong, which >> might explain what really happened. >> > > I have a very, /VERY/ basic idea of partitions; other than a 1-line > description of benefits of the LVM feature / concept, I don't really > know how to handle them, especially when something (like this) goes > wrong. Would you be able to (*please*) guide me with the necessary > steps that i need to carry out *now* to fix this situation? Can't even > begin to tell you, how much I would appreciate yours (or any other > reader's) help at this point. You can reprimand me as much as you like > on the way, I most certainly deserve it. > > Aside: The basic problem here has been this: I've been using Linux for > a while but only as a blackbox user - (1) to avoid using Windows, and > (2)I love it, as it has tons of great and free software. Now, I tend > to go with the defaults during installs and I am learning the systems > side slowly in a background thread. Though I have not master these > details fully, this time I somehow thought I had learned > 'enough' (about the `dd` command and the MBR) when this disaster > happened. I was very lazy also in not taking the backup... as it was a > mere 446 byte chunk. But officer, how was I to know that shooting him in the head would kill him. It was only a very tiny hole!
[toc] | [prev] | [next] | [standalone]
| From | The Natural Philosopher <tnp@invalid.invalid> |
|---|---|
| Date | 2012-04-12 21:37 +0100 |
| Message-ID | <jm7edv$h47$2@news.albasani.net> |
| In reply to | #2589 |
unruh wrote: > > > But officer, how was I to know that shooting him in the head would kill > him. It was only a very tiny hole! > :-) -- To people who know nothing, anything is possible. To people who know too much, it is a sad fact that they know how little is really possible - and how hard it is to achieve it.
[toc] | [prev] | [next] | [standalone]
| From | unruh <unruh@invalid.ca> |
|---|---|
| Date | 2012-04-12 15:46 +0000 |
| Message-ID | <BNChr.19767$ie6.15375@newsfe14.iad> |
| In reply to | #2583 |
On 2012-04-12, Harry <simonsharry@gmail.com> wrote: > On Apr 12, 3:46?pm, Richard Kettlewell <r...@greenend.org.uk> wrote: >> Harry <simonsha...@gmail.com> writes: >> > Then, I used `e2fsck -b SUPERBLOCK /dev/sda`, with each of the >> > `SUPERBLOCK` values listed above, like so: >> >> > ? ? ? ? [root@localhost liveuser]# e2fsck -b 32768 /dev/sda >> >> Did you mean sda or sda1 here? ?(And similarly elsewhere.) > > I meant sda2 throughout; the /dev/sda1 partition is just fine. I am very confused. Why in the world would you be writting to /dev/sda2 in order to make it bootable? Booting is usually from the MBR of the disk, not from the partitions. So, what did you actually do. Please tell us exactly without any misprints this time. > > Fyi, the `fdisk -l` prints this: > Disk /dev/sda: 80.0 GB, 80026361856 bytes > 255 heads, 63 sectors/track, 9729 cylinders, total 156301488 > sectors > Units = sectors of 1 * 512 = 512 bytes > Sector size (logical/physical): 512 bytes / 512 bytes > I/O size (minimum/optimal): 512 bytes / 512 bytes > Disk identifier: 0x00000000 > > Device Boot Start End Blocks Id System > /dev/sda1 * 2048 1026047 512000 83 Linux > /dev/sda2 1026048 156301311 77637632 8e Linux LVM Is sda2 really LVM or is this another misprint or evidence of the destruction you caused? > > Can you/somebody please help me? I have not modified the state of the > disk in any other way other than first 446 bytes of MBR via the `dd` > command, so all the data should literally be sitting there. Of the MBR or of the second partition? Which? > >> Next time make a backup first. > Yes, I have learnt the lesson a VERY PAINFUL way. I thought I was > smart enough for the 'simple-enough' operation I was doing. I guess that is usually the way people learn. If you really value the data on that disk, buy another disk, do a dd copy of this disk to that new disk, and do all your experiments on the new disk.
[toc] | [prev] | [next] | [standalone]
| From | Harry <simonsharry@gmail.com> |
|---|---|
| Date | 2012-04-12 09:35 -0700 |
| Message-ID | <830eb712-4cc7-400a-9d24-f6c538a260a1@w6g2000pbp.googlegroups.com> |
| In reply to | #2588 |
On Apr 12, 8:46 pm, unruh <un...@invalid.ca> wrote: > On 2012-04-12, Harry <simonsha...@gmail.com> wrote: > > > On Apr 12, 3:46?pm, Richard Kettlewell <r...@greenend.org.uk> wrote: > >> Harry <simonsha...@gmail.com> writes: > >> > Then, I used `e2fsck -b SUPERBLOCK /dev/sda`, with each of the > >> > `SUPERBLOCK` values listed above, like so: > > >> > ? ? ? ? [root@localhost liveuser]# e2fsck -b 32768 /dev/sda > > >> Did you mean sda or sda1 here? ?(And similarly elsewhere.) > > > I meant sda2 throughout; the /dev/sda1 partition is just fine. > > I am very confused. Why in the world would you be writting to /dev/sda2 > in order to make it bootable? Booting is usually from the MBR of the > disk, not from the partitions. So, what did you actually do. Please tell > us exactly without any misprints this time. > > > > > Fyi, the `fdisk -l` prints this: > > Disk /dev/sda: 80.0 GB, 80026361856 bytes > > 255 heads, 63 sectors/track, 9729 cylinders, total 156301488 > > sectors > > Units = sectors of 1 * 512 = 512 bytes > > Sector size (logical/physical): 512 bytes / 512 bytes > > I/O size (minimum/optimal): 512 bytes / 512 bytes > > Disk identifier: 0x00000000 > > > Device Boot Start End Blocks Id System > > /dev/sda1 * 2048 1026047 512000 83 Linux > > /dev/sda2 1026048 156301311 77637632 8e Linux LVM > > Is sda2 really LVM or is this another misprint or evidence of the > destruction you caused? > > > > > Can you/somebody please help me? I have not modified the state of the > > disk in any other way other than first 446 bytes of MBR via the `dd` > > command, so all the data should literally be sitting there. > > Of the MBR or of the second partition? Which? > > > > >> Next time make a backup first. > > Yes, I have learnt the lesson a VERY PAINFUL way. I thought I was > > smart enough for the 'simple-enough' operation I was doing. > > I guess that is usually the way people learn. If you really value the > data on that disk, buy another disk, do a dd copy of this disk to that > new disk, and do all your experiments on the new disk. unruh, I do expect to be reprimanded so cannot and thus won't fire back at you... I'm clarifying what I did in Doug's post. Otherwise, I'll have repeat the same info in multiple responses. If you can, please be around.
[toc] | [prev] | [next] | [standalone]
| From | unruh <unruh@invalid.ca> |
|---|---|
| Date | 2012-04-12 18:57 +0000 |
| Message-ID | <8AFhr.29671$cP4.15039@newsfe01.iad> |
| In reply to | #2591 |
On 2012-04-12, Harry <simonsharry@gmail.com> wrote: > On Apr 12, 8:46?pm, unruh <un...@invalid.ca> wrote: >> On 2012-04-12, Harry <simonsha...@gmail.com> wrote: >> >> > On Apr 12, 3:46?pm, Richard Kettlewell <r...@greenend.org.uk> wrote: >> >> Harry <simonsha...@gmail.com> writes: >> >> > Then, I used `e2fsck -b SUPERBLOCK /dev/sda`, with each of the >> >> > `SUPERBLOCK` values listed above, like so: >> >> >> > ? ? ? ? [root@localhost liveuser]# e2fsck -b 32768 /dev/sda >> >> >> Did you mean sda or sda1 here? ?(And similarly elsewhere.) >> >> > I meant sda2 throughout; the /dev/sda1 partition is just fine. >> >> I am very confused. Why in the world would you be writting to /dev/sda2 >> in order to make it bootable? Booting is usually from the MBR of the >> disk, not from the partitions. So, what did you actually do. Please tell >> us exactly without any misprints this time. >> >> >> >> > Fyi, the `fdisk -l` prints this: >> > ? ? Disk /dev/sda: 80.0 GB, 80026361856 bytes >> > ? ? 255 heads, 63 sectors/track, 9729 cylinders, total 156301488 >> > sectors >> > ? ? Units = sectors of 1 * 512 = 512 bytes >> > ? ? Sector size (logical/physical): 512 bytes / 512 bytes >> > ? ? I/O size (minimum/optimal): 512 bytes / 512 bytes >> > ? ? Disk identifier: 0x00000000 >> >> > ? ? ? ?Device Boot ? ? ?Start ? ? ? ? End ? ? ?Blocks ? Id ?System >> > ? ? /dev/sda1 ? * ? ? ? ?2048 ? ? 1026047 ? ? ?512000 ? 83 ?Linux >> > ? ? /dev/sda2 ? ? ? ? 1026048 ? 156301311 ? ?77637632 ? 8e ?Linux LVM >> >> Is sda2 really LVM or is this another misprint or evidence of the >> destruction you caused? >> >> >> >> > Can you/somebody please help me? I have not modified the state of the >> > disk in any other way other than first 446 bytes of MBR via the `dd` >> > command, so all the data should literally be sitting there. >> >> Of the MBR or of the second partition? Which? >> >> >> >> >> Next time make a backup first. >> > Yes, I have learnt the lesson a VERY PAINFUL way. I thought I was >> > smart enough for the 'simple-enough' operation I was doing. >> >> I guess that is usually the way people learn. If you really value the >> data on that disk, buy another disk, do a dd copy of this disk to that >> new disk, and do all your experiments on the new disk. > > unruh, I do expect to be reprimanded so cannot and thus won't fire > back at you... > I'm clarifying what I did in Doug's post. Otherwise, I'll have repeat > the same info in multiple responses. If you can, please be around. The reprimand is for lack of clarity. However my advice still stands. Do not try to fix the original. Buy a new disk and do a dd copy from the first to that, and then fix that copy. If your data is not worth $100, then format the disk and start over. You will waste more than $100 of time.
[toc] | [prev] | [next] | [standalone]
| From | Doug Freyburger <dfreybur@yahoo.com> |
|---|---|
| Date | 2012-04-12 15:59 +0000 |
| Message-ID | <jm6u4b$av1$1@dont-email.me> |
| In reply to | #2581 |
Harry wrote: > > ================= > Details of what I did: > ================= > > Using the `dd` command, I was hoping that I would be able to copy over > the first 446 bytes from Disk B (250GB) to Disk A (80GB), in order to > make Disk A bootable just like Disk B. I issued the command: > > dd if=/dev/sdb of=/dev/sda bs=446 count=1 > > But when I could not boot up from `sda`, I rebooted from `sdb` to see > what was going on. To my horror, `sda` was being reported to have a > bad superblock, now. Okay, let's step back and think about what you did compared to what you have been trying to do since. What you did - Take the partition table of disk sdb and write it to the partition table of disk sda. That means nothing on sdb partitions is effected. That means the partitions that used to be on sda have been destroyed but none of the data inside those former partitions has been touched. What you have been trying to do since - Work on in invalid partitions that got cloned form disk sdb. No amount of effort on this front can ever possibily work. Either the partition tables started out identical and you saw no effect and none of this ever happened or they are different and you are now trying to work on incorrect partition data. That can't ever help. So what do you need to do? You need to stop working on the invalid partitions in the table and start working on restoring the correct partitions. Nothing else is going to help. Do you have a print out of the partition table that used to be on disk sda? If you do your situtation is promising. If you don't it's time to start guessing. Get the print out. Do "fdisk /dev/sda". By hand delete all of the partitions that exist on it - They were copied in place and are not valid. Then by hand create the partitions in the sizes and locations they used to exist. Save it and reboot. Try the fsck again. If it worked you're done with the debugging. Back to the drawing board of how to mark a drive bootable - You have learned that's not the way. If you got it wrong your saving grace is so far all you have written to is the partition table. All of the data in the former partitions is still there. So start using "fdisk /dev/sda" and start guessing at how many partitions there used to be and what sizes they used to be. Hint - Start by guessing one partition on the whole disk. Then one partition on half of it. Then one partition on 3/4ths of it or whatever. Do a binary descent. Eventually you'll know the exact size and location of the first partition. If there's a second partition it will start one cylinder after the first. Initial guess is the rest of the drive. Lather rinse repeat until you have it figured out. The hard part will be figuring out the size of any swap partition because fsck won't help. You hope that drive only had filesystems. That's your strategy. Don't bother with any work on data inside the partitions that are there now because the partition table is not correct.
[toc] | [prev] | [next] | [standalone]
| From | unruh <unruh@invalid.ca> |
|---|---|
| Date | 2012-04-12 16:39 +0000 |
| Message-ID | <VyDhr.239$bu1.132@newsfe15.iad> |
| In reply to | #2590 |
On 2012-04-12, Doug Freyburger <dfreybur@yahoo.com> wrote: > Harry wrote: >> >> ================= >> Details of what I did: >> ================= >> >> Using the `dd` command, I was hoping that I would be able to copy over >> the first 446 bytes from Disk B (250GB) to Disk A (80GB), in order to >> make Disk A bootable just like Disk B. I issued the command: >> >> dd if=/dev/sdb of=/dev/sda bs=446 count=1 >> >> But when I could not boot up from `sda`, I rebooted from `sdb` to see >> what was going on. To my horror, `sda` was being reported to have a >> bad superblock, now. > > Okay, let's step back and think about what you did compared to what you > have been trying to do since. Of course we have no idea if that is actually what he did, since he keeps revising his statements. For example, maybe that was really bs=446K. He first said everywhere that sda was written he meant sda2. Is this one of those cases? It seems like it since he also says that sda1 partition is fine, and the partition table is readable by fdisk. > > What you did - Take the partition table of disk sdb and write it to the > partition table of disk sda. That means nothing on sdb partitions is > effected. That means the partitions that used to be on sda have been > destroyed but none of the data inside those former partitions has been > touched. It is also unclear what the partitions were. It would seem, but who knows, that sdb2 ( since he has also told us he lied about the sda and sdb labeling) is an LVM partition. (Why? Oh well.) > > What you have been trying to do since - Work on in invalid partitions > that got cloned form disk sdb. No amount of effort on this front can > ever possibily work. Either the partition tables started out identical > and you saw no effect and none of this ever happened or they are > different and you are now trying to work on incorrect partition data. > That can't ever help. > > So what do you need to do? You need to stop working on the invalid > partitions in the table and start working on restoring the correct > partitions. Nothing else is going to help. > > Do you have a print out of the partition table that used to be on disk > sda? If you do your situtation is promising. If you don't it's time to > start guessing. > > Get the print out. Do "fdisk /dev/sda". By hand delete all of the > partitions that exist on it - They were copied in place and are not > valid. Then by hand create the partitions in the sizes and locations > they used to exist. Save it and reboot. Try the fsck again. If it > worked you're done with the debugging. Back to the drawing board of how > to mark a drive bootable - You have learned that's not the way. As I said, he should clone the disk and work on the clone only. He is liable to mess things up still further by trying to fix things. > > If you got it wrong your saving grace is so far all you have written to > is the partition table. All of the data in the former partitions is > still there. So start using "fdisk /dev/sda" and start guessing at how > many partitions there used to be and what sizes they used to be. Hint - > Start by guessing one partition on the whole disk. Then one partition > on half of it. Then one partition on 3/4ths of it or whatever. Do a > binary descent. Eventually you'll know the exact size and location of > the first partition. > > If there's a second partition it will start one cylinder after the > first. Initial guess is the rest of the drive. Lather rinse repeat > until you have it figured out. > > The hard part will be figuring out the size of any swap partition > because fsck won't help. You hope that drive only had filesystems. > > That's your strategy. Don't bother with any work on data inside the > partitions that are there now because the partition table is not correct.
[toc] | [prev] | [next] | [standalone]
| From | Harry <simonsharry@gmail.com> |
|---|---|
| Date | 2012-04-12 09:53 -0700 |
| Message-ID | <8ccb9bb3-d067-4f9c-a13f-d177dc5d64da@vk10g2000pbc.googlegroups.com> |
| In reply to | #2592 |
On Apr 12, 9:39 pm, unruh <un...@invalid.ca> wrote: > On 2012-04-12, Doug Freyburger <dfrey...@yahoo.com> wrote: > > > > > > > > > > > Harry wrote: > > >> ================= > >> Details of what I did: > >> ================= > > >> Using the `dd` command, I was hoping that I would be able to copy over > >> the first 446 bytes from Disk B (250GB) to Disk A (80GB), in order to > >> make Disk A bootable just like Disk B. I issued the command: > > >> dd if=/dev/sdb of=/dev/sda bs=446 count=1 > > >> But when I could not boot up from `sda`, I rebooted from `sdb` to see > >> what was going on. To my horror, `sda` was being reported to have a > >> bad superblock, now. > > > Okay, let's step back and think about what you did compared to what you > > have been trying to do since. > > Of course we have no idea if that is actually what he did, since he > keeps revising his statements. For example, maybe that was really > bs=446K. He first said everywhere that sda was written he meant sda2. Is > this one of those cases? It seems like it since he also says that sda1 > partition is fine, and the partition table is readable by fdisk. > > > > > What you did - Take the partition table of disk sdb and write it to the > > partition table of disk sda. That means nothing on sdb partitions is > > effected. That means the partitions that used to be on sda have been > > destroyed but none of the data inside those former partitions has been > > touched. > > It is also unclear what the partitions were. It would seem, but who > knows, that sdb2 ( since he has also told us he lied about the sda and > sdb labeling) is an LVM partition. (Why? Oh well.) > > > > > > > > > > > > > What you have been trying to do since - Work on in invalid partitions > > that got cloned form disk sdb. No amount of effort on this front can > > ever possibily work. Either the partition tables started out identical > > and you saw no effect and none of this ever happened or they are > > different and you are now trying to work on incorrect partition data. > > That can't ever help. > > > So what do you need to do? You need to stop working on the invalid > > partitions in the table and start working on restoring the correct > > partitions. Nothing else is going to help. > > > Do you have a print out of the partition table that used to be on disk > > sda? If you do your situtation is promising. If you don't it's time to > > start guessing. > > > Get the print out. Do "fdisk /dev/sda". By hand delete all of the > > partitions that exist on it - They were copied in place and are not > > valid. Then by hand create the partitions in the sizes and locations > > they used to exist. Save it and reboot. Try the fsck again. If it > > worked you're done with the debugging. Back to the drawing board of how > > to mark a drive bootable - You have learned that's not the way. > > As I said, he should clone the disk and work on the clone only. He is > liable to mess things up still further by trying to fix things. > > > > > > > > > > > If you got it wrong your saving grace is so far all you have written to > > is the partition table. All of the data in the former partitions is > > still there. So start using "fdisk /dev/sda" and start guessing at how > > many partitions there used to be and what sizes they used to be. Hint - > > Start by guessing one partition on the whole disk. Then one partition > > on half of it. Then one partition on 3/4ths of it or whatever. Do a > > binary descent. Eventually you'll know the exact size and location of > > the first partition. > > > If there's a second partition it will start one cylinder after the > > first. Initial guess is the rest of the drive. Lather rinse repeat > > until you have it figured out. > > > The hard part will be figuring out the size of any swap partition > > because fsck won't help. You hope that drive only had filesystems. > > > That's your strategy. Don't bother with any work on data inside the > > partitions that are there now because the partition table is not correct. unruh, I indeed have a cloned image of the original messed up device (/ dev/sda). Please forgive my typos in my original post. This doesn't mean that everything I wrote had a typo in it. The `dd` command that I issued, e.g., has no typos in the original post. I know there is a way to mount the image of the clone device (partition?) in loopback mode. If you/Doug/sb can provide step by step instructions, then I would be very grateful to you.
[toc] | [prev] | [next] | [standalone]
| From | unruh <unruh@invalid.ca> |
|---|---|
| Date | 2012-04-12 19:03 +0000 |
| Message-ID | <OFFhr.7095$Nk2.6735@newsfe08.iad> |
| In reply to | #2594 |
On 2012-04-12, Harry <simonsharry@gmail.com> wrote: > On Apr 12, 9:39?pm, unruh <un...@invalid.ca> wrote: >> On 2012-04-12, Doug Freyburger <dfrey...@yahoo.com> wrote: >> >> >> >> >> >> >> >> >> >> > Harry wrote: >> >> >> ================= >> >> Details of what I did: >> >> ================= >> >> >> Using the `dd` command, I was hoping that I would be able to copy over >> >> the first 446 bytes from Disk B (250GB) to Disk A (80GB), in order to >> >> make Disk A bootable just like Disk B. I issued the command: >> >> >> ? ? dd if=/dev/sdb of=/dev/sda bs=446 count=1 >> >> >> But when I could not boot up from `sda`, I rebooted from `sdb` to see >> >> what was going on. To my horror, `sda` was being reported to have a >> >> bad superblock, now. >> >> > Okay, let's step back and think about what you did compared to what you >> > have been trying to do since. >> >> Of course we have no idea if that is actually what he did, since he >> keeps revising his statements. For example, maybe that was really >> bs=446K. He first said everywhere that sda was written he meant sda2. Is >> this one of those cases? It seems like it since he also says that sda1 >> partition is fine, and the partition table is readable by fdisk. >> >> >> >> > What you did - Take the partition table of disk sdb and write it to the >> > partition table of disk sda. ?That means nothing on sdb partitions is >> > effected. ?That means the partitions that used to be on sda have been >> > destroyed but none of the data inside those former partitions has been >> > touched. >> >> It is also unclear what the partitions were. It would seem, but who >> knows, that sdb2 ( since he has also told us he lied about the sda and >> sdb labeling) is an LVM partition. (Why? Oh well.) >> >> >> >> >> >> >> >> >> >> >> >> > What you have been trying to do since - Work on in invalid partitions >> > that got cloned form disk sdb. ?No amount of effort on this front can >> > ever possibily work. ?Either the partition tables started out identical >> > and you saw no effect and none of this ever happened or they are >> > different and you are now trying to work on incorrect partition data. >> > That can't ever help. >> >> > So what do you need to do? ?You need to stop working on the invalid >> > partitions in the table and start working on restoring the correct >> > partitions. ?Nothing else is going to help. >> >> > Do you have a print out of the partition table that used to be on disk >> > sda? ?If you do your situtation is promising. ?If you don't it's time to >> > start guessing. >> >> > Get the print out. ?Do "fdisk /dev/sda". ?By hand delete all of the >> > partitions that exist on it - They were copied in place and are not >> > valid. ?Then by hand create the partitions in the sizes and locations >> > they used to exist. ?Save it and reboot. ?Try the fsck again. ?If it >> > worked you're done with the debugging. ?Back to the drawing board of how >> > to mark a drive bootable - You have learned that's not the way. >> >> As I said, he should clone the disk and work on the clone only. He is >> liable to mess things up still further by trying to fix things. >> >> >> >> >> >> >> >> >> >> > If you got it wrong your saving grace is so far all you have written to >> > is the partition table. ?All of the data in the former partitions is >> > still there. ?So start using "fdisk /dev/sda" and start guessing at how >> > many partitions there used to be and what sizes they used to be. ?Hint - >> > Start by guessing one partition on the whole disk. ?Then one partition >> > on half of it. ?Then one partition on 3/4ths of it or whatever. ?Do a >> > binary descent. ?Eventually you'll know the exact size and location of >> > the first partition. >> >> > If there's a second partition it will start one cylinder after the >> > first. ?Initial guess is the rest of the drive. ?Lather rinse repeat >> > until you have it figured out. >> >> > The hard part will be figuring out the size of any swap partition >> > because fsck won't help. ?You hope that drive only had filesystems. >> >> > That's your strategy. ?Don't bother with any work on data inside the >> > partitions that are there now because the partition table is not correct. > > unruh, I indeed have a cloned image of the original messed up device (/ > dev/sda). > > Please forgive my typos in my original post. This doesn't mean that > everything I wrote had a typo in it. The `dd` command that I issued, > e.g., has no typos in the original post. > > I know there is a way to mount the image of the clone device > (partition?) in loopback mode. If you/Doug/sb can provide step by step > instructions, then I would be very grateful to you. OK, so you have put away the original disk in a safe place, and will not touch it. It is the clone you are working on. Then as doug says, your partition table is probably messed up. Thus you have no reason to trust anything it says (fdisk -l), and as he says, you have to try to reconstruct it. Ie, you have to repartition the clone so that its partitions are the same as they were before you made your mistake. Do you have any information about how they were partitioned? When you partitioned it originally, how did you do it? do you accept defaults or do you round up (eg the first partition has 10GB and the second the rest). If you really cannot remember, I do not think that there is any way of finding out-- at least I do not know of any. There may well be something in the structure of the disk that tells you from the structure of the data where the second partition starts. How well used is the disk? Is there liable to be a huge blank space before the next partition because that space was never used?
[toc] | [prev] | [next] | [standalone]
| From | Harry <simonsharry@gmail.com> |
|---|---|
| Date | 2012-04-12 09:48 -0700 |
| Message-ID | <f0285628-0bee-42dc-bf1b-5d73afbac0ab@vy9g2000pbc.googlegroups.com> |
| In reply to | #2590 |
On Apr 12, 8:59 pm, Doug Freyburger <dfrey...@yahoo.com> wrote: > Harry wrote: > > > ================= > > Details of what I did: > > ================= > > > Using the `dd` command, I was hoping that I would be able to copy over > > the first 446 bytes from Disk B (250GB) to Disk A (80GB), in order to > > make Disk A bootable just like Disk B. I issued the command: > > > dd if=/dev/sdb of=/dev/sda bs=446 count=1 > > > But when I could not boot up from `sda`, I rebooted from `sdb` to see > > what was going on. To my horror, `sda` was being reported to have a > > bad superblock, now. > > Okay, let's step back and think about what you did compared to what you > have been trying to do since. > > What you did - Take the partition table of disk sdb and write it to the > partition table of disk sda. That means nothing on sdb partitions is > effected. That means the partitions that used to be on sda have been > destroyed but none of the data inside those former partitions has been > touched. That's correct. With you so far. > What you have been trying to do since - Work on in invalid partitions > that got cloned form disk sdb. No amount of effort on this front can > ever possibily work. Either the partition tables started out identical > and you saw no effect and none of this ever happened or they are > different and you are now trying to work on incorrect partition data. > That can't ever help. > > So what do you need to do? You need to stop working on the invalid > partitions in the table and start working on restoring the correct > partitions. Nothing else is going to help. Yes, all I am interested in right now is to *somehow* be able to recover the filesystem (ext4) and the data on it. > Do you have a print out of the partition table that used to be on disk > sda? If you do your situtation is promising. If you don't it's time to > start guessing. No, I don't have a printout of the partition table of the former sda. > Get the print out. Do "fdisk /dev/sda". By hand delete all of the > partitions that exist on it - They were copied in place and are not > valid. Then by hand create the partitions in the sizes and locations > they used to exist. Save it and reboot. Try the fsck again. If it > worked you're done with the debugging. Back to the drawing board of how > to mark a drive bootable - You have learned that's not the way. > > If you got it wrong your saving grace is so far all you have written to > is the partition table. All of the data in the former partitions is > still there. So start using "fdisk /dev/sda" and start guessing at how > many partitions there used to be and what sizes they used to be. Hint - > Start by guessing one partition on the whole disk. Then one partition > on half of it. Then one partition on 3/4ths of it or whatever. Do a > binary descent. Eventually you'll know the exact size and location of > the first partition. > > If there's a second partition it will start one cylinder after the > first. Initial guess is the rest of the drive. Lather rinse repeat > until you have it figured out. > > The hard part will be figuring out the size of any swap partition > because fsck won't help. You hope that drive only had filesystems. > > That's your strategy. Don't bother with any work on data inside the > partitions that are there now because the partition table is not correct. Doug, after getting some revelations from Richard above (on LVM and the futilitiy of using ext4 tools directly on it), I have described my situation more (and hopefully) better at the following superuser.com link. Not sure if it would be rude on my part to ask you this, but if you don't mind the inconvenience of clicking this link, you will see a more succinct and helpful description of my problem. Superuser.com link: http://superuser.com/questions/411697/lvm-volume-with-corrupt-mbr-how-to-mount-and-recover-data-from-it Before I try the binary descent approach you suggest above, may I request you to go over this new superuser.com link and let me know if you still thing nothing else simpler is possible to salvage the file system sitting in the logical volume somewhere. Many, many thanks to unruh and yourself for responding. I will be forever grateful to you guys if you can help me salvage my data.
[toc] | [prev] | [next] | [standalone]
| From | unruh <unruh@invalid.ca> |
|---|---|
| Date | 2012-04-12 19:07 +0000 |
| Message-ID | <3KFhr.60958$%P4.46258@newsfe05.iad> |
| In reply to | #2593 |
On 2012-04-12, Harry <simonsharry@gmail.com> wrote: > On Apr 12, 8:59 pm, Doug Freyburger <dfrey...@yahoo.com> wrote: >> Harry wrote: >> >> > ================= >> > Details of what I did: >> > ================= >> >> > Using the `dd` command, I was hoping that I would be able to copy over >> > the first 446 bytes from Disk B (250GB) to Disk A (80GB), in order to >> > make Disk A bootable just like Disk B. I issued the command: >> >> > dd if=/dev/sdb of=/dev/sda bs=446 count=1 >> >> > But when I could not boot up from `sda`, I rebooted from `sdb` to see >> > what was going on. To my horror, `sda` was being reported to have a >> > bad superblock, now. >> >> Okay, let's step back and think about what you did compared to what you >> have been trying to do since. >> >> What you did - Take the partition table of disk sdb and write it to the >> partition table of disk sda. That means nothing on sdb partitions is >> effected. That means the partitions that used to be on sda have been >> destroyed but none of the data inside those former partitions has been >> touched. > > That's correct. With you so far. > >> What you have been trying to do since - Work on in invalid partitions >> that got cloned form disk sdb. No amount of effort on this front can >> ever possibily work. Either the partition tables started out identical >> and you saw no effect and none of this ever happened or they are >> different and you are now trying to work on incorrect partition data. >> That can't ever help. >> >> So what do you need to do? You need to stop working on the invalid >> partitions in the table and start working on restoring the correct >> partitions. Nothing else is going to help. > > Yes, all I am interested in right now is to *somehow* be able to > recover the filesystem (ext4) and the data on it. The file system is there. It is the partition table that is messed up, probably. Ie, if you can figure out where the boundaries of the partitions are, you can just reconstruct those and everything else will be there, including ext4 > >> Do you have a print out of the partition table that used to be on disk >> sda? If you do your situtation is promising. If you don't it's time to >> start guessing. > > No, I don't have a printout of the partition table of the former sda. That makes it hard. How did you originally partition it? How do you choose your partition sizes? > >> Get the print out. Do "fdisk /dev/sda". By hand delete all of the >> partitions that exist on it - They were copied in place and are not >> valid. Then by hand create the partitions in the sizes and locations >> they used to exist. Save it and reboot. Try the fsck again. If it >> worked you're done with the debugging. Back to the drawing board of how >> to mark a drive bootable - You have learned that's not the way. >> >> If you got it wrong your saving grace is so far all you have written to >> is the partition table. All of the data in the former partitions is >> still there. So start using "fdisk /dev/sda" and start guessing at how >> many partitions there used to be and what sizes they used to be. Hint - >> Start by guessing one partition on the whole disk. Then one partition >> on half of it. Then one partition on 3/4ths of it or whatever. Do a >> binary descent. Eventually you'll know the exact size and location of >> the first partition. >> >> If there's a second partition it will start one cylinder after the >> first. Initial guess is the rest of the drive. Lather rinse repeat >> until you have it figured out. >> >> The hard part will be figuring out the size of any swap partition >> because fsck won't help. You hope that drive only had filesystems. >> >> That's your strategy. Don't bother with any work on data inside the >> partitions that are there now because the partition table is not correct. > > Doug, after getting some revelations from Richard above (on LVM and > the futilitiy of using ext4 tools directly on it), I have described my > situation more (and hopefully) better at the following superuser.com > link. Not sure if it would be rude on my part to ask you this, but if > you don't mind the inconvenience of clicking this link, you will see a > more succinct and helpful description of my problem. The partition table on there now comes ( probably) from the other drive whose mbr you cloned. Ie, it is totally untrustworthy, including the lvm comments. > > Superuser.com link: > http://superuser.com/questions/411697/lvm-volume-with-corrupt-mbr-how-to-mount-and-recover-data-from-it > > Before I try the binary descent approach you suggest above, may I > request you to go over this new superuser.com link and let me know if > you still thing nothing else simpler is possible to salvage the file > system sitting in the logical volume somewhere. You have no idea if you have a logical volume there. The partition table is completely untrustworthy. It is like trying to find your way to rome while using a map of Switzerland. > > Many, many thanks to unruh and yourself for responding. I will be > forever grateful to you guys if you can help me salvage my data. > >
[toc] | [prev] | [next] | [standalone]
| From | Richard Kettlewell <rjk@greenend.org.uk> |
|---|---|
| Date | 2012-04-12 18:43 +0100 |
| Message-ID | <87k41k7snt.fsf@araminta.anjou.terraraq.org.uk> |
| In reply to | #2590 |
Doug Freyburger <dfreybur@yahoo.com> writes: > Harry wrote: >> ================= >> Details of what I did: >> ================= >> >> Using the `dd` command, I was hoping that I would be able to copy over >> the first 446 bytes from Disk B (250GB) to Disk A (80GB), in order to >> make Disk A bootable just like Disk B. I issued the command: >> >> dd if=/dev/sdb of=/dev/sda bs=446 count=1 >> >> But when I could not boot up from `sda`, I rebooted from `sdb` to see >> what was going on. To my horror, `sda` was being reported to have a >> bad superblock, now. > > Okay, let's step back and think about what you did compared to what you > have been trying to do since. > > What you did - Take the partition table of disk sdb and write it to the > partition table of disk sda. That's not correct. 446 is precisely the value you use to avoid modifying the partition table of the target. Since the partition table quoted is consistent with an 80GB disk and not a 250GB disk, it's a safe bet that the partition table on the target wasn't modified. -- http://www.greenend.org.uk/rjk/
[toc] | [prev] | [next] | [standalone]
Page 3 of 5 — ← Prev page 1 2 [3] 4 5 Next page →
Back to top | Article view | comp.os.linux.setup
csiph-web