m0n0lithic

rados/rbd image02

Nov 20th, 2012
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.91 KB | None | 0 0
  1. # rbd ls -p spoa
  2. image01
  3. image02
  4.  
  5. # rbd --image image01 -p spoa info
  6. rbd image 'image01':
  7. size 300 GB in 76800 objects
  8. order 22 (4096 KB objects)
  9. block_name_prefix: rb.0.0
  10. parent: (pool -1)
  11.  
  12.  
  13. master ceph # rbd -c ceph.conf map image01 --pool spoa --name client.admin --secret key.admin
  14.  
  15.  
  16. master ceph # rbd -c ceph.conf map image02 --pool spoa --name client.admin --secret key.admin
  17.  
  18. dmesg:
  19. device label SAVAGE devid 1 transid 211 /dev/rbd1p1
  20. btrfs: disk space caching is enabled
  21. rbd2: p1
  22. rbd: rbd2: added with size 0x30000000000
  23.  
  24. Consultando partición de 3TB:
  25. # parted /dev/rbd2
  26. GNU Parted 3.1
  27. Using /dev/rbd2
  28. Welcome to GNU Parted! Type 'help' to view a list of commands.
  29. (parted) p
  30. Model: Unknown (unknown)
  31. Disk /dev/rbd2: 3299GB
  32. Sector size (logical/physical): 512B/512B
  33. Partition Table: gpt
  34. Disk Flags:
  35.  
  36. Number Start End Size File system Name Flags
  37. 1 4194kB 3299GB 3299GB logical
  38.  
  39. master ceph # mkfs.btrfs -L SERRANA /dev/rbd2p1
  40.  
  41. WARNING! - Btrfs Btrfs v0.19 IS EXPERIMENTAL
  42. WARNING! - see http://btrfs.wiki.kernel.org before using
  43.  
  44. fs created label SERRANA on /dev/rbd2p1
  45. nodesize 4096 leafsize 4096 sectorsize 4096 size 2.00TB
  46. Btrfs Btrfs v0.19
  47.  
  48.  
  49. =============================================
  50. Create partition aligned using parted
  51.  
  52. master spoa # parted /dev/rbd2 unit s p free
  53. Model: Unknown (unknown)
  54. Disk /dev/rbd2: 6442450944s
  55. Sector size (logical/physical): 512B/512B
  56. Partition Table: gpt
  57. Disk Flags:
  58.  
  59. Number Start End Size File system Name Flags
  60. 34s 6442450910s 6442450877s Free Space
  61.  
  62. Create partition aligned using parted
  63. # parted /dev/rbd2 p free
  64. Model: Unknown (unknown)
  65. Disk /dev/rbd2: 3299GB
  66. Sector size (logical/physical): 512B/512B
  67. Partition Table: gpt
  68. Disk Flags:
  69.  
  70. Number Start End Size File system Name Flags
  71. 17.4kB 3299GB 3299GB Free Space
  72.  
  73.  
  74. master spoa # parted -a optimal /dev/rbd2 mkpart primary 0% 100%
  75. Information: You may need to update /etc/fstab.
  76.  
  77. master spoa # parted /dev/rbd2 p free
  78. Model: Unknown (unknown)
  79. Disk /dev/rbd2: 3299GB
  80. Sector size (logical/physical): 512B/512B
  81. Partition Table: gpt
  82. Disk Flags:
  83.  
  84. Number Start End Size File system Name Flags
  85. 17.4kB 4194kB 4177kB Free Space
  86. 1 4194kB 3299GB 3299GB primary
  87. 3299GB 3299GB 4177kB Free Space
  88.  
  89. # mkfs.btrfs -L SERRANA /dev/rbd2p1
  90.  
  91. WARNING! - Btrfs Btrfs v0.19 IS EXPERIMENTAL
  92. WARNING! - see http://btrfs.wiki.kernel.org before using
  93.  
  94. fs created label SERRANA on /dev/rbd2p1
  95. nodesize 4096 leafsize 4096 sectorsize 4096 size 3.00TB
  96. Btrfs Btrfs v0.19
  97.  
  98. =================================================
  99. Create partition aligned using parted
  100. http://unix.stackexchange.com/questions/38164/create-partition-aligned-using-parted
  101. I'm partitioning a non-SSD hard disk with parted because I want a GPT partition table.
  102.  
  103. parted /dev/sda mklabel gpt
  104. Now, I'm trying to create partitions correctly aligned so I use the next command to know where begins the first sector:
  105.  
  106. parted /dev/sda unit s p free
  107.  
  108. Disk /dev/sda: 488397168s
  109. Sector size (logical/physical): 512B/512B
  110. Partition Table: gpt
  111.  
  112. Number Start End Size File system Name Flags
  113. 34s 488397134s 488397101s Free Space
  114. We can see that it starts in the sector 34 (it's by default when this partition table is used).
  115.  
  116. So, to create the first partition I tried:
  117.  
  118. parted /dev/sda mkpart primary 63s 127s
  119. to align it in the sector 64 since it's multiple of 8 but it shows:
  120.  
  121. Warning: The resulting partition is not properly aligned for best performance.
  122.  
  123. The sector size logical and physical in my hard disk are both of 512 bytes:
  124.  
  125. cat /sys/block/sda/queue/physical_block_size
  126. 512
  127.  
  128. cat /sys/block/sda/queue/logical_block_size
  129. 512
  130. How to create partitions correctly aligned? What I'm doing wrong?
Advertisement
Add Comment
Please, Sign In to add comment