about summary refs log tree commit diff stats
path: root/Makefile
blob: 9ef219a53c575f6adbbf5a8ae7f0e594ad0831fa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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
# dwm - dynamic window manager
#   (C)opyright MMVI Anselm R. Garbe

include config.mk

SRC = client.c draw.c event.c main.c tag.c util.c
OBJ = ${SRC:.c=.o}

all: options dwm
	@echo finished

options:
	@echo dwm build options:
	@echo "CFLAGS   = ${CFLAGS}"
	@echo "LDFLAGS  = ${LDFLAGS}"
	@echo "CC       = ${CC}"

.c.o:
	@echo CC $<
	@${CC} -c ${CFLAGS} $<

${OBJ}: dwm.h config.h config.mk

config.h:
	@echo creating $@ from config.default.h
	@cp config.default.h $@

dwm: ${OBJ}
	@echo LD $@
	@${CC} -o $@ ${OBJ} ${LDFLAGS}
	@strip $@

clean:
	@echo cleaning
	@rm -f dwm ${OBJ} dwm-${VERSION}.tar.gz

dist: clean
	@echo creating dist tarball
	@mkdir -p dwm-${VERSION}
	@cp -R LICENSE Makefile README config.*.h config.mk \
		dwm.1 dwm.h ${SRC} dwm-${VERSION}
	@tar -cf dwm-${VERSION}.tar dwm-${VERSION}
	@gzip dwm-${VERSION}.tar
	@rm -rf dwm-${VERSION}

install: all
	@echo installing executable file to ${DESTDIR}${PREFIX}/bin
	@mkdir -p ${DESTDIR}${PREFIX}/bin
	@cp -f dwm ${DESTDIR}${PREFIX}/bin
	@chmod 755 ${DESTDIR}${PREFIX}/bin/dwm
	@echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
	@mkdir -p ${DESTDIR}${MANPREFIX}/man1
	@sed 's/VERSION/${VERSION}/g' < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1
	@chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1

uninstall:
	@echo removing executable file from ${DESTDIR}${PREFIX}/bin
	@rm -f ${DESTDIR}${PREFIX}/bin/dwm
	@echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
	@rm -f ${DESTDIR}${MANPREFIX}/man1/dwm.1

.PHONY: all options clean dist install uninstall
ound-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
<!DOCTYPE html>
<html dir="ltr" lang="en">
    <head>
        <meta charset='utf-8'>
        <title>LVM</title>
    </head>
    <body>

        <a href="index.html">Tools Index</a>

        <h1>LVM</h1>

        <p>Read <a href="https://raid.wiki.kernel.org/index.php/RAID_setup">Raid Setup</a>,
        the only thing you will need outside system is:
        "Patience, Pizza, and your favorite caffeinated beverage.".
        <a href="https://wiki.archlinux.org/index.php/Software_RAID_and_LVM">Arch Wiki</a>
        article about Sofware RAID and LVM.</p>

        <p>LVM or Logic Volume Manager bring one more layer, read
        <a href="http://www.tuxradar.com/content/lvm-made-easy">Lvm made easy</a>.
        Partitions under lvm are easy to be resized, moved and there is
        a tool to help encrypt. There is more freedom to name physical
        disk names exp; production, development, backups...</p>


        <p>Basic idea behind RAID is to deal with independent disks
        as an array of drives. Raid 0 uses two or more disks as one,
        with performance gains without fault-tolerance. From raid 1
        to 6 they offer diferent fault tolerance mechanisms.</p>


        <p>Until now "from install" there is only one partition,
        it is good idea to have a system with diferent partitions for each
        propos. If is a "fresh install";</p>

        <pre>
        # cd /iso/crux/opt/
        # pkgadd lvm2#2.02.107-1.pkg.tar.xz
        #
        </pre>

        <h2 id="lvmpart">1. LVM Partition</h2>

        <p>There is no need to create a partition with fdisk or parted
        if all device will be used for lvm, just <a href="#pv">pvcreate</a>
        against the device (pvcreate /dev/sda).</p>

        <p>Create a LVM partition with parted;</p>

        <pre>
        parted --script ${DEV} \
                unit mib \
                mkpart primary 1000 4000 \
                set 1 lvm on
        </pre>

        <h2 id="pv">2. Create physical volume</h2>

        <pre>
         # pvcreate /dev/sdb3
          Physical volume "/dev/sdb3" successfully created
        </pre>

        <h2 id="vg">3. Create volume group</h2>

        <pre>
        # vgcreate vg_system /dev/sdb3
          Volume group "vg_system" successfully created
        # vgcreate homevg /dev/sdb4
          Volume group "homevg" successfully created
        #
        </pre>

        <h3>3.1. Search Volume Groups</h3>

        <pre>
        # vgscan
          Reading all physical volumes.  This may take a while...
          Found volume group "homevg" using metadata type lvm2
          Found volume group "vg_system" using metadata type lvm2
        #
        </pre>

        <h2 id="lv">4. Create logical volume</h2>

        <pre>
        # lvcreate -L 15G -n distfileslv vg_system
          Logical volume "distfileslv" created.
        # lvcreate -L 8G -n packageslv vg_system
          Logical volume "packageslv" created.
        # lvcreate -L 4G -n swaplv vg_system
          Logical volume "swaplv" created.
        # lvcreate -L 80G -n homelv homevg
          Logical volume "homelv" created.
        #
        </pre>

        <pre>
        # mkfs.ext4 /dev/vg_system/distfileslv
        # mkfs.ext4 /dev/vg_system/packageslv
        # mkswap /dev/vg_system/swaplv
        # mkfs.ext4 /dev/homevg/homelv
        </pre>

        <h3>4.1. Activate Deactivate</h3>

        <p>Deactivate logical volumes;</p>

        <pre>
        # lvchange -a -n /dev/vg_system/packageslv
        # lvchange -a -n /dev/vg_system/distfileslv
        # swapoff /dev/vg_system/sawplv
        # lvchange -a -n /dev/vg_system/swaplv
        </pre>

        <p>Deactivate volume group;</p>

        <pre>
         # vgchange -a n vg_system
         0 logical volume(s) in volume group "vg_system" now active
         #
        </pre>

        <p>Activate volume group;</p>
        <pre>
        # vgchange -a y vg_system
          3 logical volume(s) in volume group "vg_system" now active
        #
        </pre>

        <h2 id="fsck">5. Maintenance</h2>

        <h3 id="resize">Resize</h3>

        <p>First umount all lvm partitions;</p>

        <pre>
        # pvs
        </pre>

        <pre>
        # pvresize /dev/sdb
        </pre>

        <pre>
        # vgs
        </pre>

        <pre>
        # lvresize --resizefs --size +25GB /dev/mapper/vg_system-lv_ports
        </pre>

        <pre>
        # vgs
        </pre>

        <h2 id="encrypt">7. Encryption</h2>

        <a href="index.html">Tools Index</a>
        <p>
        This is part of the LeetIO System Documentation.
        Copyright (C) 2021
        LeetIO Team.
        See the file <a href="../fdl-1.3-standalone.html">Gnu Free Documentation License</a>
        for copying conditions.</p>
    </body>
</html>