Announcement

Collapse
No announcement yet.

Getting ready for IPFS a/o ZeroNet

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Getting ready for IPFS a/o ZeroNet

    I currently have 3 HDs, each 700Gb and running Btrfs, in this laptop. Two are used in a RAID1 configuration and one is my snapshot storage.

    I have started experimenting with IPFS and ZeroNet, p2p solutions to Internet censorship. Last night I had 605 peers connected to my IPFS instance. Each can take about 10Mb or more for their web image. When I checked my bandwidth usage before I shut down IPFS there had been about 6Gb into my connection and about 35Gb moved out of my connection to other peers during three hours of usage. Luckily, I have a 60+Mbps connection, soon to be upgraded to 100Mbps, if not 1Gbps. That data is stored in the IPFS repo, which resides at ~/.ipfs. Supposedly, neither Spectrum nor Allo have bandwidth caps, but I suspect that will change if a lot of people start acting as nodes in a P2P network. Spectrum's bandwidth cap history is here. In a chat with an Allo rep he stated that Allo, which is a startup, does not have a bandwidth cap.

    Using two of my HDs as RAID1 I suspect that my free disk space will diminish considerably. So, I plan to revert to a system with two HDs forming a single pool, to at least double my free space, while still using the third drive as storage for my @ and @home snapshots.

    Here is my setup as it currently is:
    Code:
     sudo btrfs device usage /
    
    /dev/sda1, ID: 1
       Device size:           691.19GiB
       Device slack:              0.00B
       Data,RAID1:            146.00GiB
       Metadata,RAID1:          3.00GiB
       System,RAID1:           32.00MiB
       Unallocated:           542.15GiB
    
    
    /dev/sdc, ID: 2
       Device size:           698.64GiB
       Device slack:              0.00B
       Data,RAID1:            146.00GiB
       Metadata,RAID1:          3.00GiB
       System,RAID1:           32.00MiB
       Unallocated:           549.61GiB
                                                                                                                              
     sudo btrfs fi show /     
    Label: none  uuid: 12980ae8-4117-4cc5-bbb8-8065e82af93d
            Total devices 2 FS bytes used 146.24GiB
            devid    1 size 691.19GiB used 149.03GiB path /dev/sda1
            devid    2 size 698.64GiB used 149.03GiB path /dev/sdc
    
    
     sudo btrfs fi usage /
    Overall:
        Device size:                   1.36TiB
        Device allocated:            298.06GiB
        Device unallocated:            1.07TiB
        Device missing:                  0.00B
        Used:                        292.48GiB
        Free (estimated):            547.21GiB      (min: 547.21GiB)
        Data ratio:                       2.00
        Metadata ratio:                   2.00
        Global reserve:              272.50MiB      (used: 0.00B)
    
    
    Data,RAID1: Size:146.00GiB, Used:144.67GiB
       /dev/sda1     146.00GiB
       /dev/sdc      146.00GiB
    
    
    Metadata,RAID1: Size:3.00GiB, Used:1.57GiB
       /dev/sda1       3.00GiB
       /dev/sdc        3.00GiB
    
    
    System,RAID1: Size:32.00MiB, Used:48.00KiB
       /dev/sda1      32.00MiB
       /dev/sdc       32.00MiB
    
    
    Unallocated:
       /dev/sda1     542.15GiB
       /dev/sdc      549.61GiB
    [#]P2P[/#]
    [#]BTRFS[/#]
    Last edited by GreyGeek; Sep 22, 2017, 11:35 AM.
    "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
    – John F. Kennedy, February 26, 1962.

    #2
    I converted my RAID1 setup back to a single pool setup. It took an hour and 12 minutes. Here's how I did it.
    Code:
    # sudo -i
    # mount /dev/sda1 /mnt
    # vdir /mnt
    total 0
    drwxr-xr-x 1 root root 430 Sep  4 16:12 @
    drwxr-xr-x 1 root root  26 Sep  5 12:02 @home
    drwxr-xr-x 1 root root 128 Sep  4 16:22 snapshots
    
    # btrfs balance start -v -sconvert=single -mconvert=dup -f -dconvert=single /mnt
    
    Dumping filters: flags 0xf, state 0x0, force is on
      DATA (flags 0x100): converting, target=281474976710656, soft is off
      METADATA (flags 0x100): converting, target=32, soft is off
      SYSTEM (flags 0x100): converting, target=281474976710656, soft is off
    Done, had to relocate 155 out of 155 chunks
    
    # btrfs device usage /
    /dev/sda1, ID: 1
       Device size:           691.19GiB
       Device slack:              0.00B
       Data,single:            74.00GiB
       System,single:          32.00MiB
       Unallocated:           617.15GiB
    
    
    /dev/sdc, ID: 2
       Device size:           698.64GiB
       Device slack:              0.00B
       Data,single:            77.00GiB
       Metadata,DUP:            4.00GiB
       Unallocated:           617.64GiB
    
    
    # btrfs fi show
    Label: none  uuid: 12980ae8-4117-4cc5-bbb8-8065e82af93d
            Total devices 2 FS bytes used 143.83GiB
            devid    1 size 691.19GiB used 74.03GiB path /dev/sda1
            devid    2 size 698.64GiB used 81.00GiB path /dev/sdc
    
    
    Label: none  uuid: 17f4fe91-5cbc-46f6-9577-10aa173ac5f6
            Total devices 1 FS bytes used 449.80GiB
            devid    1 size 698.63GiB used 455.02GiB path /dev/sdb1
    
    
    # btrfs fi usage /
    Overall:
        Device size:                   1.36TiB
        Device allocated:            155.03GiB
        Device unallocated:            1.21TiB
        Device missing:                  0.00B
        Used:                        145.10GiB
        Free (estimated):              1.21TiB      (min: 625.83GiB)
        Data ratio:                       1.00
        Metadata ratio:                   2.00
        Global reserve:              258.44MiB      (used: 0.00B)
    
    
    Data,single: Size:151.00GiB, Used:142.57GiB
       /dev/sda1      74.00GiB
       /dev/sdc       77.00GiB
    
    
    Metadata,DUP: Size:2.00GiB, Used:1.26GiB
       /dev/sdc        4.00GiB
    
    
    System,single: Size:32.00MiB, Used:48.00KiB
       /dev/sda1      32.00MiB
    
    
    Unallocated:
       /dev/sda1     617.15GiB
       /dev/sdc      617.64GiB
    Now I am going to balance the pool
    "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
    – John F. Kennedy, February 26, 1962.

    Comment


      #3
      I finished the balance. It took about 30 minutes. Here are the results:
      Code:
      $ sudo -i    
      [sudo] password for jerry: 
      
      # btrfs device usage /
      /dev/sda1, ID: 1
         Device size:           691.19GiB
         Device slack:              0.00B
         Data,single:            68.00GiB
         Metadata,RAID1:          4.00GiB
         System,single:          32.00MiB
         Unallocated:           619.15GiB
      
      
      /dev/sdc, ID: 2
         Device size:           698.64GiB
         Device slack:              0.00B
         Data,single:            75.00GiB
         Metadata,RAID1:          4.00GiB
         Unallocated:           619.64GiB                                                                                           
                                                                                                                                    
      # btrfs fi usage /        
      Overall:                                                                                                                      
          Device size:                   1.36TiB                                                                                     
          Device allocated:            151.03GiB                                                                                     
          Device unallocated:            1.21TiB                                                                                      
          Device missing:                  0.00B                                                                                      
          Used:                        145.14GiB                                                                                       
          Free (estimated):              1.21TiB      (min: 619.79GiB)                                                                 
          Data ratio:                       1.00
          Metadata ratio:                   2.00
          Global reserve:              259.27MiB      (used: 0.00B)
      
      
      Data,single: Size:143.00GiB, Used:142.61GiB
         /dev/sda1      68.00GiB
         /dev/sdc       75.00GiB
      
      
      Metadata,RAID1: Size:4.00GiB, Used:1.27GiB
         /dev/sda1       4.00GiB
         /dev/sdc        4.00GiB
      
      
      System,single: Size:32.00MiB, Used:16.00KiB
         /dev/sda1      32.00MiB
      
      
      Unallocated:
         /dev/sda1     619.15GiB
         /dev/sdc      619.64GiB
      
      # btrfs fi show
      Label: none  uuid: 12980ae8-4117-4cc5-bbb8-8065e82af93d
              Total devices 2 FS bytes used 143.87GiB
              devid    1 size 691.19GiB used 72.03GiB path /dev/sda1
              devid    2 size 698.64GiB used 79.00GiB path /dev/sdc
      
      
      Label: none  uuid: 17f4fe91-5cbc-46f6-9577-10aa173ac5f6
              Total devices 1 FS bytes used 449.80GiB
              devid    1 size 698.63GiB used 455.02GiB path /dev/sdb1
      My system appears to be running find. I see one problem: the metadata is still classified as RAID1. It should have been DUP.
      (# btrfs balance start -v -sconvert=single -mconvert=dup -f -dconvert=single /mnt)

      Apparently, since I left /dev/sdc in the 2 HD pool before I did the re-balance, btrfs left the metadata property set to RAID1.

      I will probably have to redo the balance using a -msingle soft -f filter, or, delete /dev/sdc from the pool, re-balance it, then re-add it back and re-balance again.

      The purpose of this procedure was to increase the available HD space for IPFS a/o ZeroNet peers. That purpose was accomplished in that the new condition shows between 619Gb and 1.2Tb available for peers. That's about the size of an entire HD.


      In previous posts I have shown how to make snapshots, how to send&receive them to other pools either as a file structure or an ASCI stream, how to roll back @ & @home to a previous snapshot, how to convert a single HD btrfs pool into a 2 HD RAID1 pool, and with this example, how to convert a 2 HD btrfs RAID1 pool back to a 2 HD btrfs JABOD pool.
      Last edited by GreyGeek; Sep 05, 2017, 03:29 PM.
      "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
      – John F. Kennedy, February 26, 1962.

      Comment

      Working...
      X