Welcome! Log In Create A New Profile

Advanced

Overprovisioning A Flash Drive ?

Posted by DonCharisma 
Overprovisioning A Flash Drive ?
January 09, 2015 06:12AM
I want to have another go with flash USB stick or SD cards. I had some pretty bad experiences in the past and prefer hard drive booting and operation. However bohdi seems to think it's doable with USB flash memory - and he knows more than me for sure !

I'm wondering if anyone has tried overprovisioning a USB SD card or flash drive. Overprovisioning basically means partitioning leaving free non-paritioned space at the end of the disk, usually between 7-28%. Commerce production systems use overprovisioning as standard, often the 28% I already mentioned - on both SSDs and hard drives. Samsung Pro SSDs can be overpovisioned using their software, right out of the box.

The rationale is that if there's a dodgy block then it can be mapped out into the non-partitioned space silently by the drive.

The unknowns are whether the flash memory on USB is as smart as an SSD and can actually make use of the non-partitioned space for wear-levelling and disappearing of bad blocks. I have for instance an old SD Card that will only work with FAT16, simply won't work with FAT32 or EXT ... so there's a lot of unknowns, but a big potential benefit in reliability if it works !

I ask the question, because 16GB or even 32GB flash drives are now pretty cheap. Debian only needs a few gig to run, less if the install for a very specific purpose. So there's potentially plenty of space to allow for overprovisioning to make a more reliable system - provided of course that it's actually used by the SD Card/USB drive.

Any takers ?

Cheers

Don Charisma

Don Charisma ... because anything is possible with Charisma

My blog - http://DonCharisma.org
Our commercial site - http://DonCharisma.com
rat
Re: Overprovisioning A Flash Drive ?
January 09, 2015 06:47AM
I had a 8GB Sandisk Cruzer Fit thumbdrive in my Dockstar which I recently decommissioned in favor of another Dockstar I had set up in advance before taking that one down. The old Dockstar had an uptime of nearly 860 days on that thumbdrive. It was partitioned into 4.5GB for OS/Home, 128MB for Swap and the rest (about 3.2GB) left empty/unpartitioned. The main partition was formatted as EXT2.

I never saw a reduction in capacity or a slowdown in writes, so I'm inclined to believe my generous provisioning (forcing almost 50% blocks unused/free for wear leveling) may have helped.

I currently have a 32GB thumbdrive in the second dockstar. 16GB for OS/Home, 1GB for Swap and about 12.5GB free/unused... keeping a similar ratio. Generally NAND media slows down when free space shrinks below 20%

When it comes to flash media, stick to the proven brands. Haven't had any issues with Sandisk, myself.
Re: Overprovisioning A Flash Drive ?
January 09, 2015 08:26AM
@rat, that's VERY VERY useful, thanks ... The only brand I had success with is Sandisk ... So I'll give the overprovisioning a try ... I have an 8GB cruzer fit same as yours, so I'll try that first :D

860 days uptime = 2.4 years ... impressive !

Thanks once again, very much appreciated ...

Don Charisma

Don Charisma ... because anything is possible with Charisma

My blog - http://DonCharisma.org
Our commercial site - http://DonCharisma.com
rat
Re: Overprovisioning A Flash Drive ?
January 09, 2015 08:39AM
http://i.imgur.com/rvul7jc.png

Dockstars are quite the reliable little buggars. Frustrating because I'd like a new toy to play with but can't justify buying something to replace the Dockstar when it works so well. I didn't even need to use the backup machine and I had the first running for over 4 years total.

If you can manage giving yourself about 40% unused space to leave on the flash drive, I think you'll be fine. And don't worry about the swap writes, unless you're doing some insane crunching and IO writes (eg, torrenting), swap barely gets touched even with only 128MB Ram in a Dockstar and everything else released since has more Ram. My Dockstars have been set up to be IRC logging/idle clients, CenterIM instant messenger client, UPS and Print server along with the occasional wget site mirroring. Not one single hiccup.



Edited 1 time(s). Last edit at 01/09/2015 08:41AM by rat.
Attachments:
open | download - uptimecrop.png (17.2 KB)
Re: Overprovisioning A Flash Drive ?
January 09, 2015 08:53AM
@Don

I cant claim the type of uptime that rat has enjoyed, however, i only run from usb drives or sd cards, in the 6 months its been running as a mini nas and torrent box, i havent seen any hiccups in terms of flashdisk failures.

Call me foolish, but i dont overprovision and use the full disk as i cant determine if any of my flash drives i use actually support the feature.
Re: Overprovisioning A Flash Drive ?
January 09, 2015 10:49AM
I concur with Gravelrash. All my USB boot drives (8 boxes) are up over 3 year long. All are Sandisk brand, formatted as Ext3. And I don't think typical USB flash drives have the type of provisioning that Don is thinking about. Except one: Sandisk Extreme USB 3.0 that actually has SSD controler kind of FW in it.

IMO, if you take precaution like I mentioned before in one of the posts, then it would last a long time. I have not seen any symptom of failure in my USB flash drives.

OTOH, if one is really cautious, then I would suggest using f2fs for rootfs partition, and ext2 for boot partition (we can't boot with f2fs yet).

EDITED: added link for Sandisk Extreme USB 3.0

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 3 time(s). Last edit at 01/09/2015 01:50PM by bodhi.
Re: Overprovisioning A Flash Drive ?
January 10, 2015 07:00AM
Thanks guys, very helpful info :)

@bodhi - I hadn't heard of f2fs before, which is a very interesting file system specifically for flash (initially developed by Samsung) ...so thanks ... one day I hope to be as knowledgeable !

My early experiences with USB Flash/SD Cards were mostly negative (as you know) ... however they are far more inexpensive than a hard drive, so for systems that don't involve massive storage worth revisiting ... another route would be the endebian one, but I don't have serial cable, so prefer not to mess with the internal flash too much mostly for fear of bricking. I guess eventually I may have to acquire one, but still not quite sure what to buy ...

I'll lookup your instructions for flash drives in order to setup, try and prolong their lifespan.

Thanks for the heads up on the Sandisk USB 3.0 drive, I've seen those around, didn't know they have an SSD controller. Only downside is it seems a shame to plug it into a USB2 port !

@rat thanks for the image - I believe you :) ... my two GoFlexNets can sit there 24/7 running 100% CPU and don't even blink an eyelid, don't seem to overheat even in tropical temperatures here and very rarely seem to crash ... it's all the pluses of ARM hardware, right there, reliable and runs relatively cool. All on virtually fresh air electricity wise - I continue to be impressed with ARM hardware. Good luck with your new setup :D

@Gravelrash - thanks for the report back, helpful, gives confidence ... I don't know if that's foolish or not LOL ... for me, if the space is available anyway, then it makes sense ... it's another option to consider on your setup ... are you using ext2 or ext3 ?

Cheers

Don Charisma

Don Charisma ... because anything is possible with Charisma

My blog - http://DonCharisma.org
Our commercial site - http://DonCharisma.com
Re: Overprovisioning A Flash Drive ?
January 10, 2015 08:16AM
@Don - I use Ext3 for my partitions and if i add another device other than the usd/usb thumbdrive then i mount that as Ext4.

If you are in the UK i would solder you a serial connector in and mod it to feed out to a 3.5mm audio jack with matching TTY adaptor.

Gravelrash
Re: Overprovisioning A Flash Drive ?
January 10, 2015 01:43PM
@Gravelrash - LOL ... I did look on ebay.co.uk for one, but I have no idea which one is best, apparently there's different voltages for serial and different chipsets on the intelligence end of things ... probably ought to get one next time I'm in UK, as would be handy for debugging. And I remember seeing the stereo jack mod for serial, neat ...

I think ext3 is probably better than ext2 as it's more stable in the case of power outage. I really ought to buy a UPS where I am, the slightest shower of rain and the power will just go off. The downside is more writes because ext3 has journalling.

You've found ext4 works OK performance wise on these devices ? Just a question, as I've only used ext2/ext3

Also interested in bodhi's idea with the /boot on a small partition ext3, then a larger f2fs partition for everything else ... however that makes making the stick a little more challenging as I need to figure out how do that ! ... Google is my friend for these things ...

Thanks for your help :D

DC

Don Charisma ... because anything is possible with Charisma

My blog - http://DonCharisma.org
Our commercial site - http://DonCharisma.com
Re: Overprovisioning A Flash Drive ?
January 10, 2015 02:18PM
Below is a link to the latest ones i have purchased that "just work out of the box" and makes the mod nice and easy for the stereo jack. I only use Linux and on my *buntu laptop the kernel and driver support is built in.

http://www.amazon.co.uk/gp/product/B00IZ9OFSG?psc=1&redirect=true&ref_=oh_aui_detailpage_o00_s00

I dont see any negatives/downsides with the EXT4 filesystems on the additional drives and im currently watching a movie from the plug as I type. there doesnt seem to be any noticable performance hit on the device.

Im fancying the idea of using the flash file system mentioned above and if i get anywhere doing it over the weekend i will feedback the steps i took to see success.
Re: Overprovisioning A Flash Drive ?
January 10, 2015 06:13PM
@Gravelrash - I've had a go myself, and got stuck, there's a few issues :

f2fs-tools are available in Jessie, but not Wheezy. bodhi's latest 3.17 kernel should support f2fs, I don't know if the tools are needed OR if Jessie will work on GoFlexNet. So I built the flash drive (Sandisk Cruzer Fit) an amd64 system with Jessie on it.

/dev/sda1 ext2 or ext3 boot 200M
/dev/sda2 f2fs rootfs 5.5G
/dev/sda3 swap 1G
Overprovisioned - 768M

I used bodhi's latest 3.17 rootfs from here - http://forum.doozan.com/read.php?2,12096. onto /dev/sda2

I generated a new uImage for GoFlexNet. I then moved /boot folder onto /dev/sda1 using mv.

Modified /etc/network/interfaces and /etc/resolv.conf - for networking, I use static IP address.

Moved the flash stick over to the GoFlexNet and try to boot ...

I'm using netconsole, and it says "Starting kernel ..." ... not been able to SSH into it.

I've tried ext2 and ext3, both seem to be loading the kernel, but no ping or SSH.

Possible problems - UBOOT envs, some info here - http://forum.doozan.com/read.php?3,8379,8393#msg-8393

So I've tried changing :

usb_rootfstype=f2fs
usb_root=LABEL=rootfs

Still no joy (and I may not be able to boot SATA now, because of the above change ... fixable with netconsole or rescue I think)

Other possible issue I'm thinking is that the uInitrd included in bodhi's rootfs doesn't include the module for f2fs ... that's more complicated to fix, because I'd need to generate that from a working system or a chroot from a working system ... a working system I don't have because I can't boot into it ... so chroot would probably be the way to do that ... my other box is running 3.16 ... at this stage I don't know if I can mount f2fs without the f2fs-tools !

Let me know how you get on, or if you see any solutions to the above :) Perhaps between the two of us, we can crack it !

Cheers

DC

PS - bodhi did a guide (quite old now !) for separate boot and rootfs partitions here - http://forum.doozan.com/read.php?2,5461,6465#msg-6465

And this is the page that makes me think the uInitrd needs to be regenerated - https://wiki.archlinux.org/index.php/F2FS

PPS - thanks for the info on the cable, I'll pick one up when I'm back in UK ...

Don Charisma ... because anything is possible with Charisma

My blog - http://DonCharisma.org
Our commercial site - http://DonCharisma.com



Edited 2 time(s). Last edit at 01/10/2015 06:20PM by DonCharisma.
Re: Overprovisioning A Flash Drive ?
January 10, 2015 06:54PM
@Don,

grep -i f2fs /boot/config-3.17.*-tld-1


And btw, you could take out the rootfstype from bootargs. Make it a little easier to switch back to Ext3.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 01/10/2015 06:58PM by bodhi.
Re: Overprovisioning A Flash Drive ?
January 10, 2015 07:43PM
@bodhi

#grep -i f2fs /boot/config-3.17.*-tld-1 
CONFIG_F2FS_FS=y
CONFIG_F2FS_STAT_FS=y
CONFIG_F2FS_FS_XATTR=y
CONFIG_F2FS_FS_POSIX_ACL=y
CONFIG_F2FS_FS_SECURITY=y
CONFIG_F2FS_CHECK_FS=y

But I guess you knew that already :)

Does that mean that f2fs is already in the kernel, and no further action necessary to support it (ie no need to rebuild uInitrd) ?

And presumably you're saying the rootfstype isn't needed anymore, the kernel will work out the rootfs filesystem type by itself ?

PS I'm still using U-Boot 2011.12, hopefully that's not the problem ...

Thanks for your help :)

Cheers

Don Charisma ... because anything is possible with Charisma

My blog - http://DonCharisma.org
Our commercial site - http://DonCharisma.com
Re: Overprovisioning A Flash Drive ?
January 11, 2015 05:46AM
Don,

> #grep -i f2fs /boot/config-3.17.*-tld-1 
> CONFIG_F2FS_FS=y
> CONFIG_F2FS_STAT_FS=y
> CONFIG_F2FS_FS_XATTR=y
> CONFIG_F2FS_FS_POSIX_ACL=y
> CONFIG_F2FS_FS_SECURITY=y
> CONFIG_F2FS_CHECK_FS=y
>

> Does that mean that f2fs is already in the kernel,
> and no further action necessary to support it (ie
> no need to rebuild uInitrd) ?

Yes, it means the kernel can mount f2fs rootfs, there should be no need to insert the module into uInitrd.

>
> And presumably you're saying the rootfstype isn't
> needed anymore, the kernel will work out the
> rootfs filesystem type by itself ?
>
> PS I'm still using U-Boot 2011.12, hopefully
> that's not the problem ...

