Re: [DRBD-user] Updating Kernel w/out Updating DRBD

2018-06-23 Thread Eric Robinson
> On Fri, Jun 22, 2018 at 02:21:10PM +, Eric Robinson wrote:
> > > > Also, I find it odd that the option to build from source is only
> > > > in the DRBD 8.3 User Guide and was left out of the 8.4 and 9.X
> > > > User Guides. (I'm sure the reason is obvious to everyone else I
> > > > just missed
> > > > something.)
> > >
> > > As I maintain parts of the build system and the documentation
> > > framework I can answer that (happened at least once here on the ML):
> > >
> > > - If information is in the UG and is wrong, it is a bug.
> > > - Documenting all possible build flavors for all distributions we
> > >   support is too much maintenance work. Looking at the build system and
> > >   the various hacks we need for outdated distributions (especially the
> > >   rpm ones with different and broken macros), that would fill pages in
> > >   the UG to *really* get it right. And I'm reluctant to accept patches
> > >   for "the general case", it always outdates and needs maintenance for
> > >   basically no gain. If you need (special kinds of) packages, you are a)
> > >   clever enough to figure it out on your own, or b) you let somebody
> > >   else figure that out for you. Thanks to Veith for his great summary,
> > >   we as LINBIT obviously also provide all kinds of packages for various
> > >   kinds of distributions for our customers.
> > >
> > > Regards, rck
> >
> > Thanks for the clarification. May I suggest that a brief comment such
> > as you provided above would be an excellent addition to the UG? Since
> > the build instructions have always worked for me for the past twelve
> > years, it threw me for a loop when they silently disappeared from the
> > 8.4 and 9.X user guides. I was constantly wondering if I was doing
> > something wrong by using the old instructions as a guideline.
> >
> 
> Fair enough, I put it on the TODO list for the UGs.
> 
> Regards, rck

Thank you very much!

--Eric


___
drbd-user mailing list
drbd-user@lists.linbit.com
http://lists.linbit.com/mailman/listinfo/drbd-user


Re: [DRBD-user] Updating Kernel w/out Updating DRBD

2018-06-22 Thread Eric Robinson
> > Also, I find it odd that the option to build from source is only in
> > the DRBD 8.3 User Guide and was left out of the 8.4 and 9.X User
> > Guides. (I'm sure the reason is obvious to everyone else I just missed
> > something.)
> 
> As I maintain parts of the build system and the documentation framework I can
> answer that (happened at least once here on the ML):
> 
> - If information is in the UG and is wrong, it is a bug.
> - Documenting all possible build flavors for all distributions we
>   support is too much maintenance work. Looking at the build system and
>   the various hacks we need for outdated distributions (especially the
>   rpm ones with different and broken macros), that would fill pages in
>   the UG to *really* get it right. And I'm reluctant to accept patches
>   for "the general case", it always outdates and needs maintenance for
>   basically no gain. If you need (special kinds of) packages, you are a)
>   clever enough to figure it out on your own, or b) you let somebody
>   else figure that out for you. Thanks to Veith for his great summary,
>   we as LINBIT obviously also provide all kinds of packages for various
>   kinds of distributions for our customers.
> 
> Regards, rck

Thanks for the clarification. May I suggest that a brief comment such as you 
provided above would be an excellent addition to the UG? Since the build 
instructions have always worked for me for the past twelve years, it threw me 
for a loop when they silently disappeared from the 8.4 and 9.X user guides. I 
was constantly wondering if I was doing something wrong by using the old 
instructions as a guideline. 

--Eric
 

___
drbd-user mailing list
drbd-user@lists.linbit.com
http://lists.linbit.com/mailman/listinfo/drbd-user


Re: [DRBD-user] Updating Kernel w/out Updating DRBD

2018-06-22 Thread Eric Robinson
Wow, Veit, thanks so much for taking time to provide those details!


> -Original Message-
> From: Veit Wahlich [mailto:cru.li...@zodia.de]
> Sent: Friday, June 22, 2018 3:54 AM
> To: Eric Robinson 
> Cc: drbd-user@lists.linbit.com
> Subject: RE: [DRBD-user] Updating Kernel w/out Updating DRBD
> 
> Well, I assume you are on el7 here. Adapt to other distros if required.
> 
> 1. Install dkms, for el7 it is available in EPEL:
> 
> # yum install dkms
> 
> 2. Untar the drbd tarball in /usr/src/, for drbd 8.4.11-1, you should now 
> have a
> directory /usr/src/drbd-8.4.11-1/.
> 
> 3. Create a file /usr/src/drbd-8.4.11-1/dkms.conf with this content:
> 
> PACKAGE_NAME="drbd"
> PACKAGE_VERSION="8.4.11-1"
> MAKE="make -C drbd KDIR=/lib/modules/${kernelver}/build"
> BUILT_MODULE_NAME[0]=drbd
> DEST_MODULE_LOCATION[0]=/kernel/drivers/block
> BUILT_MODULE_LOCATION[0]=drbd
> CLEAN="make -C drbd clean"
> AUTOINSTALL=yes
> 
> 4. Register drbd with dkms, so dkms knows about it:
> 
> # dkms add -m drbd -v 8.4.11-1
> 
> 5. Build the module of the desired version for the current kernel:
> 
> # dkms build -m drbd -v 8.4.11-1
> 
> 6. Install the module of the desired version to the kernel's module
> tree:
> 
> # dkms install -m drbd -v 8.4.11-1
> 
> You should now be able to use drbd.
> 
> dkms installs a hook that will automatically rebuild the module once you 
> install
> a new kernel{,-devel} package.
> On rpm-based distros (maybe also others, I have not tested) and depending on
> configuration, dkms also builds rpms for the new kmods, so all files dkms 
> writes
> are being registered with the package management.
> 
> If you want to remove a dkms installed module, you may simply use:
> 
> # dkms remove -m drbd -v 8.4.11-1 --all
> 
> --all removes the module from all kernel module trees.
> 
> Starting with drbd 9.0, the source tarball also includes an almost ready to 
> use
> dkms.conf file in the debian/ subdir. It is not specific to Debian. May may 
> want
> to copy it to .. and edit the module version number.
> Please note that drbd 9.0 has 2 kernel module files (dkms.ko and
> drbd_transport_tcp.ko) and the module source changed to src/drbd/, so with
> drbd 9.0 use the the dkms.conf file provided with the tarball instead of my
> example dkms.conf above.
> 
> Best regards,
> // Veit
> 
> 
> Am Freitag, den 22.06.2018, 08:43 + schrieb Eric Robinson:
> > I'm familiar with the --with-km switch when building drbd, but I don't see
> anything in the documentation that allows building an akmod or dkms version
> instead. How would I do that?
> >
> > Also, I find it odd that the option to build from source is only in
> > the DRBD 8.3 User Guide and was left out of the 8.4 and 9.X User
> > Guides. (I'm sure the reason is obvious to everyone else I just missed
> > something.)
> >
> > --Eric
> 
> 

___
drbd-user mailing list
drbd-user@lists.linbit.com
http://lists.linbit.com/mailman/listinfo/drbd-user


Re: [DRBD-user] Updating Kernel w/out Updating DRBD

2018-06-22 Thread Roland Kammerer
On Fri, Jun 22, 2018 at 02:21:10PM +, Eric Robinson wrote:
> > > Also, I find it odd that the option to build from source is only in
> > > the DRBD 8.3 User Guide and was left out of the 8.4 and 9.X User
> > > Guides. (I'm sure the reason is obvious to everyone else I just missed
> > > something.)
> > 
> > As I maintain parts of the build system and the documentation framework I 
> > can
> > answer that (happened at least once here on the ML):
> > 
> > - If information is in the UG and is wrong, it is a bug.
> > - Documenting all possible build flavors for all distributions we
> >   support is too much maintenance work. Looking at the build system and
> >   the various hacks we need for outdated distributions (especially the
> >   rpm ones with different and broken macros), that would fill pages in
> >   the UG to *really* get it right. And I'm reluctant to accept patches
> >   for "the general case", it always outdates and needs maintenance for
> >   basically no gain. If you need (special kinds of) packages, you are a)
> >   clever enough to figure it out on your own, or b) you let somebody
> >   else figure that out for you. Thanks to Veith for his great summary,
> >   we as LINBIT obviously also provide all kinds of packages for various
> >   kinds of distributions for our customers.
> > 
> > Regards, rck
> 
> Thanks for the clarification. May I suggest that a brief comment such
> as you provided above would be an excellent addition to the UG? Since
> the build instructions have always worked for me for the past twelve
> years, it threw me for a loop when they silently disappeared from the
> 8.4 and 9.X user guides. I was constantly wondering if I was doing
> something wrong by using the old instructions as a guideline. 
> 

Fair enough, I put it on the TODO list for the UGs.

Regards, rck
___
drbd-user mailing list
drbd-user@lists.linbit.com
http://lists.linbit.com/mailman/listinfo/drbd-user


Re: [DRBD-user] Updating Kernel w/out Updating DRBD

2018-06-22 Thread Roland Kammerer
On Fri, Jun 22, 2018 at 08:43:32AM +, Eric Robinson wrote:
> > From: Veit Wahlich [mailto:cru.li...@zodia.de]
> > Sent: Friday, June 22, 2018 12:45 AM
> > To: Eric Robinson 
> > Cc: drbd-user@lists.linbit.com
> > Subject: Re: [DRBD-user] Updating Kernel w/out Updating DRBD
> > 
> > Hi Eric,
> > 
> > if your distro is el (e.g. RHEL/CentOS/Scientific), the kernel ABI
> > *should* not change during kernel updates, and copying modules from older
> > kernel versions as "weak updates" is not uncommon, following the slogan "old
> > module is better than no module". This is for example the case for CentOS 7
> > and worked quite well in the past, unfortunately with upgrade to 7.5 the ABI
> > changed nevertheless and caused many systems even to crash when using
> > some old modules, including drbd.
> > 
> > If you build the module on the system that runs it, you might consider
> > installing/building a dkms or akmod package of drbd instead, along with
> > dkms/akmod itself. When booting a new kernel, dkms/akmod will check
> > whether the packaged modules already exist for the running kernel, and if 
> > not,
> > they will be built and installed. This works as long as the module source 
> > builds
> > well against the kernel source/headers provided and all dependencies and 
> > build
> > tools are present.
> > 
> > Regards,
> > // Veit
> > 
> > Am Freitag, den 22.06.2018, 04:38 + schrieb Eric Robinson:
> > > Greetings -
> > >
> > > We always build drbd as a KLM, and it seems that every time we update the
> > kernel (with yum update) we have to rebuild drbd. This is probably the 
> > worlds's
> > dumbest question, but is there a way to update the kernel without having to
> > rebuild drbd every time?
> > >
> > > --Eric
> > >
> 
> 
> Also, I find it odd that the option to build from source is only in
> the DRBD 8.3 User Guide and was left out of the 8.4 and 9.X User
> Guides. (I'm sure the reason is obvious to everyone else I just missed
> something.) 

As I maintain parts of the build system and the documentation framework
I can answer that (happened at least once here on the ML):

- If information is in the UG and is wrong, it is a bug.
- Documenting all possible build flavors for all distributions we
  support is too much maintenance work. Looking at the build system and
  the various hacks we need for outdated distributions (especially the
  rpm ones with different and broken macros), that would fill pages in
  the UG to *really* get it right. And I'm reluctant to accept patches
  for "the general case", it always outdates and needs maintenance for
  basically no gain. If you need (special kinds of) packages, you are a)
  clever enough to figure it out on your own, or b) you let somebody
  else figure that out for you. Thanks to Veith for his great summary,
  we as LINBIT obviously also provide all kinds of packages for various
  kinds of distributions for our customers.

Regards, rck
___
drbd-user mailing list
drbd-user@lists.linbit.com
http://lists.linbit.com/mailman/listinfo/drbd-user


Re: [DRBD-user] Updating Kernel w/out Updating DRBD

2018-06-22 Thread Veit Wahlich
Well, I assume you are on el7 here. Adapt to other distros if required.

1. Install dkms, for el7 it is available in EPEL:

# yum install dkms

2. Untar the drbd tarball in /usr/src/, for drbd 8.4.11-1, you should
now have a directory /usr/src/drbd-8.4.11-1/.

3. Create a file /usr/src/drbd-8.4.11-1/dkms.conf with this content:

PACKAGE_NAME="drbd"
PACKAGE_VERSION="8.4.11-1"
MAKE="make -C drbd KDIR=/lib/modules/${kernelver}/build"
BUILT_MODULE_NAME[0]=drbd
DEST_MODULE_LOCATION[0]=/kernel/drivers/block
BUILT_MODULE_LOCATION[0]=drbd
CLEAN="make -C drbd clean"
AUTOINSTALL=yes

4. Register drbd with dkms, so dkms knows about it:

# dkms add -m drbd -v 8.4.11-1

5. Build the module of the desired version for the current kernel:

# dkms build -m drbd -v 8.4.11-1

6. Install the module of the desired version to the kernel's module
tree:

# dkms install -m drbd -v 8.4.11-1

You should now be able to use drbd.

dkms installs a hook that will automatically rebuild the module once you
install a new kernel{,-devel} package.
On rpm-based distros (maybe also others, I have not tested) and
depending on configuration, dkms also builds rpms for the new kmods, so
all files dkms writes are being registered with the package management.

If you want to remove a dkms installed module, you may simply use:

# dkms remove -m drbd -v 8.4.11-1 --all

--all removes the module from all kernel module trees.

Starting with drbd 9.0, the source tarball also includes an almost ready
to use dkms.conf file in the debian/ subdir. It is not specific to
Debian. May may want to copy it to .. and edit the module version
number.
Please note that drbd 9.0 has 2 kernel module files (dkms.ko and
drbd_transport_tcp.ko) and the module source changed to src/drbd/, so
with drbd 9.0 use the the dkms.conf file provided with the tarball
instead of my example dkms.conf above.

