Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-02-2015, 08:45 PM   #1
LQ Newbie
Registered: Jan 2015
Posts: 3

Rep: Reputation: Disabled
Cant create floppy image bash

hello i am making a operating system
and so i am making a script to build the floppy image

but whenever i run this line:
mount -o loop -t vfat Notix_OS.flp tmp-loop

i get this error message:
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

dose anyone know what the problem is here?

this is what the directory that its being run in looks like:
tom@trisquel7-gnu-linux:~/Documents/Programs/Projects/Notix OS$ ls -l
total 208
-rw-r--r-- 1 tom tom 512 Jan 3 01:40 boot.bin
-rw------- 1 tom tom 4292 Nov 17 13:43 boot.s
-rw------- 1 tom tom 140589 Nov 17 13:43 COPYING
drwx------ 2 tom tom 4096 Nov 17 13:43 GAS_asm_bootloader_attempt
-rw-r--r-- 1 tom tom 19425 Jan 3 00:25 kernel.bin
-rwx--x--x 1 tom tom 740 Jan 3 01:16
-rwx--x--x 1 tom tom 757 Jan 3 01:16
-rw-r--r-- 1 root root 1474560 Jan 3 01:40 Notix_OS.flp

and heres the script:
if test "`whoami`" != "root" ; then
echo "You must be root to run this script"
echo "Enter su -c \"sudo su\" or sudo su to become root"

if [ ! -e Notix_OS.flp ]
echo ">>> Creating new floppy image..."
mkdosfs -C Notix_OS.flp 1440 || exit

echo "Building boot.s..."
nasm boot.s -o boot.bin || exit

echo "Copying bootloader to disk image..."
dd status=noxfer conv=notrunc if=boot.bin of=Notix_OS.flp || exit

echo "Copying Kernel to disk image..."
rm -rf tmp-loop

mkdir tmp-loop && chmod 777 tmp-loop
echo "mounting tmp-loop" &&
mount -o loop -t vfat Notix_OS.flp tmp-loop && cp kernel.bin tmp-loop/#this line has the problems

echo "clearing tmp files"
umount tmp-loop
rm -rf tmp-loop

echo "Done!"

qemu-system-i386 -fda Notix_OS.flp -m 1024k
Old 01-02-2015, 09:47 PM   #2
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,898

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
Looks like an error in syntax. See this thread for an example which ought to work:
Old 01-03-2015, 03:00 AM   #3
Senior Member
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Try using -t fat when passing mount options.

Also after running script please check size of floppy image.
Old 01-03-2015, 07:19 AM   #4
LQ Newbie
Registered: Jan 2015
Posts: 3

Original Poster
Rep: Reputation: Disabled
the floppy image is correct(1.47mb)

but i dont understand why it would be a syntax error
as this command from another program works perfectly:
mount -o loop -t vfat disk_images/mikeos.flp tmp-loop
Old 01-03-2015, 01:29 PM   #5
Registered: Mar 2008
Posts: 17,195

Rep: Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562

Some tech notes about floppy images here. I am guessing you never created the image correctly.
Old 01-03-2015, 02:05 PM   #6
John VV
LQ Muse
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,243

Rep: Reputation: 2527Reputation: 2527Reputation: 2527Reputation: 2527Reputation: 2527Reputation: 2527Reputation: 2527Reputation: 2527Reputation: 2527Reputation: 2527Reputation: 2527
and you are aware that no current kernel even looks for a 3.5 in floppy and has NO support for the 5.25 in drives

to add further problems
NO ONE is even manufacturing 5.25 or 3.5 in floppy diskes

sony closed the very last manufacturing line for 3.5 in's two years ago

no current kernel even checks for a 3.5 in drive
you have to MANUALLY inform the kernel to look for it

su -
modprobe floppy
then you can manually mount it
su -
mkdir /mnt/floppy
mount -t vfat /dev/fd0 /mnt/floppy


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Is it possible to create a bash script to create multiple new bash scripts Batistuta_g_2000 Linux - Newbie 6 02-19-2013 12:42 PM
Using 'dd' and 'gzip' to create a disk image. Restoring image: can't find lvm_root. skiman1979 Linux - Desktop 2 02-25-2012 06:42 AM
create bootable floppy image with only kernel and initrd ta0kira Slackware 1 04-02-2009 10:26 PM
How to create a floppy image under 1440k w/ dd jgombos Linux - Software 2 11-07-2006 11:21 AM
create floppy image using dump cccc Linux - Hardware 2 08-07-2005 02:31 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:50 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration