Solved Problem With Writing an Image File to USB

Scribner

Member

Reaction score: 2
Messages: 74

I am trying to do my first install of FreeBSD. I am using a Lenovo Thinkpad X270, thanks to recommendations on this forum.

I just tried starting the installation from the USB drive, but I couldn't get it to work. I never saw the FreeBSD Boot Loader Menu. Upon further examination, I found the USB drive actually had two drives instead of one -- D: and E: instead of just D:. When I tried formatting and ejecting the drives, they still remained two separate drives. I am now unable to write the image again with Image Writer on Windows 10. When I try writing the image on either drive D: or drive E: I get a message that says something like: "Error 5. Access denied."

Does anyone know what is going on? I am eager to get FreeBSD up and running!
 

Phishfry

Son of Beastie

Reaction score: 1,594
Messages: 4,583

When I try writing the image on either drive D: or drive E: I get a message that says something like: "Error 5. Access denied."
You have to write the image to a whole physical drive, not partitions.
I second win32diskimager as a good tool for Windows.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 8,302
Messages: 32,149

On Windows the FreeBSD install memstick is detected as E: and F: on my system. Windows seems to pick up on the EFI partition and the FreeBSD partition, this causes Windows to assign two drive letters to it. To (over)write it pick the lowest letter, that's usually the 'first' partition of the stick. Make sure you cancelled all the "Do you want to format this disk" popups. Having one of them still open will get you the "Access denied" message.
 

tingo

Daemon

Reaction score: 450
Messages: 2,148

If Rufus or the other tools suggested in this thread seems too advanced, I'll suggest Etcher. Simple, no options, and gets the job done.
 
OP
OP
Scribner

Scribner

Member

Reaction score: 2
Messages: 74

I erased the partitions by following the instructions at https://superuser.com/questions/536813/how-to-delete-a-partition-on-a-usb-drive I am now left with just one partition: E:.

When I am able to try creating the bootable USB drive again, I may use Rufus, as someone else here mentioned. If I use Rufus, should I follow the instructions I used for creating a bootable USB drive for Ubuntu? These instructions are located at https://tutorials.ubuntu.com/tutorial/tutorial-create-a-usb-stick-on-windows Would anything be different for FreeBSD? I was following the FreeBSD Handbook's official documentation, so I am stuck right on the first step of installing FreeBSD.
 

aragats

Daemon

Reaction score: 564
Messages: 1,351

Both partitions -- D: and E: -- are still on the USB drive after formatting D:. How do I get the USB drive to go back to being one partition like it was brand new? I am unable to overwrite the USB drive while it is in this state.
Have you tried Win32DiskImager (ImageWriter) mentioned above? If it doesn't work (but it should), just delete those partitions in Windows Disk Manager before using it.
 
OP
OP
Scribner

Scribner

Member

Reaction score: 2
Messages: 74

Have you tried Win32DiskImager (ImageWriter) mentioned above? If it doesn't work (but it should), just delete those partitions in Windows Disk Manager before using it.
Image Writer is what I was using, and it didn't seem to work. Maybe I just wasn't entering BIOS correctly. Side note/question: Does anyone know how to enter BIOS on a Lenovo Thinkpad?
 

balanga

Son of Beastie

Reaction score: 151
Messages: 3,234

BIOS has nothing to do with it.
You need to tell the bios that you are not booting from the default device.

Entering the BIOS on ThinkPads depends on which model you are using, but I've found that F12 normally brings up a boot device list.
 
OP
OP
Scribner

Scribner

Member

Reaction score: 2
Messages: 74

Entering the BIOS on ThinkPads depends on which model you are using, but I've found that F12 normally brings up a boot device list.
I am using a Thinkpad X270.

