Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Mkfs e opzione discard.

20 views
Skip to first unread message

Loki

unread,
Oct 2, 2012, 6:49:42 PM10/2/12
to
Salve,

guardate che strano il comportamento di mkfs, non accetta piu'
l'opzione discard..:



root@crunchbang:/home/crunchbang# mkfs.ext4 /dev/sda1 -b 4096 -E
stripe-width=128,discard
mke2fs 1.41.12 (17-May-2010)

Bad option(s) specified: discard

Extended options are separated by commas, and may take an argument
which
is set off by an equals ('=') sign.

Valid extended options are:
stride=<RAID per-disk data chunk in blocks>
stripe-width=<RAID stride * data disks in blocks>
resize=<resize maximum size in blocks>
lazy_itable_init=<0 to disable, 1 to enable>
test_fs

root@crunchbang:/home/crunchbang#

Allora mi guardo la man, e vedo che e' presente:
-K
Keep, do not attempt to discard blocks at mkfs time (discarding blocks
initially is useful on solid state devices and sparse /
thin-provisioned storage).

Deduco che le versioni recenti debbano fare il discard per default,
allora riprovo SENZA l'opzione discard:

root@crunchbang:/home/crunchbang# mkfs.ext4 -v /dev/sda1 -b 4096 -E
stripe-width=128
mke2fs 1.41.12 (17-May-2010)
fs_types for mke2fs.conf resolution: 'ext4', 'default'
Calling BLKDISCARD from 0 to 45979279360 failed.
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=128 blocks
2809856 inodes, 11225410 blocks
561270 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
343 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632,
2654208,
4096000, 7962624

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 34 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
root@crunchbang:/home/crunchbang#

Notate: Calling BLKDISCARD from 0 to 45979279360 failed.

Qualcuno puo' spiegarmi?

Lem Novantotto

unread,
Oct 3, 2012, 2:45:20 AM10/3/12
to
Loki ha scritto:

> guardate che strano il comportamento di mkfs, non accetta piu'
> l'opzione discard..:

Discard non è mai stata un'opzione di mkfs. È un'opzione di mount:
inseriscila in /etc/fstab.
--
Bye, Lem
Ceterum censeo ISLAM esse delendum
_________________________________________________________________
Non sprecare i cicli idle della tua CPU, né quelli della tua GPU.
http://www.worldcommunitygrid.org/index.jsp
http://www.rnaworld.de/rnaworld/ http://home.edges-grid.eu/home/
http://www.gpugrid.net/

Loki

unread,
Oct 3, 2012, 1:47:54 PM10/3/12
to
On 03 Oct 2012 06:45:20 GMT, Lem Novantotto <Le...@Hotmail.com> wrote:

>Loki ha scritto:
>
>> guardate che strano il comportamento di mkfs, non accetta piu'
>> l'opzione discard..:
>
>Discard non � mai stata un'opzione di mkfs. � un'opzione di mount:
>inseriscila in /etc/fstab.

Ma sicuro? Io mi ricordo che servisse per trimmare l'ssd al momento
della formattazione.

Che sia un'opzione *anche* di mount e' pacifico, certo..

Loki

unread,
Oct 3, 2012, 2:08:16 PM10/3/12
to
On 03 Oct 2012 06:45:20 GMT, Lem Novantotto <Le...@Hotmail.com> wrote:

>Loki ha scritto:
>
>> guardate che strano il comportamento di mkfs, non accetta piu'
>> l'opzione discard..:
>
>Discard non � mai stata un'opzione di mkfs. � un'opzione di mount:
>inseriscila in /etc/fstab.

Visto che ci siamo approfitto senza aprire un altro thread.

Voglio cambiare ssd ad un pc con linux. Ovvero, mi occorre qualcosa
che backuppi preservando l'allineamento.

Suggerimenti?
Grazie.

Loki

unread,
Oct 3, 2012, 2:09:16 PM10/3/12
to
On Wed, 03 Oct 2012 19:47:54 +0200, Loki <lok...@gmail.com> wrote:

>On 03 Oct 2012 06:45:20 GMT, Lem Novantotto <Le...@Hotmail.com> wrote:
>
>>Loki ha scritto:
>>
>>> guardate che strano il comportamento di mkfs, non accetta piu'
>>> l'opzione discard..:
>>
>>Discard non � mai stata un'opzione di mkfs. � un'opzione di mount:
>>inseriscila in /etc/fstab.

4f11b422$0$16639$5fc...@news.tiscali.it

