Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Dec 2018 15:22:18 +0100
From:      Polytropon <freebsd@edvax.de>
To:        Jonathan Engwall <engwalljonathanthereal@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Hello(trouble with magic number)
Message-ID:  <20181228152218.596c04c1.freebsd@edvax.de>
In-Reply-To: <CAP=T6ZNxEwyP8cwXuecxzC=w%2BJfKSk7HLQPPuWk_UOC1uhTM1g@mail.gmail.com>
References:  <CAP=T6ZPz7JEKb9P1ReiZ%2B1GbwDQKkjAjQa=j=cvyBztF8s=Ohw@mail.gmail.com> <CAP=T6ZOhg_YyHHkgL1v6PMZ1R%2BxtNN0=MSh9x9Xg5i=qGCrVGQ@mail.gmail.com> <CAP=T6ZMxHUmCeb428D3Kh-MUVwU%2BHtVPFVCPh9y2=C=Ok2%2BtDg@mail.gmail.com> <CAP=T6ZNJzaJjxbxDpqzZ8d7CGJt1Wda3tRKQ_4YfGhwsk3dYVQ@mail.gmail.com> <CAP=T6ZO-%2B_VKH3VZccBUF1C21hg2f6foK5WKo-4J=o_0yrOqzA@mail.gmail.com> <CAP=T6ZN0GBb=Va4OFd4gGDrULsfxXEQZpFA6Lwbxz2Jw=TVXzg@mail.gmail.com> <CAP=T6ZNT7epbYGF1xo4QrzEJ1WFfXLP1K4wbqO%2BxR3eeSVpp6A@mail.gmail.com> <CAP=T6ZNNuVE4%2BM2DiBC_Uid9Mj64ZCVz=svEEQ_N1H16rHm91Q@mail.gmail.com> <CAP=T6ZO3ZC8X2gzDUrad4rraaf7m62yVHw48ydp5AVDj2twmWQ@mail.gmail.com> <CAP=T6ZM8uRcTnzAi9an_Gr0NhAN=xZL%2BShPQvcfbsEYyd51Kqg@mail.gmail.com> <CAP=T6ZMX3qpQyiPQtRvgKZk-FO_K0Luarnk6t2u8EhoeTBFVow@mail.gmail.com> <CAP=T6ZNxEwyP8cwXuecxzC=w%2BJfKSk7HLQPPuWk_UOC1uhTM1g@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Re-including the list, I hope that's okay.

Something went totally wrong with your quoting and reply.
I'll fix it manually by adding "> " and removing "####"
as needed. :-)

On Thu, 27 Dec 2018 19:50:40 -0800, Jonathan Engwall wrote:
> On Dec 27, 2018 4:43 PM, "Polytropon" <freebsd@edvax.de> wrote:
> 
> > On Thu, 27 Dec 2018 15:06:38 -0800, Jonathan Engwall wrote:
> > > Here is the problem:
> > > My usb ext2fs has the wrong magic number.
> > > Is this an offset? I rewrote the stick several times, even with 128
> > > inodes.
> > > Still the magic number is 0.
> 
> > I'm not sure you you want your USB stick to be Ext-2
> > formatted. Do you want it to use it as FreeBSD boot
> > medium? In that case, simply dd'ing the FreeBSD image
> > onto the stick should be sufficient - there won't be
> > any Linux remains left (as they are not needed - all
> > partitioning info is in the image).
> 
> I booted with virtualbox. This is to try to instal some source code.

What OS is running within VirtualBox? Or do you try to
boot a VirtualBox instance with a FreeBSD image? If yes,
why the need for a USB stick? I'm not fully sure that I
understand what you're trying to do, but maybe you can
clarify.

Source code typically isn't installed on FreeBSD. While
you can get the FreeBSD sources, as well as the sources
for about everything in the ports collection, what you
basically do is you _download_ source code, and then
maybe compile it (or whatever you need to do with it,
like patching it, examining it, testing it...) - all
this is easily possible once FreeBSD is up and running.


> > > Should I suspect the USB? Rufus rejects most of my usb stick though they
> > > are still functional.
> > 
> > Who is Rufus?
> 
> 
> Rufus writes bootable medium very well. Rufus makes several passes which
> can destroy a working disk

Then tell Rufus this will not be needed. ;-)