Yes 3.17.*-tld-1 or 3.16.*-tld-x will figure out rootfs type. The advantage during testing is that you will not need netconsole/serial console (i.e. put the old rootfs in and you're back booting Debian).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Overprovisioning A Flash Drive ?
January 11, 2015 01:40PM
@bodhi, always a pleasure, thanks my friend ... I've posted a quick how-to for Jessie and for dual-partition booting :)

I'm trying currently to copy my working ext3 rootfs to a f2fs partition ... fingers crossed and it'll boot ...

Cheers

Don Charisma ... because anything is possible with Charisma

My blog - http://DonCharisma.org
Our commercial site - http://DonCharisma.com
Re: Overprovisioning A Flash Drive ?
January 11, 2015 02:24PM
@bodhi, I have it booting off f2fs, but have a problem ... (there are some other complications, which I'll get to later)

Current issue I don't know how to resolve is - it's in an endless reboot loop, this is the messages on netconsole :

[   19.367074] console [netcon0] enabled
[   19.370770] netconsole: network logging started
[   20.217765] systemd[1]: systemd 215 running in system mode. (+PAM +AUDIT +SEL
INUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ -SECCOMP -APPARMOR)
[   20.231616] systemd[1]: Detected architecture 'arm'.
[   20.321497] systemd[1]: Inserted module 'autofs4'
[   20.366079] NET: Registered protocol family 10
[   20.371892] systemd[1]: Inserted module 'ipv6'
[   20.379909] systemd[1]: Set hostname to <GoFlexNet2>.
[   21.120562] systemd[1]: Cannot add dependency job for unit display-manager.se
rvice, ignoring: Unit display-manager.service failed to load: No such file or di
rectory.
[   21.138843] systemd[1]: Starting Forward Password Requests to Wall Directory
Watch.
[   21.147153] systemd[1]: Started Forward Password Requests to Wall Directory W
atch.
[   21.155004] systemd[1]: Expecting device dev-ttyS0.device...
[   21.183692] systemd[1]: Starting Remote File Systems (Pre).
[   21.213654] systemd[1]: Reached target Remote File Systems (Pre).
[   21.219932] systemd[1]: Starting Encrypted Volumes.
[   21.243652] systemd[1]: Reached target Encrypted Volumes.
[   21.249303] systemd[1]: Starting Arbitrary Executable File Formats File Syste
m Automount Point.
[   21.283668] systemd[1]: Set up automount Arbitrary Executable File Formats Fi
le System Automount Point.
[   21.293296] systemd[1]: Starting Dispatch Password Requests to Console Direct
ory Watch.
[   21.301718] systemd[1]: Started Dispatch Password Requests to Console Directo
ry Watch.
[   21.309857] systemd[1]: Starting Paths.
[   21.333649] systemd[1]: Reached target Paths.
[   21.338159] systemd[1]: Starting Swap.
[   21.363651] systemd[1]: Reached target Swap.
[   21.368072] systemd[1]: Expecting device dev-disk-by\x2dlabel-boot.device...
[   21.393670] systemd[1]: Starting Root Slice.
[   21.443728] systemd[1]: Created slice Root Slice.
[   21.448621] systemd[1]: Starting /dev/initctl Compatibility Named Pipe.
[   21.473671] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
[   21.480811] systemd[1]: Starting Delayed Shutdown Socket.
[   21.503662] systemd[1]: Listening on Delayed Shutdown Socket.
[   21.509574] systemd[1]: Starting Journal Socket (/dev/log).
[   21.533663] systemd[1]: Listening on Journal Socket (/dev/log).
[   21.539779] systemd[1]: Starting udev Control Socket.
[   21.563659] systemd[1]: Listening on udev Control Socket.
[   21.569248] systemd[1]: Starting udev Kernel Socket.
[   21.593657] systemd[1]: Listening on udev Kernel Socket.
[   21.599130] systemd[1]: Starting User and Session Slice.
[   21.623672] systemd[1]: Created slice User and Session Slice.
[   21.629609] systemd[1]: Starting Journal Socket.
[   21.653664] systemd[1]: Listening on Journal Socket.
[   21.658869] systemd[1]: Starting System Slice.
[   21.683676] systemd[1]: Created slice System Slice.
[   21.688767] systemd[1]: Starting File System Check on Root Device...
[   21.716687] systemd[1]: Starting system-systemd\x2dfsck.slice.
[   21.743772] systemd[1]: Created slice system-systemd\x2dfsck.slice.
[   21.750328] systemd[1]: Starting udev Coldplug all Devices...
[   21.824536] systemd[1]: Starting Create list of required static device nodes
for the current kernel...
[   21.859394] systemd[1]: Mounting Debug File System...
[   21.885331] systemd[1]: Starting Load Kernel Modules...
[   21.896832] systemd[1]: Mounted Huge Pages File System.
[   21.912119] systemd[1]: Started Set Up Additional Binary Formats.
[   21.918696] systemd[1]: Mounting POSIX Message Queue File System...
[   21.925294] random: nonblocking pool is initialized
[   21.936317] systemd[1]: Starting system-getty.slice.
[   21.951404] systemd[1]: Created slice system-getty.slice.
[   21.959418] systemd[1]: Starting system-serial\x2dgetty.slice.
[   21.969049] systemd[1]: Created slice system-serial\x2dgetty.slice.
[   21.977312] systemd[1]: Starting Journal Service...
[   21.993211] systemd[1]: Started Journal Service.
[   23.552322] systemd-udevd[143]: starting version 215
[   23.719533] systemd-journald[132]: Received request to flush runtime journal
from PID 1
[   24.208973] orion_wdt: Initial timeout 21 sec
[   24.291862] USB Power: 5000 mV
[   25.100606] watchdog watchdog0: watchdog did not stop!
[   25.185075] systemd-shutdown[1]: Sending SIGTERM to remaining processes...
[   25.213979] systemd-journald[132]: Received SIGTERM from PID 1 (systemd-shutd
ow).
[   25.407014] systemd-shutdown[1]: Sending SIGKILL to remaining processes...
[   25.426882] systemd-shutdown[1]: Hardware watchdog 'Orion Watchdog', version
0
[   25.435901] systemd-shutdown[1]: Unmounting file systems.
[   25.442148] systemd-shutdown[1]: Unmounting /sys/kernel/config.
[   25.463614] systemd-shutdown[1]: Unmounting /sys/kernel/debug.
[   25.493579] systemd-shutdown[1]: Unmounting /dev/mqueue.
[   25.525310] systemd-shutdown[1]: All filesystems unmounted.
[   25.530974] systemd-shutdown[1]: Deactivating swaps.
[   25.536332] systemd-shutdown[1]: All swaps deactivated.
[   25.541638] systemd-shutdown[1]: Detaching loop devices.
[   25.547555] systemd-shutdown[1]: All loop devices detached.
[   25.553209] systemd-shutdown[1]: Detaching DM devices.
[   25.559357] systemd-shutdown[1]: All DM devices detached.
[   25.568791] systemd-shutdown[1]: Rebooting.

On the ext3 installation dmesg finished at "[ 24.405679] USB Power: 5000 mV", and then I could ssh into the box.

BTW I copied the ext3 rootfs to the f2fs rootfs using 'cp -a' on an AMD64 Jessie installation ...

Any advice or pointers would be appreciated :)

Cheers

Don Charisma ... because anything is possible with Charisma

My blog - http://DonCharisma.org
Our commercial site - http://DonCharisma.com



Edited 1 time(s). Last edit at 01/11/2015 02:26PM by DonCharisma.
Re: Overprovisioning A Flash Drive ?
January 11, 2015 05:19PM
Hi Don
you have done some good work there already - just thought i would drop a message here as i havent had the opportunity to work on this today - other half had other ideas about utilising my time. should get some time over the week to have a go.

peace

Gravelrash
Re: Overprovisioning A Flash Drive ?
January 12, 2015 10:35AM
@Gravelrash - I'm gonna have to throw in the towel for now, I've tried pretty much every avenue and it just boots into an endless reboot loop. And yes know what you mean about other commitments !

Complications are - f2fs-tools doesn't install with apt-get on wheezy, so makes life difficult without jessie.

'tune2fs -L' doesn't work on f2fs ... which makes life complicated when pointing to rootfs partition by label ... basically the only way to set the f2fs label is when you create the filesystem with something like - 'mkfs.f2fs -l rootfs /dev/sdb2' ... I couldn't find a way to change the label.

For the installation I've tried

1. disabling the hardware watchdog module using Debian's "Blacklist with fake install" method.
2. using different methods for copying the rootfs from ext3 to f2fs, including cp -a and two different rsync commands
3. loading the f2fs module early in /etc/initramfs/modules file.
4. various different settings in fstab
5. setting up bootlogd - but I can't get any messages in /var/log I suspect due to the separate boot and rootfs partitions. Was unable to find out how to solve this, and it means I can't see the log messages on another machine, and I can't get into the installation because it's in a reboot loop !

So I'm short on debug info, all the netconsole tells me is that the kernel starts and then decides to reboot itself ...

The same installation on ext3 boots fine, so it's probably either the kernel not mounting the f2fs partition for some reason, or panicing for some reason because the rootfs is on f2fs.

If you do get it working, I'd be very interested in knowing how you did it ... It'd be a shame if we can't get it working, because mkfs.f2fs has a "-o" switch for overprovisioning built into the filesystem and seems to be very aware of the underlying architecture of flash drives - looks like it probably does garbage collection on my Sandisk Cruzer Fit.

Things that might be worth trying -

1. different kernel versions - bodhi shows as having included f2fs at a certain version level, so it's possible an earlier kernel might not have these issues
2. different install media - I've only tried Sandisk Cruzer Fit, could be a problem with the media, might work fine on a different stick.
3. trying the install on wheezy instead of jessie (in case it's a jessie issue) ... I tried this to start with, but no netconsole or serial cable ... serial cable might yield more info than I'm getting with netconsole.
4. fresh pair of eyes !

Cheers

Don Charisma ... because anything is possible with Charisma

My blog - http://DonCharisma.org
Our commercial site - http://DonCharisma.com
Re: Overprovisioning A Flash Drive ?
January 12, 2015 11:39AM
@Don,

I'll take a look at this in about a couple of weeks when I get home.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Overprovisioning A Flash Drive ?
January 12, 2015 03:46PM
@bodhi - thanks my friend much appreciated :)

I think we can cross off using a different flash drive, I tried another one with the same problem. Also tried an ext4 partition in the same place on the flash drive, using the same copy (rysnc as per archlinux instructions) method and this boots fine ...

Cheers

Don Charisma ... because anything is possible with Charisma

My blog - http://DonCharisma.org
Our commercial site - http://DonCharisma.com
Re: Overprovisioning A Flash Drive ?
January 14, 2015 07:23AM
Not had chance to look at this yet... Work has stopped play and I'm 30 miles away from my devices. There however appears to be a user contributed deb repository for the tools so I will look at that and see if they are platform independent. Hopefully they are and we get steps closer.
Re: Overprovisioning A Flash Drive ?
January 15, 2015 02:56PM
Still not had the opportunity to get to my devices, however from doing reading and "sorting wheat from the chaff" im going to be using the following links as starters for ten when i get back to my toys this weekend.

it looks like any kernel after 3.8 is a viable candidate for f2fs as long as the kernel modules are available or precompiled.
. https://wiki.archlinux.org/index.php/F2FS
. http://www.raspberrypi.org/forums/viewtopic.php?t=47769&p=374239
. http://ubuntuforums.org/showthread.php?t=2241328
.

============================
Breaking stuff since 1994 :-)
============================
Re: Overprovisioning A Flash Drive ?
January 19, 2015 10:37AM
@Gravelrash ... know what you mean I'm busy with work too!

