Page 1 of 1

recommended formatting of USB flash drive install

Posted: 11 Jan 2017, 13:43
by rych
How should I format my USB drive? I've understood that ext4 is the best choice for the filesystem, but how to tune it for a maximum performance while preserving some repairable integrity in case I accidentally unplug the USB drive or loose power? I'm confused about all these options: ordered, writeback, noatime, nodiratime. Should I disable journal like this:

Code: Select all

mkfs.ext4 -O ^has_journal /dev/sda10
What other parameters should I tune using tune2fs?

EDIT: The answer to this question depends on what/how often porteus writes to the disk, and that depends on whether we use "changes=EXIT:". But in any case, according to this thread viewtopic.php?f=48&t=5642&p=43376, the /tmp always lives in RAM. Couldn't find where the "/var/log" lives, hopefully also as tmpfs. Anyway, with writing to the USB already minimized perhaps journalling parameters of the USB filesystem and how it's mounted are less important, but I'd still want to hear a definite answer on how exactly to format my USB before I install porteus on it.

Re: recommended formatting of USB flash drive install

Posted: 11 Jan 2017, 14:52
by tome

Re: recommended formatting of USB flash drive install

Posted: 11 Jan 2017, 16:50
by donald
Personally i use ext2 on flash drives.
(thumb drive; i do not own any ssd)

When comparing performance with other filesystems, it's always
important to try multiple workloads; very often a subtle change in a
workload parameter can completely change the ranking of which
filesystems do well compared to others.

I have never noticed a speed advantage with EXT 3 or 4 anyway.

The nodiratime option disables the writing of file access times only for directories
while other files still get access times written.

The noatime option fully disables writing file access times to the drive every time
you read a file. This works well for almost all applications, except for those
that need to know if a file has been read since the last time it was modified.

noatime implies nodiratime - it's a superset

data=ordered
All data are forced directly out to the main file system
prior to its metadata being committed to the journal.

data=writeback
Data ordering is not preserved, data may be written
into the main file system after its metadata has been
committed to the journal.
Note:It can potentially leave stale data in recently written files
in case of an unclean shutdown.

Re: recommended formatting of USB flash drive install

Posted: 12 Jan 2017, 02:42
by donald
rych wrote:but I'd still want to hear a definite answer on how exactly to format my USB
What do you want to achieve?
Nothing is universally, Performance is one thing, Lifetime is another and they correlate.

In general:
The read write speed capability of the built in memory-chips is much more relevant than the file system.
and it is more likely that you lose your usb-stick before it wears out.

Re: recommended formatting of USB flash drive install

Posted: 12 Jan 2017, 07:54
by rych
I've ended up doing simply

Code: Select all

mkfs.ext4 -m 1 /dev/sdc1
tune2fs -o journal_data_ordered /dev/sdc1
tune2fs -l /dev/sdc1