WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: home on a FAT32 partition  (Read 9121 times)

Offline helander

  • Full Member
  • ***
  • Posts: 183
home on a FAT32 partition
« on: June 15, 2009, 04:29:54 PM »
In one of my applications using TC I have it installed on a USB stick that is FAT32 formatted. One of the reasons is that one of the use cases is to have the stick being used on Windows for adding/deleting application specific files.

Since a FAT32 filesystem is not fully Linux "compliant", e.g. file ownership really does not work and the x flag on the files is not possible to modify (seems always to be set), I would like to be able to have home on a loop back file (with a proper Linux filesystem). I realize I could create a separate partition on the stick and format it to ext2/3 but I would like to avoid that for various reasons.

Are there any specific reasons for not supporting home on a loop back file, like local is supported on a loop back file?
Or have i just missed something and that there actually exists an option that would allow me to do that?

/Lars

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11050
Re: home on a FAT32 partition
« Reply #1 on: June 15, 2009, 04:49:14 PM »
Why not use the backup option? It's a single file, and keeps permissions. I'd think that it would be partly redundant to also support a loop home.
The only barriers that can stop you are the ones you create yourself.

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: home on a FAT32 partition
« Reply #2 on: June 15, 2009, 04:55:21 PM »
Encrypted home is a loopback file which should work on a FAT partition like the tclocal file.

Offline helander

  • Full Member
  • ***
  • Posts: 183
Re: home on a FAT32 partition
« Reply #3 on: June 15, 2009, 05:07:32 PM »
Why not use the backup option? It's a single file, and keeps permissions. I'd think that it would be partly redundant to also support a loop home.

Backup reqiures an explicit save and it saves all of its contents each time (I think) and for these two reasons I have already discarded that as an option.

/Lars

Offline helander

  • Full Member
  • ***
  • Posts: 183
Re: home on a FAT32 partition
« Reply #4 on: June 15, 2009, 05:10:59 PM »
Encrypted home is a loopback file which should work on a FAT partition like the tclocal file.

Is there a way around the need to have to enter a password at each boot?

/Lars

PS. If not I could probably experiment with the code in tc-config to get what I want :). DS.

Offline linus72

  • Full Member
  • ***
  • Posts: 196
  • Damn it Jim!
