[{"data":1,"prerenderedAt":396},["ShallowReactive",2],{"Categories":3,"NavIndexCategoriesCountFooter":203,"content-\u002F2005\u002F05\u002F22\u002Fadding-a-new-disk-with-lvm-and-xfs\u002F":204},[4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,68,70,71,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202],{"category":5},"System Administration",{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},"Software Development",{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":27},{"category":27},{"category":67},"Drones & RC",{"category":69},"DIY Projects",{"category":67},{"category":72},"Photography",{"category":69},{"category":69},{"category":69},{"category":67},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":67},{"category":69},{"category":69},{"category":67},{"category":67},{"category":72},{"category":72},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":5},{"category":5},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":5},{"category":67},{"category":67},{"category":72},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":72},{"category":67},{"category":138},"3D Printing - Laser Cutting - CNC",{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":5},{"category":138},{"category":27},{"category":27},{"category":138},{"category":138},{"category":72},{"category":158},"Photography,3D Printing - Laser Cutting - CNC",{"category":27},{"category":27},{"category":69},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":67},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":27},{"category":69},{"category":27},{"category":27},{"category":27},{"category":27},{"category":181},"Home Assistant",{"category":181},{"category":72},{"category":27},{"category":27},{"category":72},{"category":138},{"category":5},{"category":72},{"category":72},{"category":138},{"category":27},{"category":181},{"category":181},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},191,{"id":205,"title":206,"body":207,"category":5,"date":383,"description":213,"embedImage":384,"extension":385,"image":384,"intro":384,"meta":386,"navigation":387,"path":388,"seo":389,"series":384,"sitemap":390,"stem":391,"tags":392,"__hash__":395},"content\u002F2005\u002F05\u002F22\u002Fadding-a-new-disk-with-lvm-and-xfs.md","Adding a new disk with LVM and XFS",{"type":208,"value":209,"toc":381},"minimark",[210,214,217,230,233,281,284,287,299,302,317,320,336,339,352,355,358,377],[211,212,213],"p",{},"This machine is a debian sarge install (2.6 kernel). During installation - it was set up with root as ext3, some swap - and the rest of the disk as an lvm area. All partitions within this area are xfs. All the work was done by the debian installer. Now - we have a new disk which I needed to add.",[211,215,216],{},"So - since this is an already running box - the debian installer can't really be used - let's use the actual utilities.",[211,218,219,220],{},"All of the required steps are documented ",[221,222,229],"a",{"href":223,"rel":224,"target":228},"http:\u002F\u002Fwww.tldp.org\u002FHOWTO\u002FLVM-HOWTO\u002Fcommontask.html",[225,226,227],"nofollow","noopener","noreferer","_blank","on the LVM HOWTO",[211,231,232],{},"First - we need to decide if we are going to use the whole disk or a partition. In this case - the whole disk \u002Fdev\u002Fhdb. To be able to do this - any existing partition table must be removed",[234,235,240],"pre",{"className":236,"code":237,"language":238,"meta":239,"style":239},"language-shell shiki shiki-themes github-dark","dd if=\u002Fdev\u002Fzero of=\u002Fdev\u002Fhdb bs=1k count=1\nblockdev --rereadpt \u002Fdev\u002Fhdb\n","shell","",[241,242,243,269],"code",{"__ignoreMap":239},[244,245,248,252,256,259,262,265],"span",{"class":246,"line":247},"line",1,[244,249,251],{"class":250},"svObZ","dd",[244,253,255],{"class":254},"sU2Wk"," if=\u002Fdev\u002Fzero",[244,257,258],{"class":254}," of=\u002Fdev\u002Fhdb",[244,260,261],{"class":254}," bs=1k",[244,263,264],{"class":254}," count=",[244,266,268],{"class":267},"sDLfK","1\n",[244,270,272,275,278],{"class":246,"line":271},2,[244,273,274],{"class":250},"blockdev",[244,276,277],{"class":267}," --rereadpt",[244,279,280],{"class":254}," \u002Fdev\u002Fhdb\n",[211,282,283],{},"Not sure if the blockdev command is needed - it worked without for me.",[211,285,286],{},"Now - we can create a physical volume on the device",[234,288,290],{"className":236,"code":289,"language":238,"meta":239,"style":239},"pvcreate \u002Fdev\u002Fhdb\n",[241,291,292],{"__ignoreMap":239},[244,293,294,297],{"class":246,"line":247},[244,295,296],{"class":250},"pvcreate",[244,298,280],{"class":254},[211,300,301],{},"We want to add this to the existing volume group vg0",[234,303,305],{"className":236,"code":304,"language":238,"meta":239,"style":239},"vgextend vg0 \u002Fdev\u002Fhdb\n",[241,306,307],{"__ignoreMap":239},[244,308,309,312,315],{"class":246,"line":247},[244,310,311],{"class":250},"vgextend",[244,313,314],{"class":254}," vg0",[244,316,280],{"class":254},[211,318,319],{},"So - let's extend an existing logical volume. For testing we'll try \u002Ftmp since the contents are not so important. It's currently 512M - lets double that.",[234,321,323],{"className":236,"code":322,"language":238,"meta":239,"style":239},"lvextend -L1G \u002Fdev\u002Fvg0\u002Ftmp\n",[241,324,325],{"__ignoreMap":239},[244,326,327,330,333],{"class":246,"line":247},[244,328,329],{"class":250},"lvextend",[244,331,332],{"class":267}," -L1G",[244,334,335],{"class":254}," \u002Fdev\u002Fvg0\u002Ftmp\n",[211,337,338],{},"And then - xfs needs to be told to use the whole area (one of the reasons for choosing xfs is xfs_growfs - since it can be run on a mounted active directory)",[234,340,342],{"className":236,"code":341,"language":238,"meta":239,"style":239},"xfs_growfs \u002Ftmp\n",[241,343,344],{"__ignoreMap":239},[244,345,346,349],{"class":246,"line":247},[244,347,348],{"class":250},"xfs_growfs",[244,350,351],{"class":254}," \u002Ftmp\n",[211,353,354],{},"Note - the lvextend command here is told to set the size to 1G - we could have used -L+1G - which would have added 1G to the existing size.",[211,356,357],{},"To add a new logical volume newvol to volume group vg0 instead you could use",[234,359,361],{"className":236,"code":360,"language":238,"meta":239,"style":239},"lvcreate -L1500 -nnewvol vg0\n",[241,362,363],{"__ignoreMap":239},[244,364,365,368,371,374],{"class":246,"line":247},[244,366,367],{"class":250},"lvcreate",[244,369,370],{"class":267}," -L1500",[244,372,373],{"class":267}," -nnewvol",[244,375,376],{"class":254}," vg0\n",[378,379,380],"style",{},"html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":239,"searchDepth":271,"depth":271,"links":382},[],"2005-05-22 11:41:53 +0200",null,"md",{},true,"\u002F2005\u002F05\u002F22\u002Fadding-a-new-disk-with-lvm-and-xfs",{"title":206,"description":213},{"loc":388},"2005\u002F05\u002F22\u002Fadding-a-new-disk-with-lvm-and-xfs",[393,394],"linux","lvm2","Jigdzy_kcT5_NMj5lQH1u9RF9XeQHsbil9dAQhOsyRU",1775293017151]