From: Alan McKinnon <alan.mckinnon@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] LVM for data drives but not the OS
Date: Fri, 8 Apr 2011 23:23:20 +0200 [thread overview]
Message-ID: <201104082323.20677.alan.mckinnon@gmail.com> (raw)
In-Reply-To: <4D9F779B.2040801@gmail.com>
Apparently, though unproven, at 23:01 on Friday 08 April 2011, Dale did opine
thusly:
> Dale wrote:
> > root@fireball / # pvcreate /dev/sdb
> >
> > Physical volume "/dev/sdb" successfully created
> >
> > root@fireball / #
> >
> > Step one done. It didn't puke on my keyboard. lol
> >
> > Now to see what else I can get into. Not going to put anything
> > important on it tho. Just a temporary thing right now. Just getting
> > my feet wet.
> >
> > Dale
> >
> > :-) :-)
>
> More progress.
>
> root@fireball / # ls -al /dev/mapper/
> total 0
> drwxr-xr-x 2 root root 80 Apr 8 15:56 .
> drwxr-xr-x 16 root root 4400 Apr 8 15:56 ..
> crw-rw---- 1 root root 10, 236 Apr 8 04:39 control
> lrwxrwxrwx 1 root root 7 Apr 8 15:56 sdb--vg-test -> ../dm-0
> root@fireball / # pvdisplay
> --- Physical volume ---
> PV Name /dev/sdb
> VG Name sdb-vg
> PV Size 232.83 GiB / not usable 2.58 MiB
> Allocatable yes
> PE Size 4.00 MiB
> Total PE 59604
> Free PE 46804
> Allocated PE 12800
> PV UUID kopUKm-lXy1-7tiq-FuQ2-Xhs5-tGqN-Ls4R1v
>
> root@fireball / # vgdisplay
> --- Volume group ---
> VG Name sdb-vg
> System ID
> Format lvm2
> Metadata Areas 1
> Metadata Sequence No 2
> VG Access read/write
> VG Status resizable
> MAX LV 0
> Cur LV 1
> Open LV 0
> Max PV 0
> Cur PV 1
> Act PV 1
> VG Size 232.83 GiB
> PE Size 4.00 MiB
> Total PE 59604
> Alloc PE / Size 12800 / 50.00 GiB
> Free PE / Size 46804 / 182.83 GiB
> VG UUID 5OSiWZ-rWza-uKJ2-rVMO-f38G-NBHx-dmAE1K
>
> root@fireball / # lvdisplay
> --- Logical volume ---
> LV Name /dev/sdb-vg/test
> VG Name sdb-vg
> LV UUID mixhOb-La6D-BwG4-Uz3l-P0ci-oGg5-YI3mN8
> LV Write Access read/write
> LV Status available
> # open 0
> LV Size 50.00 GiB
> Current LE 12800
> Segments 1
> Allocation inherit
> Read ahead sectors auto
> - currently set to 256
> Block device 254:0
>
> root@fireball / #
>
> I'm still trying to figure out how the naming part works tho. Now to
> mount it and put something on it. See if it works.
Naming can vary a lot depending on udev rules. There will be one canonical
name and one or more other things that symlink to it.
Likely the canonical stuff will be /dev/mapper/.....
and the symlinks will be in /dev/sdb-vg/.....
cd and ls will see you right :-)
> Let me know if something doesn't look right. Otherwise, I'll keep
> playing around with it.
Cool. So now you have a 250G PV, and it's the the only PV in it's volume
group. You've made a 50G LV called "test"
Cool so far. Now make a few more LVs (check the man pages, I'm doing this from
memory):
lvcreate -L 20G -n test2 sdb-vg
lvcreate -L 30G -n test3 sdb-vg
mkfs them:
mkfs.<your_choice> /dev/sdb-vg/test{,2,3}
mount points:
mkdir /mnt/test{,2,3}
mount them:
mount /dev/sdb-vg/test /mnt/test
Whoop-dee-doo. Now you can copy stuff there and do whatever you do with
filesystems. Let's assume you have music on the first one "test". Let's also
assume you get more music and it's more than 50G; say you need another 20.
Easy-peasy, grow the filesystem, grow the LV:
lvextend -L +20G /dev/sdb-vg/test
resize2fs /dev/sdb-vg/test
That's it. Nothing more. Without LVM, you'd be off down to the 'puter store
looking to buy 70 CDs to do that :-)
It's important to remember that once you've made /dev/sdb into a PV, you will
never touch that device again. You will especially never fdisk or mkfs it -
all that is done on the block device that LVM gives you - /dev/sdb-vg/test
--
alan dot mckinnon at gmail dot com
next prev parent reply other threads:[~2011-04-08 21:25 UTC|newest]
Thread overview: 74+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-07 10:22 [gentoo-user] LVM for data drives but not the OS Dale
2011-04-07 10:49 ` Joost Roeleveld
2011-04-07 11:12 ` Dale
2011-04-07 12:09 ` Joost Roeleveld
2011-04-07 11:19 ` Neil Bothwick
2011-04-07 11:28 ` Dale
2011-04-07 11:39 ` Neil Bothwick
2011-04-07 12:49 ` Dale
2011-04-07 13:03 ` Joost Roeleveld
2011-04-07 13:04 ` Neil Bothwick
2011-04-07 13:21 ` Joost Roeleveld
2011-04-07 13:31 ` Neil Bothwick
2011-04-07 13:41 ` Joost Roeleveld
2011-04-07 13:52 ` Joost Roeleveld
2011-04-07 14:11 ` Dale
2011-04-07 14:41 ` Joost Roeleveld
2011-04-07 13:57 ` Dale
2011-04-07 14:33 ` Joost Roeleveld
2011-04-08 16:25 ` Dale
2011-04-08 16:46 ` Alan McKinnon
2011-04-08 17:39 ` Dale
2011-04-08 18:38 ` Alan McKinnon
2011-04-08 19:05 ` Dale
2011-04-08 21:01 ` Dale
2011-04-08 21:13 ` J. Roeleveld
2011-04-08 21:30 ` Dale
2011-04-09 12:46 ` Joost Roeleveld
2011-04-09 13:00 ` Dale
2011-04-09 13:13 ` Neil Bothwick
2011-04-08 21:23 ` Alan McKinnon [this message]
2011-04-08 22:00 ` Neil Bothwick
2011-04-08 23:36 ` Dale
2011-04-09 5:28 ` Dale
2011-04-09 12:51 ` Joost Roeleveld
2011-04-09 13:04 ` Dale
2011-04-09 19:33 ` Joost Roeleveld
2011-04-09 8:52 ` Neil Bothwick
2011-04-09 9:43 ` Peter Humphrey
2011-04-09 10:01 ` Neil Bothwick
2011-04-09 10:41 ` Dale
2011-04-09 10:48 ` Dale
2011-04-09 11:19 ` Alan McKinnon
2011-04-09 11:43 ` Dale
2011-04-09 12:53 ` Joost Roeleveld
2011-04-09 13:33 ` Dale
2011-04-09 16:01 ` Thanasis
2011-04-09 16:22 ` Mark Knecht
2011-04-09 13:11 ` Alan McKinnon
2011-04-09 10:36 ` Dale
2011-04-08 21:57 ` Neil Bothwick
2011-04-07 18:31 ` Peter Humphrey
2011-04-07 13:20 ` BRM
2011-04-07 13:30 ` Joost Roeleveld
2011-04-07 13:52 ` BRM
2011-04-07 14:14 ` Joost Roeleveld
2011-04-07 17:31 ` BRM
2011-04-07 17:50 ` J. Roeleveld
2011-04-07 18:35 ` BRM
2011-04-07 19:38 ` Joost Roeleveld
2011-04-08 10:42 ` Dale
2011-04-08 11:26 ` Neil Bothwick
2011-04-08 13:40 ` Dale
2011-04-08 13:59 ` Alan McKinnon
2011-04-08 14:06 ` Mark Knecht
2011-04-08 14:23 ` Joost Roeleveld
2011-04-08 14:45 ` Dale
2011-04-08 15:13 ` Joost Roeleveld
2011-04-08 15:27 ` Dale
2011-04-08 11:41 ` Joost Roeleveld
2011-04-07 11:29 ` Alex Schuster
2011-04-09 2:58 ` Mark Shields
[not found] <gEUDo-72k-19@gated-at.bofh.it>
[not found] ` <gEVzt-b2-39@gated-at.bofh.it>
[not found] ` <gEVJ8-ou-21@gated-at.bofh.it>
2011-04-07 12:15 ` Gregory Shearman
2011-04-07 12:41 ` Dale
[not found] ` <gF1ES-22O-19@gated-at.bofh.it>
[not found] ` <gF2hz-3ba-17@gated-at.bofh.it>
[not found] ` <gF3nk-50O-23@gated-at.bofh.it>
[not found] ` <gFhqh-3wh-3@gated-at.bofh.it>
[not found] ` <gFicG-4Ul-7@gated-at.bofh.it>
[not found] ` <gFkev-8r9-27@gated-at.bofh.it>
2011-04-08 15:15 ` David W Noon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201104082323.20677.alan.mckinnon@gmail.com \
--to=alan.mckinnon@gmail.com \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox