Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: ejames82 on November 29, 2010, 01:12:48 PM

Title: how to use a floppy as storage with tinycore
Post by: ejames82 on November 29, 2010, 01:12:48 PM
hi everybody,

i thought i would give a floppy disk a try yesterday, i wanted to see if i could put files on and remove files.  i made no headway at all.

i tried this command:

mount /dev/fd0 /mnt/fd0
invalid arguement

i tried diligently to find any info in the documentation, but came up empty handed.
there's lots of stuff about booting to a floppy, but that's not what i want.
any help would be greatly appreciated as always.
Title: Re: how to use a floppy as storage with tinycore
Post by: gerald_clark on November 29, 2010, 01:21:39 PM
does /dev/fd0 have a filesystem on it?
Floppies are EXTREMELY slow and unreliable.
Title: Re: how to use a floppy as storage with tinycore
Post by: ejames82 on November 29, 2010, 01:28:36 PM
hello gerald_clark,

i was able to use the floppy tool to format the diskette that was in it.  then i tried everything my newbie self could think of.  i even tried the mount tool but the button for fd0 would not turn green. 
i suppose i should have tried a second floppy diskette, but i didn't even thing i was on the right track.  i was just 'winging it' hoping for the best.

should what i tried, have worked?
Title: Re: how to use a floppy as storage with tinycore
Post by: ejames82 on November 29, 2010, 01:33:00 PM
is this the proper command?

mount /dev/fd0 /mnt/fd0
 
and is this, or any command required?

sorry for the double-post.
Title: Re: how to use a floppy as storage with tinycore
Post by: gerald_clark on November 29, 2010, 01:40:03 PM
After you format the floppy, you need to create a filesystem on it using mkfs.
Once the filesystem is created, it can be mounted.
Title: Re: how to use a floppy as storage with tinycore
Post by: ejames82 on November 29, 2010, 01:46:10 PM
i knew there was something i didn't know. :)

this is good news.  thanks again gerald_clark.
Title: Re: how to use a floppy as storage with tinycore
Post by: ejames82 on November 29, 2010, 02:24:21 PM
this is what i have tried.  still no luck using the floppy (the drive itself could be defective, but i am assuming that it works, for now).

tc@box:~$ sudo su
root@box:~# fdformat /dev/fd0H1440
Double-sided, 80 tracks, 18 sec/track. Total capacity 1440 kB
Formatting... done
Verifying... done
root@box:~# mkfs -t vfat -c /dev/fd0H1440
sh: mkfs: not found
root@box:~#

is this the proper command to make a fat32 file system on it?

mkfs -t vfat -c /dev/fd0H1440

thanks.
Title: Re: how to use a floppy as storage with tinycore
Post by: gerald_clark on November 29, 2010, 02:31:31 PM
Did you install dosfstools-3.tcz ?
Title: Re: how to use a floppy as storage with tinycore
Post by: Lee on November 29, 2010, 02:32:39 PM
Did you try the dosfstools-3 extension?  It provides the several variations of mkfs and some other goodies.

usr/local/sbin/dosfsck
usr/local/sbin/dosfslabel
usr/local/sbin/fatattr
usr/local/sbin/fsck.msdos
usr/local/sbin/fsck.vfat
usr/local/sbin/mkdosfs
usr/local/sbin/mkfs.msdos
usr/local/sbin/mkfs.vfat
Title: Re: how to use a floppy as storage with tinycore
Post by: ejames82 on November 29, 2010, 02:38:09 PM
i'll do it right away.
i'll let you know how it goes.
thanks, gentlemen.
Title: Re: how to use a floppy as storage with tinycore
Post by: ejames82 on November 29, 2010, 02:51:54 PM
tc@box:~$ sudo su
root@box:~# fdformat /dev/fd0H1440
Double-sided, 80 tracks, 18 sec/track. Total capacity 1440 kB
Formatting... done
Verifying... done
root@box:~# mkfs -t vfat -c /dev/fd0H1440
sh: mkfs: not found
root@box:~# mkfs -t vfat -c /dev/fd0H1440
sh: mkfs: not found
root@box:~#