My understanding is bodhi has included the f2fs module in our kernels fairly recently ... do a text search for "f2fs" on the kernel thread and you'll be able to see which kernel it was switched on in ... I've had f2fs working on 3.17 kernel, it reads and writes to it, and if you're on Jessie you can create an f2fs filesystem ... problem is in booting, which I haven't been able to do ...

After the above posts I had a thought - it might be possible to get more bootlogging messages by turning off the busybox-systemd, because that logs everything into memory ! ... bodhi includes this facility in his rootfs to save wear and tear on the flash drives, problem is there's no dmesg or boot.log files in /var/log ... well at least that's my current theory :)

"Breaking stuff since 1994" ... NICE !

Cheers

Don Charisma ... because anything is possible with Charisma

My blog - http://DonCharisma.org
Our commercial site - http://DonCharisma.com
Re: Overprovisioning A Flash Drive ?
January 19, 2015 11:09AM
@Don,

Use logread command to read memory log.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Overprovisioning A Flash Drive ?
January 21, 2015 03:35AM
@bodhi - that's helpful, although there's only one issue - my f2fs installation was in a reboot loop so I can't SSH into the box to run 'logread' command ... what I wanted to do was to read the log from the filesystem after mounting the f2fs parition on a working linux installation ... was thinking that removing the busybox-systemd would start it writing to /var/log/dmesg etc ... unless I missed something !