Best regards,
// Veit


Am Freitag, den 22.06.2018, 08:43 + schrieb Eric Robinson:
> I'm familiar with the --with-km switch when building drbd, but I don't see 
> anything in the documentation that allows building an akmod or dkms version 
> instead. How would I do that?
> 
> Also, I find it odd that the option to build from source is only in the DRBD 
> 8.3 User Guide and was left out of the 8.4 and 9.X User Guides. (I'm sure the 
> reason is obvious to everyone else I just missed something.) 
> 
> --Eric



___
drbd-user mailing list
drbd-user@lists.linbit.com
http://lists.linbit.com/mailman/listinfo/drbd-user


Re: [DRBD-user] Updating Kernel w/out Updating DRBD

2018-06-22 Thread Eric Robinson
> From: Veit Wahlich [mailto:cru.li...@zodia.de]
> Sent: Friday, June 22, 2018 12:45 AM
> To: Eric Robinson 
> Cc: drbd-user@lists.linbit.com
> Subject: Re: [DRBD-user] Updating Kernel w/out Updating DRBD
> 
> Hi Eric,
> 
> if your distro is el (e.g. RHEL/CentOS/Scientific), the kernel ABI
> *should* not change during kernel updates, and copying modules from older
> kernel versions as "weak updates" is not uncommon, following the slogan "old
> module is better than no module". This is for example the case for CentOS 7
> and worked quite well in the past, unfortunately with upgrade to 7.5 the ABI
> changed nevertheless and caused many systems even to crash when using
> some old modules, including drbd.
> 
> If you build the module on the system that runs it, you might consider
> installing/building a dkms or akmod package of drbd instead, along with
> dkms/akmod itself. When booting a new kernel, dkms/akmod will check
> whether the packaged modules already exist for the running kernel, and if not,
> they will be built and installed. This works as long as the module source 
> builds
> well against the kernel source/headers provided and all dependencies and build
> tools are present.
> 
> Regards,
> // Veit
> 
> Am Freitag, den 22.06.2018, 04:38 + schrieb Eric Robinson:
> > Greetings -
> >
> > We always build drbd as a KLM, and it seems that every time we update the
> kernel (with yum update) we have to rebuild drbd. This is probably the 
> worlds's
> dumbest question, but is there a way to update the kernel without having to
> rebuild drbd every time?
> >
> > --Eric
> >


I'm familiar with the --with-km switch when building drbd, but I don't see 
anything in the documentation that allows building an akmod or dkms version 
instead. How would I do that?

Also, I find it odd that the option to build from source is only in the DRBD 
8.3 User Guide and was left out of the 8.4 and 9.X User Guides. (I'm sure the 
reason is obvious to everyone else I just missed something.) 

--Eric


___
drbd-user mailing list
drbd-user@lists.linbit.com
http://lists.linbit.com/mailman/listinfo/drbd-user


Re: [DRBD-user] Updating Kernel w/out Updating DRBD

2018-06-22 Thread Veit Wahlich
Hi Eric,

if your distro is el (e.g. RHEL/CentOS/Scientific), the kernel ABI
*should* not change during kernel updates, and copying modules from
older kernel versions as "weak updates" is not uncommon, following the
slogan "old module is better than no module". This is for example the
case for CentOS 7 and worked quite well in the past, unfortunately with
upgrade to 7.5 the ABI changed nevertheless and caused many systems even
to crash when using some old modules, including drbd.

If you build the module on the system that runs it, you might consider
installing/building a dkms or akmod package of drbd instead, along with
dkms/akmod itself. When booting a new kernel, dkms/akmod will check
whether the packaged modules already exist for the running kernel, and
if not, they will be built and installed. This works as long as the
module source builds well against the kernel source/headers provided and
all dependencies and build tools are present.

Regards,
// Veit

Am Freitag, den 22.06.2018, 04:38 + schrieb Eric Robinson:
> Greetings -
> 
> We always build drbd as a KLM, and it seems that every time we update the 
> kernel (with yum update) we have to rebuild drbd. This is probably the 
> worlds's dumbest question, but is there a way to update the kernel without 
> having to rebuild drbd every time?
> 
> --Eric
> 
> 
> 
> 
> 
> ___
> drbd-user mailing list
> drbd-user@lists.linbit.com
> http://lists.linbit.com/mailman/listinfo/drbd-user


___
drbd-user mailing list
drbd-user@lists.linbit.com
http://lists.linbit.com/mailman/listinfo/drbd-user