HFS to APFS - Deduplicate Existing Files

Discussion in 'macOS High Sierra (10.13)' started by LERsince1991, Jun 17, 2017.

  1. LERsince1991 macrumors 65816

    Jul 24, 2008
    As the title suggests I will convert all my HFS drives (internal and external) over to APFS, I believe this is to be a seamless process without loss of files, but will its deduplication capabilities work on existing duplicated files?

    For example will it run deduplication comparison on existing files to create additional space where possible, or will it only log new copies.

    Bonus question - On many files I already use hard links to avoid duplicated data, I believe these hard links will remain OK once converted?

  2. casperes1996 macrumors 68040


    Jan 26, 2014
    Horsens, Denmark

    Conversion should be smooth, yes. Note though that per default Apple doesn't convert HDDs. Only disks that have an SSD element, presumably because of changes in block size or something like that, that would decrease performance on spinning platter disks.

    Deduplication of existing duplicates is something I'd find highly unlikely. Can't say more than that. I have an APFS disk, but it was formatted fresh.

    Your links will stay fine.
  3. KALLT macrumors 601

    Sep 23, 2008
    APFS doesn’t support deduplication. Cloning is done only when copying files.

    File-to-file hard links should be fine.
  4. MrElvey macrumors newbie


    Feb 22, 2010
    There's a major problem I worry about (and you may have already stumbled past or need to worry about): APFS support for preexisting deduplication! I have deduped a lot of things already by creating hard links over the years. And I read that APFS DOES NOT SUPPORT hard links to directories. If I recall correctly, a significant number of the hard links I created are to directories. (I haven't checked).
  5. TETENAL macrumors regular

    Nov 29, 2014
    Don't do it. Only convert the internal boot drive if it is a SSD. That is what Apple suggests.

    APFS is not yet ready for spinning drives.
  6. h9826790 macrumors G5


    Apr 3, 2014
    Hong Kong
    IMO, APFS is not even ready for SSD (as OS). I tried that since HS official launch, and finally go back to HFS+ about a month ago because slow boot, Finder micro hang, or even HDD mount issue (the HDD is HFS+, but if the SSD boot drive is in APFS with TRIM enabled can cause my HDD disappear after warm restart).

    And now, I went back to HFS+, and I am a happy HS user.
  7. casperes1996 macrumors 68040


    Jan 26, 2014
    Horsens, Denmark

    This is from the man page for ln
    By default, ln makes hard links. A hard link to a file is indistinguish-

    able from the original directory entry; any changes to a file are effec-

    tively independent of the name used to reference the file. Hard links

    may not normally refer to directories and may not span file systems.

    As you can see, HFS+ allowing hard links to directories is non-standard, and APFS acts more like what is expected in that case. Symbolic links should've been used, or a new directory created containing hard links to the items inside the other directory

Share This Page

6 June 17, 2017