Re: home on a FAT32 partition
« Reply #5 on: June 15, 2009, 05:12:01 PM »
Are you speaking of a tcvd?
( http://forum.tinycorelinux.net/index.php?topic=1777.0 )

I have a few at my site, call em flavors
for 1.4.3 only right now...
( http://multidistro.com/downloads/tc_flavors/tc_flavors.html )

you can make your own

very simple really, although master Roberts may know an easier way....

download portable-qemu from link above..

inside qemu folder, open and edit either mke_vhd.sh or mke_vhd.bat (Dindows)
edit size of tcvd in M, G, or K
edit vhd name/location give it a name and size parameter
example mke_vhd.sh in qemu folder with portable-qemu
"./qemu-img create vhd 650M"
where vhd is name(any) and size is 650MB

then, use included install.sh/.bat to format tcvd ext2 or ext3
example: tcvd named vhd is in qemu folder and install.sh is in folder above qemu folder
"qemu/qemu -L -no-kqemu -soundhw all -m 325 -boot d -cdrom tinycore_2.0.iso -hda qemu/vhd"
where -m is memory allocated to qemu, default is 128mb ram, max is 1/2 your ram
where -hda, -hdb or -hdd are tcvd name/location.

edit script as it is named slk_install.sh, change name and edit script so it is as above
note tinycore iso is in same folder as qemu folder, not in qemu folder...

invoke script by double-clicking or with "./install.sh" after cd ing into folder
note that it does not work with tc-1.4.3, but 2.0+ does:)
enter tc options "tinycore vga=788 superuser"
when loaded enter
"mke2fs /dev/hda" or hdb, hdd, etc
or for ext3 "mkfs.ext3 /dev/hda"

it will warn you that it will format whole device, no partitions,
say yes

then use "poweroff"
now, edit syslinux.cfg or whatever to point to tcvd
 "tcvd=sda1/vhd restore=tcvd tce=tcvd waitusb=5" if using usb use waitusb=5

that's it! tinycore will mount and create tce folder there at boot.
easy peasy




Offline helander

  • Full Member
  • ***
  • Posts: 183
Re: home on a FAT32 partition
« Reply #6 on: June 15, 2009, 05:38:33 PM »
Are you speaking of a tcvd?
( http://forum.tinycorelinux.net/index.php?topic=1777.0 )

I have a few at my site, call em flavors
for 1.4.3 only right now...
( http://multidistro.com/downloads/tc_flavors/tc_flavors.html )

you can make your own

...

....

that's it! tinycore will mount and create tce folder there at boot.
easy peasy


Thanks linus72,

this sounds like a viable option. I can probably live with having to use qemu to create the files,  but eventually TC should maybe have a built-in tool that allow you to create them.

I will explore this further by making some tests and for that your instructions are excellent, thanks.

/Lars

Offline linus72

  • Full Member
  • ***
  • Posts: 196
  • Damn it Jim!
Re: home on a FAT32 partition
« Reply #7 on: June 15, 2009, 06:04:50 PM »
the usb download is setup for either syslinux/fat32 or grub/ext3 ext2
incl syslinux folder ,etc plus cool boot splash

Tinycore/Roberts probably knows a way to do it without using qemu....?

all you gotta do is install syslinux or grub to usb, just place boot and flavor folder on usb and play
note also, there may be 2 diff .cfg files in syslinux folder for tcvd.cfg and flavor.cfg, use flavor option at boot menu, press enter to get boot menu, don't enter text a "boot:", just press enter.

if using 2.0 just edit the .cfg/menu.lst to suit....

and check that out
( http://forum.tinycorelinux.net/index.php?topic=1777.msg9831#msg9831 )

big dig??
tc2.0 can be installed to a tcvd vhd!!!
yea, I got one almost ready for download, simply make you own...

ok, as above, boot tc2.0 with portable-qemu, enter "tinycore vga=788 superuser"
ok, you also gotta have cfdisk tce riding on 2.0iso
if you don't have pre-made 2.0 iso I got small 2.0 grub.iso at link above^
it's got grub and everything to install 2.0!
it boots using grub and has cool splash too
now, at command line text mode use "cfdisk /dev/hda"
and you can make partitions and make swap, etc
I usually make a hda1, type 83 bootable, then make a swap, type 82 and then
write to disk.
now issue "mkfs.ext3 /dev/hda1"
and "mkswap /dev/hda2" and "swapon /dev/hda2"
now, poweroff using "poweroff"
once it says system shutdown, etc, just click qemu X
again start qemu superuser, etc and at command line issue
mount /mnt/hda1
cp -a /mnt/hdc/* /mnt/hda1 (hdc should already be mounted)
that copies contents of my grubiso to hda1
now, invoke grub with
"grub-install --root-directory=/mnt/hda1 /dev/hda"
you can also try using grub prompt
"grub"
"root (hd0,0)"
"setup (hd0)"
"quit"
I have had more success with grub-install....

anyway, that's it! now choose shutdown/no backup from menu, shutdown
and use slk_run.sh, pointed to vhd name/location and you got a runing tc2.0
which runs just like real tc and saves apps, settings, etc
no doubt
change name of scripts too, tc20_install or whatever
note-heard it was BAD using tcvd option to mount a partitioned qemu-img
so you may screw up tc portable if you try to use it as tcvd too

also, you can play tcportable in tc real too.
so, get grub.iso and portable-qemu from my site and your set
also got other portables too
( http://multidistro.com/downloads/portables/portables.html )
and good screenshots of tc2.0 portable + on a lappy
( http://multidistro.com/tinycore-shots/tc-scrnshots.html )
any questions I'll be around ;)

Offline helander

  • Full Member
  • ***
  • Posts: 183
Re: home on a FAT32 partition
« Reply #8 on: June 15, 2009, 07:07:46 PM »
In order to make a quick test I did as follows:

  • Downloaded the minimal.tar.gz
  • Untared the file and placed the resulting "minimal" file at the root of my harddisk
  • Booted with the options "tcvd=minimal home=tcvd

The system came up with a new (for me :) ) Desktop background and using "ls -al /home/tc" I could see the files that must have come from the file "minimal".

During boot the following message appeared "Device not found! Ignoring persistent HOME request!", so I was quite surprised that it actually had succeeded in somehow map my home/tc to the minimal file. Any idea about this message?

I then did an "rm -fR /home/tc/*" to remove all files stored in minimal and it worked, since after the operation an "ls -al /home/tc" returned an empty result. With all files removed from minimal I rebooted with the same options, and it provided the same message about HOME and when fully booted it provided the same desktop as the previous boot. This means that the operation when I removed all files was not persisted, any idea why?


/Lars


Offline linus72

  • Full Member
  • ***
  • Posts: 196
  • Damn it Jim!
Re: home on a FAT32 partition
« Reply #9 on: June 15, 2009, 07:25:52 PM »
Yes, i forgot to tell you that..tcvd can't use home/opt=, not my fault
plus, Roberts says using home=/opt= option on usb is bad 'cause lots of writing to/fro, so that's a nono on usb
now, use home=hdx whatever and it's cool.
so delete home files from tcvd
delete all files if you want
reboot with tcvd=minimal restore=tcvd tec=tcvd home=hdxx opt=hdxx
and it'll be good
also, i simply cd into tcvd "cd /mnt/tcvd"
and use "rm -r tce" or whatever
also,
you can have alot of different tcvd's too
they work, ask roberts...but no home/opt in tcvd, though that would be cool too
any ideas on that?

Offline helander

  • Full Member
  • ***
  • Posts: 183
Re: home on a FAT32 partition
« Reply #10 on: June 15, 2009, 07:40:41 PM »
Yes, i forgot to tell you that..tcvd can't use home/opt=, not my fault
plus, Roberts says using home=/opt= option on usb is bad 'cause lots of writing to/fro, so that's a nono on usb
now, use home=hdx whatever and it's cool.
so delete home files from tcvd
delete all files if you want
reboot with tcvd=minimal restore=tcvd tec=tcvd home=hdxx opt=hdxx
and it'll be good
also, i simply cd into tcvd "cd /mnt/tcvd"
and use "rm -r tce" or whatever
also,
you can have alot of different tcvd's too
they work, ask roberts...but no home/opt in tcvd, though that would be cool too
any ideas on that?


I am aware of the problem with USB sticks and writing. This is basically depending on the applications you are using and in my case I am in control of what the applications are doing.

Secondly, if the tcvd file resides on the hdxx disk (I do only have one disk and that is the USB stick), then it really does not matter if any writes goes to the disk "directly" or via the tcvd file, in the end it is basically the same.

Now that I know how to create tcvd:s and how to mount them, I could probably just create a link from /home/tc to a location on under /mnt/tcvd and make sure it gets populated with whatever files I like to have there as a start and then just "GO". Now it's very late in my timezone so no more experiments for today :).

/Lars

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14851
Re: home on a FAT32 partition
« Reply #11 on: June 15, 2009, 11:23:29 PM »
..One of the reasons is that one of the use cases is to have the stick being used on Windows for adding/deleting application specific files.

There are freeware ext2 drivers for windows that work well.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: home on a FAT32 partition
« Reply #12 on: June 16, 2009, 01:39:22 AM »
..One of the reasons is that one of the use cases is to have the stick being used on Windows for adding/deleting application specific files.

There are freeware ext2 drivers for windows that work well.

http://www.fs-driver.org/
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline helander

  • Full Member
  • ***
  • Posts: 183
Re: home on a FAT32 partition
« Reply #13 on: June 17, 2009, 03:24:57 AM »
In principle the cryptohome option is more or less identical to what I need, apart from the encryption/decryption of the disk data. So it "suffers"from the same aspects regarding potential exhaustion of the flash memory due to excessive write operations.

I could use the cryptohome solution if it was not for the necessity to provide a password at (each) boot time.

A solution without the encryption or a solution using the crypto file system where you somehow could bypass the need to enter the password manually at each boot, would suit me fine.

Any hope for something like this being added?

/Lars

Offline daemonjax

  • Newbie
  • *
  • Posts: 18
Re: home on a FAT32 partition
« Reply #14 on: June 17, 2009, 11:28:12 AM »
... So it "suffers"from the same aspects regarding potential exhaustion of the flash memory due to excessive write operations....

/Lars

Recently I did a bit a research into this, and I found that it's not something to be concerned about if your sd card  performs wear-leveling techniques.  

Here's a white paper from sandisk from 2003:

http://www.sandisk.com/assets/file/oem/whitepapersandbrochures/rs-mmc/wpaperwearlevelv1.0.pdf

So, the jist of it is: If your card does wear-leveling, then, worst case scenario,  your card will 'last' 1/30th of the normal expected lifetime of the card (which is 30 years).  By lasting I mean it won't fail from memory wear... But, how long do you realy plan to continue to use your current flash memory card?

Assuming the technology is still used is still in use in 30 years (doubtful), and assuming a loose interpretation of Moore's Law holds true (I'm hopeful),  a mere 16gb flash drive would be the equivalent of a ~64k flash drive by today's standards (by my calculations).

I dunno... I upgrade my flash cards every 2-3 years anyways... they're so damned cheap.  I picked up my 8gb Class 6 mini sdhc (even came with a usb adapter on a keychain!) card for like $15.  In 2-3 years I can get one that's faster and double the storage for the same price... One day, it might even make me coffee.

« Last Edit: June 17, 2009, 11:45:16 AM by daemonjax »