LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 01-02-2015, 07:45 PM   #1
the_question_asker_888
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 make.sh
-rwx--x--x 1 tom tom 757 Jan 3 01:16 make.sh~
-rw-r--r-- 1 root root 1474560 Jan 3 01:40 Notix_OS.flp

and heres the script:
make.sh
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"
exit
fi

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

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, 08:47 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
Looks like an error in syntax. See this thread for an example which ought to work:
http://www.linuxquestions.org/questi...ith-dd-791142/
 
Old 01-03-2015, 02:00 AM   #3
veerain
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, 06:19 AM   #4
the_question_asker_888
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, 12:29 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,980

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
https://stackoverflow.com/questions/...drive-in-linux

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

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
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


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

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


Reply



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 11:42 AM
Using 'dd' and 'gzip' to create a disk image. Restoring image: can't find lvm_root. skiman1979 Linux - Desktop 2 02-25-2012 05:42 AM
create bootable floppy image with only kernel and initrd ta0kira Slackware 1 04-02-2009 09:26 PM
How to create a floppy image under 1440k w/ dd jgombos Linux - Software 2 11-07-2006 10:21 AM
create floppy image using dump cccc Linux - Hardware 2 08-07-2005 01:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:51 AM.

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