still no luck. 
if you have any more advice, i will gladly take it.  though it hasn't worked so far, i still find this very interesting.
i will check the apps audit and the update utility in the meantime.  maybe it's something right under my nose.
thanks.   :)
Title: Re: how to use a floppy as storage with tinycore
Post by: gerald_clark on November 29, 2010, 03:02:16 PM
It is mkfs.vfat
Title: Re: how to use a floppy as storage with tinycore
Post by: ejames82 on November 29, 2010, 03:06:55 PM
ok, i'll try it.  thanks gerald_clark.
Title: Re: how to use a floppy as storage with tinycore
Post by: ejames82 on November 29, 2010, 03:27:03 PM
tc@box:~$ sudo su
root@box:~# fdformat /dev/fd0H1440
Double-sided, 80 tracks, 18 sec/track. Total capacity 1440 kB
Formatting... done
Verifying... done
root@box:~# mkfs -t vfat -c /dev/fd0H1440
sh: mkfs: not found
root@box:~# mkfs -t vfat -c /dev/fd0H1440
sh: mkfs: not found
root@box:~# mkfs.vfat
mkfs.vfat 3.0.3 (18 May 2009)
No device specified!
Usage: mkdosfs [-A] [-c] [-C] [-v] [-I] [-l bad-block-file] [-b backup-boot-sector]
       [-m boot-msg-file] [-n volume-name] [-i volume-id]
       [-s sectors-per-cluster] [-S logical-sector-size] [-f number-of-FATs]
       [-h hidden-sectors] [-F fat-size] [-r root-dir-entries] [-R reserved-sectors]
       /dev/name [blocks]
root@box:~# mkfs.vfat /dev/fd0
mkfs.vfat 3.0.3 (18 May 2009)
root@box:~#

i tried using the mount tool to mount the floppy and the button still does not turn green.
there's other ideas i'm going to try.

thanks again.   8)
Title: Re: how to use a floppy as storage with tinycore
Post by: ejames82 on November 29, 2010, 03:44:44 PM
this diskette is a 3m, according to the package linux is not listed as it's 'compatible with', so i decided to try a verbatim.  i now notice that the 3m disk is 'locked' (the plastic block is pushed to the read-only position).  maybe this new discovery was my problem (hopefully).  we'll see.
by the way, i doubt that the 3m won't work with linux, though it may be possible.
thanks.
Title: Re: how to use a floppy as storage with tinycore
Post by: maro on November 29, 2010, 03:46:54 PM
I'd imagine that you'll need to run 'rebuildfstab' (as 'root') to get the "automatic" entry in '/etc/fstab'.

Otherwise you should be able to do something like mkdir /path/to/mountpoint && mount /dev/fd0 /path/to/mountpoint (again as 'root').
Title: Re: how to use a floppy as storage with tinycore
Post by: ejames82 on November 29, 2010, 05:27:44 PM
hello maro,

here's part one of your advice.  it still looks like fd0 is labelled as noauto instead of automatic. 

root@box:~# fdformat /dev/fd0H1440
Double-sided, 80 tracks, 18 sec/track. Total capacity 1440 kB
Formatting... done
Verifying... done
root@box:~# mkfs -t vfat -c /dev/fd0H1440
sh: mkfs: not found
root@box:~# mkfs -t vfat -c /dev/fd0H1440
sh: mkfs: not found
root@box:~# mkfs.vfat
mkfs.vfat 3.0.3 (18 May 2009)
No device specified!
Usage: mkdosfs [-A] [-c] [-C] [-v] [-I] [-l bad-block-file] [-b backup-boot-sector]
       [-m boot-msg-file] [-n volume-name] [-i volume-id]
       [-s sectors-per-cluster] [-S logical-sector-size] [-f number-of-FATs]
       [-h hidden-sectors] [-F fat-size] [-r root-dir-entries] [-R reserved-sectors]
       /dev/name [blocks]
root@box:~# mkfs.vfat /dev/fd0
mkfs.vfat 3.0.3 (18 May 2009)
root@box:~# mount /dev/fd0
mount: mounting /dev/fd0 on /mnt/fd0 failed: Invalid argument
root@box:~# rebuildfstab
root@box:~#
# /etc/fstab
proc            /proc        proc    defaults          0       0
sysfs           /sys         sysfs   defaults          0       0
devpts          /dev/pts     devpts  defaults          0       0
tmpfs           /dev/shm     tmpfs   defaults          0       0
/dev/ramzswap0  swap         swap    defaults,noauto   0       0
/dev/fd0        /mnt/fd0        auto     noauto,users,exec    0 0 # Added by TC
/dev/hda1       /mnt/hda1       ext3     noauto,users,exec,relatime 0 0 # Added
/dev/hda2       none            swap     defaults             0 0 # Added by TC
/dev/hdc        /mnt/hdc        auto     noauto,users,exec    0 0 # Added by TC
/dev/hdd        /mnt/hdd        auto     noauto,users,exec    0 0 # Added by TC
~                                                                             
~
~
- /etc/fstab 1/11 9%


can i respectfully say that part two is confusing me, and i'll try to explain how and why.

mkdir
i'm not confused by this

/path/to/mountpoint
i don't know where this would be.  do i just make up a directory?  i don't know what will work.  will /home work for this?  perhaps /home/floppy?

&&
these are double asperand's.  are they actually part of the command?  what are their purpose?

mount /dev/fd0 /path/to/mountpoint
if /home/floppy could work, this could be 'mount /dev/fd0 /home/floppy.
the whole command would be 'mkdir /home/floppy && mount /dev/fd0 /home/floppy'

i appreciate your expertise as always.
Title: Re: how to use a floppy as storage with tinycore
Post by: gerald_clark on November 29, 2010, 05:58:43 PM
cd /mnt
mount fd0

should work.
If not, then
mount -t vfat /dev/fd0 /mnt/fd0
Title: Re: how to use a floppy as storage with tinycore
Post by: ejames82 on November 29, 2010, 06:23:19 PM
gerald_clark,

root@box:~# cd /mnt
root@box:/mnt# mount fd0
mount: mounting /dev/fd0 on /mnt/fd0 failed: Invalid argument
root@box:/mnt# mount -t vfat /dev/fd0 /mnt/fd0
root@box:/mnt#

it looks like no error messages, so the place for me to put a file (to test it), would be /mnt/fd0.
i'll give it a shot.  maybe i'll also try the floppy tool and the mount tool.  maybe even the dmesg command to see what i can learn.  this has been quite an experience.
thanks.
Title: Re: how to use a floppy as storage with tinycore
Post by: ejames82 on November 29, 2010, 06:48:07 PM
when i clicked on 'mount tool', fd0 was green. :D

here is what the floppy tool said:

fdformat: can't open '/dev/fd0H1440': Device or resource busy
mkdosfs 3.0.3 (18 May 2009)
/dev/fd0H1440: Device or resource busy

i haven't done anything else yet, just dropped in quick to let you know how it's going.
i'll see if i can't put files on, and take files off the floppy.

thanks.
Title: Re: how to use a floppy as storage with tinycore
Post by: tinypoodle on November 29, 2010, 06:51:51 PM
You have to umount before formating.
Title: Re: how to use a floppy as storage with tinycore
Post by: ejames82 on November 29, 2010, 07:03:14 PM
hello tinypoodle,

yeah, that was probably a factor as to why there were certain times when i could format, and other times when i couldn't.  i also have to be mindful of the 'lock' on the floppy.  you can't write to it in the 'lock' position.  i think that means formatting won't work when it's locked either.
thanks.
Title: Re: how to use a floppy as storage with tinycore
Post by: tinypoodle on November 29, 2010, 07:11:29 PM
hello tinypoodle,

yeah, that was probably a factor as to why there were certain times when i could format, and other times when i couldn't.  i also have to be mindful of the 'lock' on the floppy.  you can't write to it in the 'lock' position.  i think that means formatting won't work when it's locked either.
thanks.

Of course not   ;)
Title: Re: how to use a floppy as storage with tinycore
Post by: ejames82 on November 29, 2010, 07:46:35 PM
it worked (sort of).

i was able to copy a text file (a.txt) to the /mnt/fd0 with this command:

cp a.txt /mnt/fd0

i negotiate to the file and opened it to confirm.  i am able to write to the floppy, but i was not able to send the a.txt to the trash unless i used the terminal like this:

rm -i a.txt

when i tried to do it with xfe file manager gui, i get 'permission denied-can't write to file'

anyway, it's a permission issue (a lack of knowledge pertaining to permissions), but that will be for another thread.

thanks again to everyone who posted.   8)
Title: Re: how to use a floppy as storage with tinycore
Post by: ejames82 on November 30, 2010, 12:14:03 PM
additional info:

once mounted (a green button fd0 on mount tool), do this to unmount:
umount /mnt/fd0

and this to mount:
mount -t vfat /dev/fd0 /mnt/fd0
(thanks to gerald_clark for this)

the mount tool does not change color 'on the fly'.  the window has to be closed to change color.  when the window pops up it will be the new color providing everything was done correctly.
Title: Re: how to use a floppy as storage with tinycore
Post by: tinypoodle on November 30, 2010, 12:22:54 PM
additional info:

once mounted (a green button fd0 on mount tool), do this to unmount:
umount /mnt/fd0

and this to mount:
mount -t vfat /dev/fd0 /mnt/fd0
(thanks to gerald_clark for this)

the mount tool does not change color 'on the fly'.  the window has to be closed to change color.  when the window pops up it will be the new color providing everything was done correctly.

Alternatively, cycling through devices will update too, IME.
Title: Re: how to use a floppy as storage with tinycore
Post by: ejames82 on November 30, 2010, 12:26:41 PM
"Alternatively, cycling through devices will update too, IME."

thanks for the info, tinypoodle.
Title: Re: how to use a floppy as storage with tinycore
Post by: ejames82 on December 03, 2010, 09:14:02 PM
after formatting with the tinycore floppy tool, i was unable to mount the floppy.  below are my efforts to make the floppy useable

tc@box:~$ fdformat /dev/fd0
Double-sided, 80 tracks, 18 sec/track. Total capacity 1440 kB
Formatting... done
Verifying... done
tc@box:~$

tc@box:~$ mkfs.vfat /dev/fd0
sh: mkfs.vfat: not found
tc@box:~$ sudo mkfs.vfat /dev/fd0
sudo: mkfs.vfat: command not found

i decided to download the dosfstools-3
it worked to give the floppy a vfat file system
see below

tc@box:~$ sudo mkfs.vfat /dev/fd0
mkfs.vfat 3.0.3 (18 May 2009)
tc@box:~$

sudo su
to become root
mount -t vfat /dev/fd0 /mnt/fd0
to mount
umount /mnt/fd0
to unmount
Title: Re: how to use a floppy as storage with tinycore
Post by: tinypoodle on December 03, 2010, 10:56:27 PM
Testing here, as well using mnttool as a simple
Code: [Select]
mount /mnt/fd0
appear to work out of the box without any other requirements - neither  root privileges.

FWIW, testing done under 2.10 with an already formatted floppy (did not have any empty one at disposition).

EDIT:

After having done upper tests, it stroke me to test again with 'base norestore' and look, I could reproduce   :o

The only way I managed to mount was indeed with
Code: [Select]
sudo mount -t vfat /dev/fd0 /mnt/fd0

However, after mounting with upper command and umounting again once, then everything worked as expected and described earlier in this post.
Title: Re: how to use a floppy as storage with tinycore
Post by: curaga on December 04, 2010, 01:38:00 AM
Has to do with vfat being a module. On -t auto, the kernel only checks against known (loaded) file systems. When explicitly telling it it's vfat, then it checks if the module can be loaded.
Title: Re: how to use a floppy as storage with tinycore
Post by: tinypoodle on December 04, 2010, 02:05:42 AM
Has to do with vfat being a module. On -t auto, the kernel only checks against known (loaded) file systems. When explicitly telling it it's vfat, then it checks if the module can be loaded.

1. Booted 'norestore base', first mounted a vfat partition with mnttool, then mounting floppy worked as expected.

2. Rebooted, then
Code: [Select]
sudo modprobe vfatthen mounting floppy worked as expected.

Thanks for the enlightening explanation curaga, makes absolutely sense, I seem just never have run into the specific constellation of ejames82, therefore I never noted.
Title: Re: how to use a floppy as storage with tinycore
Post by: ejames82 on December 05, 2010, 05:52:37 PM
upgrading a bios (a windows xp machine) was the only time i ever used a floppy disk, prior to starting this thread.  suffice it to say i didn't know how to use one. 
it seems like a floppy can fit nicely into the tinycore scheme.  sections of the wiki, and extensions can fit on a floppy, and a floppy can be written on.  where with a flash drive, you may forget what is on it.