Cheers

Don Charisma ... because anything is possible with Charisma

My blog - http://DonCharisma.org
Our commercial site - http://DonCharisma.com
Re: Overprovisioning A Flash Drive ?
January 21, 2015 04:01AM
@Don,

Remove the RAM option for busybox syslog before booting might help:
http://forum.doozan.com/read.php?2,18606,18632#msg-18632

Also, even better if you remove systemd from jessie all together.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 01/21/2015 04:03AM by bodhi.
Re: Overprovisioning A Flash Drive ?
February 10, 2015 10:21PM
Don,

I got f2fs to boot with a Jessie rootfs. But there were hurdles that I needed to work around. Here are a few problems that caused me to I think perhaps f2fs is not friendly enough to use as a set-and-forget root system (also, it could be that there are new released features that I'm not aware of yet).

Problems to solve:
- rootfs label does not seem to work in kernel command line. So for booting we have to use the device name, e.g. /dev/sda2. (I need to reverify if this is true).
- fsck.f2fs is not robust as fsck for ext2/3/4. I had to turn off fsck in fstab to make it boot. The rootfs should be fsck'ed during boot, this is bad if we can't find a way to do it.

Hints:
- The rootfs itself must already have f2fs-tools installed (a vanilla basic rootfs, i.e. Debian-3.17.0-kirkwood-tld-1 out of the box, won't work)
- remember to change fstab to indicate rootfs type as f2fs.

UPDATE:

- rootfs label does not work in kernel command line. It seems the reason is the f2fs rootfs label was not populated by the system.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 3 time(s). Last edit at 02/10/2015 10:41PM by bodhi.
Re: Overprovisioning A Flash Drive ?
February 11, 2015 04:38AM
@bodhi - Thanks my friend, very helpful ...

I'd had similar issue with labelling the filesystem, seems it's only possible during creation with the mkfs.f2fs command (the tune2fs label command wouldn't work on f2fs) ...

So boot wise to get this to work, then it's Jessie for sure as f2fs-tools aren't in Wheezy ... and if booting a labelled partition is an issue, I guess then it's /dev/sdX or UUID ?

And agreed fsck whilst a pain in the backside is needed for boot, in case the partition has become corrupted. Did you have swap mounted when the fsck took place ? I ask because mounting of a RAID-10 partition at boot failed for me because the fsck needed more than 128MB of RAM on the GoFlexNet, the solution was to mount the swap and then the fsck on the RAID worked fine.

My solution for now was to boot one of my GFN from Sandisk cruzer fit using ext4 ... and the other is booting ext3 from SATA. Both machines are using "DIY" overprovissioning, in the hope that the drives are smart enough to know what the empty space is for !

Geographically both units are now 6000 miles away - it'll be another 6 months before I have physical access, so my experiments with f2fs will, for now, be limited to my recently acquired Odroid C1 boards. First hurdle with then will be to get Debian as opposed to Unbuntu booting smoothly.

I think f2fs is a really great idea in principle. Hopefully Debian will fix the labelling issue, and whatever's causing it not to mount via label, which could be the aforementioned swap issue ?

Cheers

Don Charisma ... because anything is possible with Charisma

My blog - http://DonCharisma.org
Our commercial site - http://DonCharisma.com
Re: Overprovisioning A Flash Drive ?
February 12, 2015 08:13PM
@Don,

- It is not swap related. fsck.f2fs simply does not like to fsck a mounted drive. So there is not much we can do other than turn off fsck for rootfs.
- You can use uuid to mount rootfs. There should be no problem doing that. I think we will have to wait for future kernel version to the label to work.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Overprovisioning A Flash Drive ?
February 14, 2015 11:47AM
I've heard that in Debian Sid, initramfs can do fsck.f2f2 mounted drives (I have not verified this). And there are a few bug fixes came in for 3.19, and more bug fixes for 3.20. So don't use it for your data drives yet.

Also, using it for rootfs on remote administering devices seems unfeasible. Unless you have a rescue system installed in NAND.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: