Format hdx device for Windows
Hi,
I had a kit that has a SCSI device built-in and it starts up in DOS. I also attach a hard disk (hda) to it. My goal is to deploy a linux operating system to the kit. So I proposed to use a bootable USB for Linux and it will load the kernel I have built. My idea is to format a small part of the hard disk which can be seen as a drive in DOS (e.g. /dev/hda1 as C drive) and the remaining will be formatted as ext3 (e.g. /dev/hda2). When the kit starts and finds A drive for the SCSI, the autoexec.bat in A drive will contain the instructions to change directory to C drive and start the grub for the Linux operating system. I am a newbie in Linux. I roughly knew the concepts but had no idea how to write my kernel scripts to achieve the goal. How should I write my scripts? e.g. 1. fdisk /dev/hda to create /dev/hda1 and /dev/hda2 2. mkfs.ext3 /dev/hda2 to format the hard disk for linux 3. mkdosfs -F xx /dev/hda1 for Windows? 4. What's next? Many thanks! |
While I don't know what you mean by kernel scripts, you have everything ok there. You can skip #2, as when you install Linux it will allow you to do so in the installer, so save yourself the extra work there.
Also, you can omit "-F xx" in #3 if you choose. mkfs.msdos will choose which FAT size to use based on the size of the partition, and I would let it do so, unless you have a specific need (I noticed a mention of DOS, but do not know what specific DOS and what it supports). If you do need to use a specific FAT size, keep that in mind when you set the size of the partition. #4. Install your OS(es) of choice. |
Thank you for your reply.
Quote:
Quote:
|
Ok.
Just make sure the FAT size you're using is supported by your DOS and your kit/BIOS. This may affect the maximum partition size you can use as well. |
Quote:
Many thanks! |
Can you provide a manufacture/part number for your embedded device?
Being recognized as a c: drive is a function of the BIOS. What happens when you boot to DOS and try a cd c: command? |
Member Response
Hi,
Whenever creating a partition for Windows FAT that is to be boot-able be sure to set the 'boot' flag for that partition. Then format either using a Windows/Dos tool or for Linux you can use mkfs.vfat; Quote:
Hope this helps! |
Quote:
Quote:
|
Quote:
I did try to use the option "toggle a bootable flag" on partition 1. However, when I reboot the kit, it shows the error "This is not a bootable disk". |
Formatting the partition nor setting the boot flag will create a bootable drive. It does not copy the system files i.e. command.com, io.sys, msdos.sys. I'm not familiar with the hardware to know how to get DOS to recognise the IDE drive as C:. If that worked you could possibly use grub4dos to boot linux from the autoexec.bat file on the A drive.
Have you tried to see if it is recognised as B: vs C:? |
Member Response
Hi,
Personally, I would use MS tools to create the MS partition(s) using fdisk, here you would set the primary as active after creating the partition. You can then format with the format command as 'format c: /s' this would prepare the partition for booting and placing the needed system files. You could use the Microsoft OS System DVD to create the necessary partitions and this would provide the system boot files. |
The solution is:
When I use fdisk to partition the disk, I need to use the option 't' to alter the partition type (i.e. FAT size) after I create a new partition. When I use the option 'p' to print the partition table, the System column will be changed from 'Linux' to 'FATxx' when the partition type is altered. After that, I can use mkdosfs -F xx /dev/hda to format the partition. Thank you for all your kind help ;) |
All times are GMT -5. The time now is 09:29 PM. |