tinypoodle,

it seems like i tried this command (with no success):
mount /mnt/fd0

this package of floppies are used.  i'm not sure how i acquired them.  so therefore, i don't know what file system was on them.  i doubt it was a linux file system.  regardless, one of my goals here was to be able to use any floppy (so long as it's not damaged), by merely running the appropriate commands and/or installing the needed software.

After having done upper tests, it stroke me to test again with 'base norestore'
is base norestore one of the options offered by hitting f2 during bootup (boot options)?
if so, i need to check this out for myself.  basenorestore + mount /mnt/fd0 + mounttool.  :)


curaga,

On -t auto, the kernel only checks against known (loaded) file systems. When explicitly telling it it's vfat, then it checks if the module can be loaded.
the kernel checks if vfat can be loaded, then does load it.  impressive.


thanks for the replies.



 

Title: Re: how to use a floppy as storage with tinycore
Post by: tinypoodle on December 05, 2010, 11:18:42 PM
After having done upper tests, it stroke me to test again with 'base norestore'
is base norestore one of the options offered by hitting f2 during bootup (boot options)?
if so, i need to check this out for myself.  basenorestore + mount /mnt/fd0 + mounttool.  :)

Yes, those are boot parameters to disregard 'restore' (of backup) and preventing to mount the device where 'tce' is located.

There is no sense whatsoever for you in trying that, I did that only in a (successful) attempt to reproduce your symptoms, which in other case would never occur to me (on the only box with a working fd I have access to, tce is on a vfat partition).
Title: Re: how to use a floppy as storage with tinycore
Post by: ejames82 on December 06, 2010, 09:07:11 AM
i want to make sure i have this correct.

booting to 'norestore base' allows the vfat to be detected, booting default does not.   ???
pardon me, my file system knowledge needs practice.
Title: Re: how to use a floppy as storage with tinycore
Post by: tinypoodle on December 06, 2010, 09:45:07 AM
i want to make sure i have this correct.

booting to 'norestore base' allows the vfat to be detected, booting default does not.   ???
pardon me, my file system knowledge needs practice.

No!
'base' would prevent vfat module from being loaded as it otherwise would be (while /tce is on a vfat partition).
Title: Re: how to use a floppy as storage with tinycore
Post by: tinypoodle on December 06, 2010, 10:06:59 AM
ejames82,

What you might want to try is:
Code: [Select]
echo 'modprobe vfat'  >>/opt/bootlocal.sh
so the module would be auto loaded at boot time   ;)
Title: Re: how to use a floppy as storage with tinycore
Post by: ejames82 on December 06, 2010, 10:43:21 AM
excellent.  will do.

thanks, tinypoodle
Title: Re: how to use a floppy as storage with tinycore
Post by: ejames82 on December 14, 2010, 06:08:42 PM
ejames82,

What you might want to try is:
Code: [Select]
echo 'modprobe vfat'  >>/opt/bootlocal.sh
so the module would be auto loaded at boot time   ;)

tinypoodle,

since running this command that you provided for me, now all i have to do to mount the floppy is control panel>mount tool.  it is red when it pops up, but by clicking on it, after a few seconds it turns green. 
great suggestion.  thanks tinypoodle.  :)
Title: Re: how to use a floppy as storage with tinycore
Post by: tinypoodle on December 15, 2010, 04:49:16 AM
ejames82,

What you might want to try is:
Code: [Select]
echo 'modprobe vfat'  >>/opt/bootlocal.sh
so the module would be auto loaded at boot time   ;)

tinypoodle,

since running this command that you provided for me, now all i have to do to mount the floppy is control panel>mount tool.  it is red when it pops up, but by clicking on it, after a few seconds it turns green. 
great suggestion.  thanks tinypoodle.  :)

Glad you finally were able to make it work, as I hadn't found an opportunity to even test that.
Appending a [SOLVED] to first subject line couldn't harm, methinks   ;)
Title: Re: how to use a floppy as storage with tinycore [solved]
Post by: ejames82 on December 18, 2010, 08:57:22 PM
will do, tinypoodle.  have never done this before.  hope i got it right.
thanks.