HFS to APFS - Deduplicate Existing Files

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

  1. LERsince1991 macrumors 65816

    Joined:
    Jul 24, 2008
    Location:
    UK
    #1
    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?

    Thanks,
     
  2. casperes1996 macrumors 68030

    casperes1996

    Joined:
    Jan 26, 2014
    Location:
    Horsens, Denmark
    #2

    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

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

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

    MrElvey

    Joined:
    Feb 22, 2010
    #4
    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 member

    Joined:
    Nov 29, 2014
    #5
    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 G3

    h9826790

    Joined:
    Apr 3, 2014
    Location:
    Hong Kong
    #6
    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 68030

    casperes1996

    Joined:
    Jan 26, 2014
    Location:
    Horsens, Denmark
    #7

    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