problems mounting a ext2 disk image

2006-01-14 Thread Robert Lowe

Hi,

I have a dd image of a hard drive from a Linux box, which I'm trying to 
look at using a FreeBSD system. fdisk shows the following:


Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 131 (0x83),(Linux native)
start 63, size 208782 (101 Meg), flag 80 (active)
beg: cyl 0/ head 1/ sector 1;
end: cyl 12/ head 254/ sector 63
The data for partition 2 is:
sysid 131 (0x83),(Linux native)
start 208845, size 75971385 (37095 Meg), flag 0
beg: cyl 13/ head 0/ sector 1;
end: cyl 1023/ head 254/ sector 63
The data for partition 3 is:
sysid 130 (0x82),(Linux swap or Solaris x86)
start 76180230, size 1975995 (964 Meg), flag 0
beg: cyl 1023/ head 254/ sector 63;
end: cyl 1023/ head 254/ sector 63

I was hoping that the memory disks could allow you to specify an offset 
(as is possible with Linux's loop device) and I could simply mount each 
partition directly from the entire image. However, I have not been able 
to find such an option. If such an option exists, can someone point me 
to it?


So as an alternative, I attempted the following (using the smaller /boot 
partition as a test case):


# dd bs=512 count=208782 if=04.img of=boot.img skip=63
208782+0 records in
208782+0 records out
106896384 bytes transferred in 11.161832 secs (9576957 bytes/sec

# mdconfig -a -t vnode -f boot.img -u 0

# mount_ext2fs /dev/md0 /mnt/image/boot
mount_ext2fs: /dev/md0: Invalid argument

I have installed the e2fsprogs-1.38_1 port and running 'e2label 
boot.img' reports /boot.


I am using FreeBSD 6, and have re-compiled my kernel (for other reasons) 
but I've ensured I included the following options:


device  md
options EXT2FS

Am I missing something? Is md intended to be used in this way? Are there 
other methods I have overlooked? Any assistance would be greatly 
appreciated.


Thanks in advance,
Rob.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Starting a second loopback interface and services at startup

2004-05-28 Thread Robert Lowe
Hi!
New to FreeBSD and running 5.2.1-RELEASE on an Alpha.  I do predominantly
SysV/ATT boxes, so I feel a bit out of it...
Question #1:
I need to create a second loopback interface, which I can do just fine
at the command line:
# ifconfig lo1 create
# ifconfig lo1 inet a.b.c.d netmask x.x.x.x
How do I automate this at startup?  I stumbled across something in
/etc/network.subr that suggests I ought to create /etc/start_if.lo1
which would then be sourced.  I assume I can add a ifconfig_lo1
variable to /etc/rc.conf.  I tried these, but with no luck.  Can
anyone point the way?
Question #2:
I'm trying to start Quagga services on this box (zebra and ospfd).
I added scripts to /usr/local/etc/rc.d/ for these two, but no luck.
They work fine from the command line, e.g.
# /usr/local/etc/rc.d/zebra.sh start
# /usr/local/etc/rc.d/ospfd.sh start
Both have the .sh extension, which seems to be required.  How should
I troubleshoot this?  I don't find anything in dmesg.today suggesting
that there was even an attempt to run the scripts.  Also, can one use
the rcorder keywords to provide startup ordering for scripts in
/usr/local/etc/rc.d ???
TIA,
Robert
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Starting a second loopback interface and services at startup

2004-05-28 Thread Robert Lowe
Robert Lowe wrote:
Hi!
New to FreeBSD and running 5.2.1-RELEASE on an Alpha.  I do predominantly
SysV/ATT boxes, so I feel a bit out of it...
Question #1:
I need to create a second loopback interface, which I can do just fine
at the command line:
# ifconfig lo1 create
# ifconfig lo1 inet a.b.c.d netmask x.x.x.x
How do I automate this at startup?  I stumbled across something in
/etc/network.subr that suggests I ought to create /etc/start_if.lo1
which would then be sourced.  I assume I can add a ifconfig_lo1
variable to /etc/rc.conf.  I tried these, but with no luck.  Can
anyone point the way?
I figured out the correct way to do this:
1. Override the default network_interfaces variable in
   /etc/defaults/rc.conf in /etc/rc.conf.  This is a space-separated
   list of interfaces to start.  I included the new loopback interface
   to create.
2. Create a /etc/start_if.if-name script to create the interface.
3. Add a ifconfig_if variable to rc.conf as well.  I had this already,
   so I did not have to do anything.
The reason the last two steps did nothing before was the list of
interfaces in the netif script is generated using 'ifconfig -l',
which of course does not include interfaces which haven't yet been
created, and so the start_if.if-name script is not run.
Question #2:
I'm trying to start Quagga services on this box (zebra and ospfd).
I added scripts to /usr/local/etc/rc.d/ for these two, but no luck.
They work fine from the command line, e.g.
# /usr/local/etc/rc.d/zebra.sh start
# /usr/local/etc/rc.d/ospfd.sh start
Both have the .sh extension, which seems to be required.  How should
I troubleshoot this?  I don't find anything in dmesg.today suggesting
that there was even an attempt to run the scripts.  Also, can one use
the rcorder keywords to provide startup ordering for scripts in
/usr/local/etc/rc.d ???
The scripts now run properly, but in the wrong order, so I still need
an answer here.  They seem to execute in alpha-numeric order.  I suppose
I could start them in one script, but that's not really the answer.  Help!
I suppose I could use the Snnname SysV approach.  ;-)
-Robert
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]