I can try using Win32DiskImager (Image Writer) again, but I suspect the same thing will happen. Can anyone provide detailed instructions on how to create a bootable USB using Image Writer? I feel the Handbook's instructions are insufficient. These are the Handbook's instructions:
Writing the Image with Image Writer
Double-click the Win32DiskImager icon to start the program. Verify that the drive letter shown under Device is the drive with the memory stick. Click the folder icon and select the image to be written to the memory stick. Click [ Save ] to accept the image file name. Verify that everything is correct, and that no folders on the memory stick are open in other windows. When everything is ready, click [ Write ] to write the image file to the memory stick.
I never found the [ Save ] prompt on my Windows machine, so I skipped that part. Do you think this caused the issue?
 

aragats

Daemon

Reaction score: 564
Messages: 1,351

As I already mentioned above, use Windows Disk Manager. Delete all partitions first. Creating a single partition instead may help too. I would recommend re-inserting the stick after Disk Manager's manipulations.
 

aragats

Daemon

Reaction score: 564
Messages: 1,351

Unfortunately, it creates two partitions -- D: and E: -- and then tells me I need to format E: (I chose not to).
Never listen to Windows, it doesn't know about other possible formats ;-)
Two partitions are perfectly fine.

I have tried repeatedly pressing F12 at the Lenovo logo screen to no avail.
I believe that's because Windows (starting from 8) doesn't really turns the PC off, unless you hold Power button for 8 seconds or so.
I would enable Legacy boot (although it shouldn't be needed for the current FreeBD installers) and disable Quick boot mode to see what's going on.
 
OP
OP
Scribner

Scribner

Member

Reaction score: 2
Messages: 74

Thanks.

I was just on the phone with Lenovo. What I had to do was do a restart (rather than shutting down the computer and turning it back on manually) to get to the Lenovo screen that says I can press Enter to interrupt normal startup.

I am now going to try to install FreeBSD from the Handbook.
 
OP
OP
Scribner

Scribner

Member

Reaction score: 2
Messages: 74

I was able to change the boot order and make the SanDisk option #1. However, the computer still boots to Windows. Does anyone know what is going on?
 

balanga

Son of Beastie

Reaction score: 151
Messages: 3,234

I was able to change the boot order and make the SanDisk option #1. However, the computer still boots to Windows. Does anyone know what is going on?
Are you sure the USB stick is in good condition?

I've often found that my system won't boot from a USB stick initially, and it may be due to timing, ie recognising that a USB is bootable takes longer than finding a bootable hard disk and it may take a few seconds to initialise the USB stick. What I've found in the past, if booting doesn't start from the USB stick is to C-A-D a few times and then it may start booting .
 
OP
OP
Scribner

Scribner

Member

Reaction score: 2
Messages: 74

So I ended up putting Ubuntu on this laptop because it was just too hard to get the FreeBSD USB to work. But now I want to try again.

I have been using Rufus lately and it seems to work well...
I would feel comfortable using Rufus, since that's what I used with Ubuntu. I followed these instructions: https://tutorials.ubuntu.com/tutorial/tutorial-create-a-usb-stick-on-windows#0 Does anyone know if these are the same instructions I'd follow to create the USB stick for FreeBSD?

Does anyone really think the problem is the USB drive itself? It's a Sandisk USB drive in good condition and just worked fine with Ubuntu.

Alternatively, I'd be willing to try the instructions for using dd on Mac or Linux, but I have no idea how that would work. I would still prefer to use Image Writer on Windows, but I just have no idea why it isn't working and is creating two partitions on the drive.
 

k.jacker

Aspiring Daemon

Reaction score: 437
Messages: 739

Even if I'm not a Windows user, I would strongly advice against using any Windows build-in tools for anything that's not directly related to Windows itself.
Microsoft has not yet arrived in present time, when it comes to disk manipulation.

Rufus creates bootable usb media of .iso and .img files, both these file formats are standardized.
It doesn't matter if you are creating a bootable drive of an Ubuntu .iso file or a FreeBSD .img file.
Using an .img file with Rufus, I think Rufus will suggest writing it in dd mode and you should accept that.
No further guides or anything needed to get that done.
 
OP
OP
Scribner

Scribner

Member

Reaction score: 2
Messages: 74

Rufus didn't work, either. It just messed up the USB drive again, and it took some work to get the USB drive to work properly.

Does anyone know why this isn't working? It's a bit irritating.

I also have Mac and Ubuntu computers. Would someone be able to provide detailed instructions on how to create the drive on one of those computers if we can't figure out why Windows isn't working for me?
 

k.jacker

Aspiring Daemon

Reaction score: 437
Messages: 739

It seems you have very little knowledge of even basic stuff, that's not a problem.
But - I you really want help, you have to be more precise.
Would someone be able to provide detailed instructions
You have to provide detailed information first.
Explain exactly what you did (commands typed or what point you choose from a certain menu), and exactly what errors you encountered (error messages, behaviour).
If you're not changing that, nobody will ever be able to help you - or people will simply get tired, talking to wall.
 
OP
OP
Scribner

Scribner

Member

Reaction score: 2
Messages: 74

I'm not really much of an advanced user, though I assume anyone who responds here probably is. FreeBSD is just something I wanted to try to install for fun. I even purchased a specific Lenovo ThinkPad for the purpose.

I'm trying to be as detailed as possible, but I don't always remember exactly what the error messages say. One error message I know I got after creating the USB drive with Rufus was that the drive needed to be formatted. After formatting the drive, I discovered there was only 1 GB on the disk, and it's a 32 GB disk. It took some Googling and work on Windows to get the drive to show it's right amount again.

I created the USB drive by following the instructions at https://tutorials.ubuntu.com/tutorial/tutorial-create-a-usb-stick-on-windows#0 Note that it didn't prompt any additional dialog boxes after clicking START in Rufus, so something must be different with FreeBSD's .img file.
 

k.jacker

Aspiring Daemon

Reaction score: 437
Messages: 739

One error message I know I got after creating the USB drive with Rufus was that the drive needed to be formatted.
That's not an error, but just a common example of Windows' stupidity. It can safely be (and must be in your case) ignored by closing the window.
Note that it didn't prompt any additional dialog boxes after clicking START in Rufus
Yeah, I just noted that the version of Rufus on my wife's tablet was outdated. I updated it and the current version does indeed does that without user intervention.
After formatting the drive
So you actually formatted the drive after you had written the image with Rufus. Yes, I'd call that a problem ;)

Write the image again using Rufus and when Windows comes up with popups, suggesting to format the drive (or rather the partition), close it (don't click yes).
Than it'll work.
 

balanga

Son of Beastie

Reaction score: 151
Messages: 3,234

I also have Mac and Ubuntu computers.
If you have Ubuntu, I guess it has the command dd in which case you should easily be able to create a bootable USB stick.

Assuming you have wget and a USB stick - say /dev/sdb, I'd try something like:-

Code:
wget https://download.freebsd.org/ftp/releases/amd64/amd64/ISO-IMAGES/12.0/FreeBSD-12.0-RELEASE-amd64-mini-memstick.img
dd if=FreeBSD-12.0-RELEASE-amd64-mini-memstick.img of=/dev/sdb
Obviously check the device name of your USB stick otherwise you could create a big mess.

This ought to get your system booted up to FreeBSD. This particular image expects you to be connected to the Internet to perform an installation. You could also install FreeBSD on a second USB stick if you have one and that will allow you to see what FreeBSD looks like without having to change your existing installation.
 
OP
OP
Scribner

Scribner

Member

Reaction score: 2
Messages: 74

k.jacker, I followed your instructions, but Windows the computer still doesn't open the FreeBSD Boot Menu.

I did go into BIOS, just as I did when I installed Ubuntu, and changed the Boot Priority Order to boot from the USB drive first. I did make sure to save the settings as well. Does this look right?

6610


This laptop, which is running Ubuntu currently, does seem to acknowledge that the FreeBSD USB drive is there, so I take it that's a good sign. Does this look good to you?

6611


I haven't formatted the USB drive yet because of what appears in the above picture. Maybe someone can figure out how to get me to the FreeBSD Boot Menu now.
 
Top