Lem Novantotto

unread,
Oct 3, 2012, 2:13:53 PM10/3/12
to
Loki ha scritto:

> Ma sicuro? Io mi ricordo che servisse per trimmare l'ssd al momento
> della formattazione.

Hai proprio ragione tu: discard e nodiscard. Sorry.

Lem Novantotto

unread,
Oct 3, 2012, 2:26:04 PM10/3/12
to
Loki ha scritto:

> guardate che strano il comportamento di mkfs, non accetta piu'
> l'opzione discard..:

Controllando, mi pare sia il contrario: l'opzione -K è stata abbandonata
in favore di discard e nodiscard (presenti già in mke2fs 1.41.14).

Loki

unread,
Oct 3, 2012, 2:40:52 PM10/3/12
to
On 03 Oct 2012 18:13:53 GMT, Lem Novantotto <Le...@Hotmail.com> wrote:

>Loki ha scritto:
>
>> Ma sicuro? Io mi ricordo che servisse per trimmare l'ssd al momento
>> della formattazione.
>
>Hai proprio ragione tu: discard e nodiscard. Sorry.

Dunque devo dedurre che l'abbiano levata/messa per default?

Loki

unread,
Oct 3, 2012, 2:48:52 PM10/3/12
to
On 03 Oct 2012 18:26:04 GMT, Lem Novantotto <Le...@Hotmail.com> wrote:

>Loki ha scritto:
>
>> guardate che strano il comportamento di mkfs, non accetta piu'
>> l'opzione discard..:
>
>Controllando, mi pare sia il contrario: l'opzione -K � stata abbandonata
>in favore di discard e nodiscard (presenti gi� in mke2fs 1.41.14).

Uhm... ma perche' allora mi risponde in quel modo?

Grazie.

Lem Novantotto

unread,
Oct 3, 2012, 5:55:22 PM10/3/12
to
Loki ha scritto:

> Uhm... ma perche' allora mi risponde in quel modo?

Non saprei.

Prova ad usare un mkfs.ext4 aggiornato.

Colla mia versione entrambe le opzioni, discard e nodiscard,
funzionano come previsto. Discard si può omettere, è il default:

lem@biggy:~$ sudo mkfs.ext4 -v -b 4096 -E stripe-width=128,discard /dev/ram2
mke2fs 1.41.14 (22-Dec-2010)
fs_types for mke2fs.conf resolution: 'ext4', 'small'
Calling BLKDISCARD from 0 to 67108864 succeeded.
Discard succeeded and will return 0s - skipping inode table wipe
[...]
lem@biggy:~$ sudo mkfs.ext4 -v -b 4096 -E stripe-width=128 /dev/ram2
mke2fs 1.41.14 (22-Dec-2010)
fs_types for mke2fs.conf resolution: 'ext4', 'small'
Calling BLKDISCARD from 0 to 67108864 succeeded.
Discard succeeded and will return 0s - skipping inode table wipe
[...]
lem@biggy:~$ sudo mkfs.ext4 -v -b 4096 -E stripe-width=128,nodiscard /dev/ram2
mke2fs 1.41.14 (22-Dec-2010)
fs_types for mke2fs.conf resolution: 'ext4', 'small'
Etichetta del filesystem=
[...]

Notare che il man dice invece cazzate contraddittorie (e nemmeno le
dice in inglese):

discard
Attempt to discard blocks at mkfs time
(discarding blocks initially is useful on solid state devices and
sparse / thin-provisioned storage). When the device advertises
that discard also zeroes data (any subsequent read after the
discard and before write returns zero), then mark all not-yet-zeroed
inode tables as zeroed. This significantly speeds up filesystem
initialization. This is set as default.

nodiscard
Do not attempt to discard blocks at mkfs
time. This is the default.

Loki

unread,
Oct 4, 2012, 9:10:23 AM10/4/12
to
On 03 Oct 2012 21:55:22 GMT, Lem Novantotto <Le...@Hotmail.com> wrote:

>Loki ha scritto:
>
>> Uhm... ma perche' allora mi risponde in quel modo?
>
>Non saprei.
>
>Prova ad usare un mkfs.ext4 aggiornato.

E' quello dell'ultima crunchbang, dovrebbe essere aggiornato, mah!

>Notare che il man dice invece cazzate contraddittorie (e nemmeno le
>dice in inglese)

E' davvero deprecabile che la manpage sia fatta cosi' a ca%%o per un
comando cosi' importante.
0 new messages