All you need is dd. The dd program or an equivalent is part
of almost every operating system. The image you can download
does already contain all information needed (like partitioning
data, magic number, media size, boot attributes, filesystem
information, the actual data, and so on). You need to write
it 1:1 to the target medium. You do not need to prepare the
medium (like erasing, partitioning, or formatting it). As I
said, there is no Ext-2 involved. FreeBSD uses UFS, and the
image contains that data already.

In case you're using "Windows" instead of an operating system,
you need to download a program that can write raw data to a
device. The FreeBSD Handbook has a suggestion in procedure 2.2
in 2.3.3.1.

	https://www.freebsd.org/doc/handbook/bsdinstall-pre.html

But you really just need to do something like this:

	# dd if=FreeBSD-10.2-RELEASE-amd64-memstick.img of=/dev/da0 bs=1M conv=sync

If you are using Linux, replace /dev/da0 with the USB stick's
device name (usually /dev/sd<something>).



> > > I see I have no geom command and no gpart either.
> > 
> > Well, "gpart" is part of FreeBSD for many years now, just
> > like the "geom" command.
> 
> I have neither

Actually, you don't need it. You only need dd.




> > > Using centos and ubuntu I have never dealt with magic numbers.
> > 
> > Can you provide a simplified list of what you did, and
> > what seems to be the actual problem?
> 
> At first the mount command was answered with "no recognizable file
> structure" and usbconfig described the slices as out dlside of a readable
> range.

Hmmm... I'm still not understanding what you're trying to do.
You do not mount the USB image, you just dd it to the medium.
The image itself is - well, an image of a USB stick, containing
partitioning data and a UFS filesystem. Of course you _could_
mount it (using a virtual node) if you wanted, but there is no
need to do so.

For further diagnostics, always provide the actual command you
entered along with the error message you received.

Additionally, I'm not aware that usbconfig reads slicing data.
Again, this is not needed to create a USB boot medium for FreeBSD,
if that is what you're trying to achieve.



> My centos 7 does not write ufs and neither could it store any files
> on it.

That is totally okay - first of all, Linux has limited support
for UFS, but as I said, you do not deal with UFS at all, you
just use dd, and that's definitely part of CentOS.



> Fat32 was unrecognizable, so after I found I do have mount_ext2fs I
> tried that.

Yes, FreeBSD can natively mount FAT partitions, but again, this
is not needed. What you do is

	# dd if=FreeBSD-10.2-RELEASE-amd64-memstick.img of=/dev/sdb bs=1M conv=sync

Verify that /dev/sdb is the name of the USB stick (assumed that
/dev/sda is your CentOS system disk). Verify it again. You can
check easily with "dmesg" output. If you're sure you're going
to overwrite the correct device, go ahead and enter the command
above.

If CentOS's dd does not recognize the unit 1M, use 1024k instead.



> What I want most is to install Python3.7

Python 3.7 is in the FreeBSD ports collection, there is also a
precompiled package available to use with "pkg install".



> Therefore I need to transfer files.

You don't need to. The system will automatically download the
correct files, extract them, and install Python.



> Ftp , and telnet are not working and
> ssh just hangs up.

Well, telnet is not enabled by default, for good reasons, just
like FTP. You can enable them via /etc/inetd.conf if needed,
but always remember the security implications of doing so.

What does "SSH hangs up" mean? Does it refuse to connect,
timeout, present a login, but doesn't actually login? You
need to enable SSH in /etc/rc.conf of course.



> I have no internet at the moment.

Then you should probably fix this first. FreeBSD cannot
install anything until an Internet connection is provided.



> On top of all that my
> vm's are getting the same ip address!

What is the host OS? Do you have "local DHCP" enabled
for the VMs? What OS is inside the VMs?



> Thank you for your reply. I hope you can help a bit.

That's a lot of problems, not entirely related to FreeBSD... ;-)


I know that a broken environment can be really frustrating.
Check what's top priority, and fix this first. Then go
ahead and solve all other problems depending on how they
impact your further actions. My suggestion would be to first
get the FreeBSD USB stick initialized with dd, using the
image you already downloaded, then boot your system with
it to see if it works. Next step next. :-)



PS. Use "reply all" when replying to the list as well as to
    the list member who replied; "reply to list" is okay too,
    at least for me, as I'm subscribed to the list. Make sure
    your mail program uses "> " to indent quotes properly, so
    it doesn't rip the thread structure. The correct reply
    method is also important to keep the thread references
    intact which reside in the mail's headers.


-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20181228152218.596c04c1.freebsd>