Re: [gentoo-user] Kernel does not boot after adding a new SATA drive

2016-09-07 Thread Neil Bothwick
On Wed, 7 Sep 2016 09:22:59 +0300, gevisz wrote:

> After many attempts, I finally managed to boot with the new drive
> attached manually editing the above entry in /boot/grub/grub.cfg
> 1) deleting the root=UUID=44*** part of its line (which probably means
> that adding GRUB_CMDLINE_LINUX="root=UUID=44***" line to
> the /etc/default/grub was a bad idea :),
>  2) changing in the same last line sdb3 to sdc3, and

Which is fine, until you next run grub-mkconfig. As Mike said, if you use
an initramfs, GRUB will then use UUIDs, avoiding all this.

Another possibility is that your new drive is connected to a lower
numbered SATA port, which is why it jumps in front of the old drive in the
device allocation. Connecting your boot drive to the lowest numbered
port may avoid future queue-jumping.


-- 
Neil Bothwick

Accordion: a bagpipe with pleats.


pgpm6tbZTwia5.pgp
Description: OpenPGP digital signature


Re: [gentoo-user] Kernel does not boot after adding a new SATA drive

2016-09-07 Thread Rich Freeman
On Tue, Sep 6, 2016 at 11:36 PM, Mike Gilbert  wrote:
>
> grub-mkconfig is not finding an initramfs, as evidenced by the lack of
> an "initrd" in in grub.cfg.
>
> If it is unable to find an initramfs, it will always output
> root=/dev/sdX instead of root=UUID=...
>

For whatever reason the three subsequent replies to this list ignored
the actual explanation of the cause of the problems, which was this
(not uncommon on this list it seems).

This is also why it is helpful to post actual config files when you
have problems.  The lines you consider most relevant aren't
necessarily the ones containing the clues.

When root=UUID=... was added manually to the command line, then the
kernel refused to boot at all, because the kernel itself doesn't
understand that syntax.

So, the next question becomes, how are you generating an initramfs,
and how is it named?  Pasting the output of "ls /boot" might be
helpful here.

-- 
Rich



[gentoo-user] Re: [Solved but ...] Kernel does not boot after adding a new SATA drive

2016-09-07 Thread gevisz
2016-09-07 11:40 GMT+03:00 Neil Bothwick :
> On Wed, 7 Sep 2016 09:22:59 +0300, gevisz wrote:
>
>> After many attempts, I finally managed to boot with the new drive
>> attached manually editing the above entry in /boot/grub/grub.cfg
>> 1) deleting the root=UUID=44*** part of its line (which probably means
>> that adding GRUB_CMDLINE_LINUX="root=UUID=44***" line to
>> the /etc/default/grub was a bad idea :),
>>  2) changing in the same last line sdb3 to sdc3, and
>
> Which is fine, until you next run grub-mkconfig. As Mike said, if you use
> an initramfs, GRUB will then use UUIDs, avoiding all this.

It used it anyway, but cannot find a boot partion by the UUID
if the order of hard disks has been changed.

> Another possibility is that your new drive is connected to a lower
> numbered SATA port, which is why it jumps in front of the old drive in the
> device allocation. Connecting your boot drive to the lowest numbered
> port may avoid future queue-jumping.

Exactly! Now, I see the problem as follows:

When I connected a new SATA disk to the SATA controller, the order of
hard disks during the boot time changed because the new disk "jumpt
in front" of the boot drive. As the result, the GRUB could not find the
boot partition by its UUID on the "wrong" non-boot drive and gave up,
without trying to look for the boot partition on other hard drives!

When I connected the new hard disk after the boot, it (predictably)
did not "jumped in front" of other hard disks. So, doing
# grub-mkconfig -o /boot/grub/grub.cfg, creating a new initramfs,
etc, did not helped the GRUB to boot the system next time...

Only after I managed to boot the system manually editing the GRUB
menu entry during the boot time and the system booted with the new
hard disk that in this case took its "usual" order and then run
# grub-mkconfig -o /boot/grub/grub.cfg, the problem has been "solved."

Here, I am writing the "solved" in quotes because it has been solved
only for me and only on this computer: next time, when I or someone
else will add a new disk to any linux computer the problem may appear
again.

So, the question remains: why not to desing the GRUB in such a way
that it could look for the boot partition by its UUID on any available
hard drives?



Re: [gentoo-user] Kernel does not boot after adding a new SATA drive

2016-09-07 Thread gevisz
2016-09-07 12:36 GMT+03:00 Rich Freeman :
> On Tue, Sep 6, 2016 at 11:36 PM, Mike Gilbert  wrote:
>>
>> grub-mkconfig is not finding an initramfs, as evidenced by the lack of
>> an "initrd" in in grub.cfg.
>>
>> If it is unable to find an initramfs, it will always output
>> root=/dev/sdX instead of root=UUID=...
>>
>
> For whatever reason the three subsequent replies to this list ignored
> the actual explanation of the cause of the problems, which was this
> (not uncommon on this list it seems).
>
> This is also why it is helpful to post actual config files when you
> have problems.  The lines you consider most relevant aren't
> necessarily the ones containing the clues.
>
> When root=UUID=... was added manually to the command line, then the
> kernel refused to boot at all, because the kernel itself doesn't
> understand that syntax.

Yes, when the "root=UUID=***" has been added manually to /etc/default/grub
in the wrong way, it appeared in the GRUB menu entry in the wrong way that
stopped GRUB from booting in any case...

> So, the next question becomes, how are you generating an initramfs,
> and how is it named?  Pasting the output of "ls /boot" might be
> helpful here.

I generate initramfs by
# genkernel --install initramfs
and the rename it to match the name of the kernel, eg,
initramfs-4.4.6-gentoo
vmlinuz-4.4.6-gentoo

But I think that this is unrelevant to the problem because of the following
explanation I have just posted. (If I am wrong here, please, let me know
and I will post all the conf files you will ask.)

When I connected a new SATA disk to the SATA controller, the order of
hard disks during the boot time changed because the new disk "jumpt
in front" of the boot drive. As the result, the GRUB could not find the
boot partition by its UUID on the "wrong" non-boot drive and gave up,
without even trying to look for the boot partition by its UUID on other
hard drives!

When I connected the new hard disk after the boot, it (predictably)
did not "jumped in front" of other hard disks. So, doing
# grub-mkconfig -o /boot/grub/grub.cfg, creating a new initramfs,
etc, did not helped the GRUB to boot the system next time...

Only after I managed to boot the system manually editing the GRUB
menu entry during the boot time and the system booted with the new
hard disk connected, that in this case took its "usual" order, and then run
# grub-mkconfig -o /boot/grub/grub.cfg, the problem has been "solved."

Here, I am writing the "solved" in quotes because it has been solved
only for me and only on this computer: next time, when I or someone
else will add a new disk to any linux computer the problem may appear
again.

So, the question remains: why not to desing the GRUB in such a way
that it could look for the boot partition by its UUID on any available
hard drives?



Re: [gentoo-user] Kernel does not boot after adding a new SATA drive

2016-09-07 Thread Raffaele BELARDI
gevisz wrote:
> So, the question remains: why not to desing the GRUB in such a way
> that it could look for the boot partition by its UUID on any available
> hard drives?

Why don't you ask to the GRUB designers? This is a GENTOO mailing list.

raffaele

Re: [gentoo-user] Re: help! IP blocking not working

2016-09-07 Thread Grant
>>> Hi, my site is being ravaged by an IP but dropping the IP via
>>> shorewall is seeming to have no effect.  I'm using his IP from nginx
>>> logs.  IP blocking in shorewall has always worked before.  What could
>>> be happening?
>>
>>
>> I'm blocking like this with the firewall running on the web server:
>>
>> /etc/shorewall/rules
>> DROPnet:1.2.3.4  $FW
>>
>> Could shorewall/iptables see a different IP address than the one seen by 
>> nginx?
>
>
> Most likely the file is configured but the firewall service wasn't
> restarted or the rules no loaded.


I restarted shorewall plenty.  :)  I believe the issue was either a
persistent connection which conntrack-tools would have allowed me to
flush, or my blocking in /etc/shorewall/rules instead of
/etc/shorewall/blrules, or both.


> But as Jeremi pointed out. failsban is a far superior tool for this.
> Ossec with it's active response is also good.
> There are quite a few more tools in this space, and they all work much
> the same way - scan logs looking for dodgy stuff going on the
> dynamically apply a packet filter rule. The software also does it all
> day every day, and that's a record you the human cannot hope to match :-)


I'm happy to say fail2ban is running now:

# fail2ban-client status
Status
|- Number of jail: 10
`- Jail list: nginx-botsearch, nginx-http-auth, nginx-limit-req,
pam-generic, php-url-fopen, postfix, postfix-rbl, postfix-sasl, sshd,
sshd-ddos

I should probably play with the config a bit.  I'm pretty much using
defaults.  For example I think the sshd hackers make their attempts
really slowly but it would be nice to ban them anyway:

# fail2ban-client status sshd
Status for the jail: sshd
|- Filter
|  |- Currently failed: 2
|  |- Total failed: 58
|  `- File list: /var/log/sshd/current
`- Actions
   |- Currently banned: 0
   |- Total banned: 3
   `- Banned IP list:

Also I wish fail2ban-client would display a tally of all fails and
bans with a single command.

- Grant



Re: [gentoo-user] Kernel does not boot after adding a new SATA drive

2016-09-07 Thread Rich Freeman
On Wed, Sep 7, 2016 at 7:57 AM, gevisz  wrote:
> 2016-09-07 12:36 GMT+03:00 Rich Freeman :
>> On Tue, Sep 6, 2016 at 11:36 PM, Mike Gilbert  wrote:
>>>
>>> grub-mkconfig is not finding an initramfs, as evidenced by the lack of
>>> an "initrd" in in grub.cfg.
>>>
>>> If it is unable to find an initramfs, it will always output
>>> root=/dev/sdX instead of root=UUID=...
>>>
>>
>> For whatever reason the three subsequent replies to this list ignored
>> the actual explanation of the cause of the problems, which was this
>> (not uncommon on this list it seems).
>>
>> When root=UUID=... was added manually to the command line, then the
>> kernel refused to boot at all, because the kernel itself doesn't
>> understand that syntax.
>
> Yes, when the "root=UUID=***" has been added manually to /etc/default/grub
> in the wrong way, it appeared in the GRUB menu entry in the wrong way that
> stopped GRUB from booting in any case...

It doesn't matter how you add root=UUID=* to the kernel command line.
The kernel doesn't understand that syntax at all.  Your initramfs
probably does.

When you don't use an initramfs (and you aren't using one, even if you
think you are), the kernel reads the value of root= and mounts it as
root.  It doesn't understand the UUID syntax.

When you do use an initramfs then the kernel ignores the root=
setting, and the initramfs reads it and mounts root.  Typically these
do understand the UUID syntax, but of course that depends on what
initramfs you're using.

>
>> So, the next question becomes, how are you generating an initramfs,
>> and how is it named?  Pasting the output of "ls /boot" might be
>> helpful here.
>
> I generate initramfs by
> # genkernel --install initramfs
> and the rename it to match the name of the kernel, eg,
> initramfs-4.4.6-gentoo
> vmlinuz-4.4.6-gentoo

And if you read /etc/grub.d/10_linux you'll see that the script
doesn't look for an initramfs with the filename initramfs-.

It will accept initramfs-.img or initramfs-genkernel-

It accepts 11 other variations of the filename, but not the one you picked.

So, grub-mkconfig doesn't think you have an initramfs, so it generated
a configuration file which:
1.  Doesn't load an initramfs (so any attempt to stick a root=UUID=*
option in there will fail).
2.  Just references the device name for root that it finds, since that
is the best it can do without an initramfs.

>
> But I think that this is unrelevant to the problem because of the following
> explanation I have just posted. (If I am wrong here, please, let me know
> and I will post all the conf files you will ask.)

No need, your filenames likely solved the problem.  Just tack a .img
on the end of that initramfs and you should be good after running
grub-mkconfig again.

>
> When I connected a new SATA disk to the SATA controller, the order of
> hard disks during the boot time changed because the new disk "jumpt
> in front" of the boot drive. As the result, the GRUB could not find the
> boot partition by its UUID on the "wrong" non-boot drive and gave up,
> without even trying to look for the boot partition by its UUID on other
> hard drives!

Grub doesn't look for boot partitions at all.  Grub just reads the
configuration file and loads the kernel (and optionally initramfs)
that it finds in grub.cfg.  In your case the grub.cfg didn't list an
initramfs, so it didn't load one.

The initramfs generated by genkernel will look for a drive by UUID,
and as long as the device exists it will probably find it.  Obviously
if you're missing a kernel module needed to access the drive that
would stop it.  However, it doesn't care what order the devices are
numbered in.

>
> So, the question remains: why not to desing the GRUB in such a way
> that it could look for the boot partition by its UUID on any available
> hard drives?
>

It already does this.  It just doesn't do it when it doesn't think
you're using an initramfs, because if it did it would make your system
unbootable, since the kernel doesn't know anything about UUIDs.

-- 
Rich



Re: [gentoo-user] Re: help! IP blocking not working

2016-09-07 Thread Rich Freeman
On Wed, Sep 7, 2016 at 9:14 AM, Grant  wrote:
 Hi, my site is being ravaged by an IP but dropping the IP via
 shorewall is seeming to have no effect.  I'm using his IP from nginx
 logs.  IP blocking in shorewall has always worked before.  What could
 be happening?
>>>
>>>
>>> I'm blocking like this with the firewall running on the web server:
>>>
>>> /etc/shorewall/rules
>>> DROPnet:1.2.3.4  $FW
>>>
>>> Could shorewall/iptables see a different IP address than the one seen by 
>>> nginx?
>>
>>
>> Most likely the file is configured but the firewall service wasn't
>> restarted or the rules no loaded.
>
>
> I restarted shorewall plenty.  :)  I believe the issue was either a
> persistent connection which conntrack-tools would have allowed me to
> flush, or my blocking in /etc/shorewall/rules instead of
> /etc/shorewall/blrules, or both.
>

What exactly is your issue?  That is, what makes you think you even
have an issue?

The reason I ask is that all iptables is going to do is drop packets
when they reach the kernel. They still go through your network and
network card and consume some CPU (even more if you're logging them).
If you're being flooded by a very large volume of packets then that
will saturate your connection and simply dropping them at the server
won't fix the latency this will cause for the good packets.  In such
an attack you need to block those packets as far upstream as you can
before connections start getting saturated.  This might be outside of
your network perimeter.  This is why DDoS attacks are so potent, if
you use something like fail2ban to just set iptables are done you're
fixing the barn doors after the horses have already left.

-- 
Rich



[gentoo-user] Wastebin or trash?

2016-09-07 Thread Peter Humphrey
Hello list,

As I said in the "emerge @system" thread, I've built a fresh ~amd64 system 
on this i7 box. I also created a new user directory for myself, copying in 
only .bash*, .gkrellm2 and .mozilla.

After spending a good long time setting up KDE and friends just the way I 
like them, the one remaining task was to set up KMail and import my 1000-or-
so messages. That worked all right, with just the one same exception as 
before: KMail's recycle bin is call "trash" in the folder list, but the 
right-click menu on it offers to "empty wastebin".

I'm sure I have all my linguas, l10ns i18ns and everything set up right, so 
I think I'm just seeing an intermediate stage in KMail development.

Is anyone else seeing this?

-- 
Rgds
Peter




Re: [gentoo-user] Re: help! IP blocking not working

2016-09-07 Thread Grant
> Hi, my site is being ravaged by an IP but dropping the IP via
> shorewall is seeming to have no effect.  I'm using his IP from nginx
> logs.  IP blocking in shorewall has always worked before.  What could
> be happening?


 I'm blocking like this with the firewall running on the web server:

 /etc/shorewall/rules
 DROPnet:1.2.3.4  $FW

 Could shorewall/iptables see a different IP address than the one seen by 
 nginx?
>>>
>>>
>>> Most likely the file is configured but the firewall service wasn't
>>> restarted or the rules no loaded.
>>
>>
>> I restarted shorewall plenty.  :)  I believe the issue was either a
>> persistent connection which conntrack-tools would have allowed me to
>> flush, or my blocking in /etc/shorewall/rules instead of
>> /etc/shorewall/blrules, or both.
>>
>
> What exactly is your issue?  That is, what makes you think you even
> have an issue?
>
> The reason I ask is that all iptables is going to do is drop packets
> when they reach the kernel. They still go through your network and
> network card and consume some CPU (even more if you're logging them).
> If you're being flooded by a very large volume of packets then that
> will saturate your connection and simply dropping them at the server
> won't fix the latency this will cause for the good packets.  In such
> an attack you need to block those packets as far upstream as you can
> before connections start getting saturated.  This might be outside of
> your network perimeter.  This is why DDoS attacks are so potent, if
> you use something like fail2ban to just set iptables are done you're
> fixing the barn doors after the horses have already left.


I said I was under attack but it was really just an unthrottled and
very greedy bot.  fail2ban would have gotten him.  But while we're on
the subject, how would you recommend thwarting a DDoS attack against a
dedicated server in a hosted environment?  Cloudflare?

- Grant



Re: [gentoo-user] Wastebin or trash?

2016-09-07 Thread Andrew Lowe

On 07/09/16 23:45, Peter Humphrey wrote:

Hello list,

As I said in the "emerge @system" thread, I've built a fresh ~amd64 system
on this i7 box. I also created a new user directory for myself, copying in
only .bash*, .gkrellm2 and .mozilla.

After spending a good long time setting up KDE and friends just the way I
like them, the one remaining task was to set up KMail and import my 1000-or-
so messages. That worked all right, with just the one same exception as
before: KMail's recycle bin is call "trash" in the folder list, but the
right-click menu on it offers to "empty wastebin".

I'm sure I have all my linguas, l10ns i18ns and everything set up right, so
I think I'm just seeing an intermediate stage in KMail development.

Is anyone else seeing this?



	I'm reading this whilst sitting in Perth, Australia so both should read 
"Rubbish Bin" or possibly "Wheelie Bin"  ;)


Andrew



Re: [gentoo-user] Wastebin or trash?

2016-09-07 Thread Mick
On Thursday 08 Sep 2016 00:47:13 Andrew Lowe wrote:
> On 07/09/16 23:45, Peter Humphrey wrote:
> > Hello list,
> > 
> > As I said in the "emerge @system" thread, I've built a fresh ~amd64 system
> > on this i7 box. I also created a new user directory for myself, copying in
> > only .bash*, .gkrellm2 and .mozilla.
> > 
> > After spending a good long time setting up KDE and friends just the way I
> > like them, the one remaining task was to set up KMail and import my
> > 1000-or- so messages. That worked all right, with just the one same
> > exception as before: KMail's recycle bin is call "trash" in the folder
> > list, but the right-click menu on it offers to "empty wastebin".
> > 
> > I'm sure I have all my linguas, l10ns i18ns and everything set up right,
> > so
> > I think I'm just seeing an intermediate stage in KMail development.
> > 
> > Is anyone else seeing this?
> 
>   I'm reading this whilst sitting in Perth, Australia so both should read
> "Rubbish Bin" or possibly "Wheelie Bin"  ;)
> 
>   Andrew

One IMAP4 account of mine shows 'Bin' and another shows 'Trash'.  As I 
understand it you need to configure the locale on the mail server.
-- 
Regards,
Mick

signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] Re: help! IP blocking not working

2016-09-07 Thread Rich Freeman
On Wed, Sep 7, 2016 at 12:39 PM, Grant  wrote:
>
> I said I was under attack but it was really just an unthrottled and
> very greedy bot.  fail2ban would have gotten him.  But while we're on
> the subject, how would you recommend thwarting a DDoS attack against a
> dedicated server in a hosted environment?  Cloudflare?
>

I'm sure there are others who have more knowledge, but in general
these probably require help outside the network.

If your ISP isn't saturated they might be able to filter out the
attack.  However, services that distribute your service across
multiple networks will almost certainly help by diluting attacks.

The whole idea of a DDoS is that all the attackers use a little
bandwidth, but as the attacks approach your site they become more and
more concentrated, so that packets in have plenty of bandwidth to make
it to your site, but your own network (and possibly your ISP's) end up
being overwhelmed.  By dispersing your service globally you force the
attackers to target more network connections, which dilutes their
bandwidth.

Put another way, one server farm running on one 100Mbps connection is
a lot easier to attack than 100 server farms globally each with a
100Mbps connection (perhaps each shared with 10,000 other sites).

-- 
Rich



Re: [gentoo-user] Re: USB crucial file recovery

2016-09-07 Thread Grant
  Is there a
 filesystem that will make that unnecessary and exhibit better
 reliability than NTFS?
>>>
>>>
>>> Yes, FAT. It works and works well.
>>> Or exFAT which is Microsoft's solution to the problem of very large
>>> files on FAT.
>>
>>
>> FAT32 won't work for me since I need to use files larger than 4GB.  I
>> know it's beta software but should exfat be more reliable than ntfs?
>
>
> It doesn't do all the fancy journalling that ntfs does, so based solely on
> complexity, it ought to be more reliable.
>
> None of us have done real tests and mentioned it here, so we really don't
> know how it pans out in the real world.
>
> Do a bunch of tests yourself and decide
>>
>>
>>> Which NTFS system are you using?
>>>
>>> ntfs kernel module? It's quite dodgy and unsafe with writes
>>> ntfs-ng on fuse? I find that one quite solid
>>
>>
>> I'm using ntfs-ng as opposed to the kernel option(s).
>
>
> I'm offering 10 to 1 odds that your problems came from a faulty USB stick,
> or maybe one that you yanked too soon


It could be failing hardware but I didn't touch the USB stick when it
freaked out.  This same thing has happened several times now with two
different USB sticks.

It sounds like I'm stuck with NTFS if I want to share the USB stick
amongst Gentoo systems without managing UUIDs and I want to work with
files larger than 4GB.  exfat is the other option but it sounds rather
unproven.

- Grant



Re: [gentoo-user] Wastebin or trash?

2016-09-07 Thread Simon Thelen
On 16-09-07 at 18:41, Mick wrote:
> On Thursday 08 Sep 2016 00:47:13 Andrew Lowe wrote:
> > On 07/09/16 23:45, Peter Humphrey wrote:
> > > Hello list,
> > > 
> > > As I said in the "emerge @system" thread, I've built a fresh ~amd64 system
> > > on this i7 box. I also created a new user directory for myself, copying in
> > > only .bash*, .gkrellm2 and .mozilla.
> > > 
> > > After spending a good long time setting up KDE and friends just the way I
> > > like them, the one remaining task was to set up KMail and import my
> > > 1000-or- so messages. That worked all right, with just the one same
> > > exception as before: KMail's recycle bin is call "trash" in the folder
> > > list, but the right-click menu on it offers to "empty wastebin".
> > > 
> > > I'm sure I have all my linguas, l10ns i18ns and everything set up right,
> > > so
> > > I think I'm just seeing an intermediate stage in KMail development.
> > > 
> > > Is anyone else seeing this?
> > 
> > I'm reading this whilst sitting in Perth, Australia so both should read
> > "Rubbish Bin" or possibly "Wheelie Bin"  ;)
> One IMAP4 account of mine shows 'Bin' and another shows 'Trash'.  As I 
> understand it you need to configure the locale on the mail server.
IMAP itself does not have a concept of "Trash", the creation of such a
mailbox is the prerogative of the client (unless the server itself feels
that the imap client doesn't know what it's doing and moves deleted
emails into a different mailbox; not that I've ever seen a mail server
do that), therefore changing the locale on the mail server won't help
and it is indeed something on the client that needs to be changed.

-- 
Simon Thelen



Re: [gentoo-user] Kernel does not boot after adding a new SATA drive

2016-09-07 Thread gevisz
2016-09-07 16:19 GMT+03:00 Rich Freeman :
> On Wed, Sep 7, 2016 at 7:57 AM, gevisz  wrote:
>> 2016-09-07 12:36 GMT+03:00 Rich Freeman :
>>> On Tue, Sep 6, 2016 at 11:36 PM, Mike Gilbert  wrote:

 grub-mkconfig is not finding an initramfs, as evidenced by the lack of
 an "initrd" in in grub.cfg.

 If it is unable to find an initramfs, it will always output
 root=/dev/sdX instead of root=UUID=...

>>>
>>> For whatever reason the three subsequent replies to this list ignored
>>> the actual explanation of the cause of the problems, which was this
>>> (not uncommon on this list it seems).
>>>
>>> When root=UUID=... was added manually to the command line, then the
>>> kernel refused to boot at all, because the kernel itself doesn't
>>> understand that syntax.
>>
>> Yes, when the "root=UUID=***" has been added manually to /etc/default/grub
>> in the wrong way, it appeared in the GRUB menu entry in the wrong way that
>> stopped GRUB from booting in any case...
>
> It doesn't matter how you add root=UUID=* to the kernel command line.
> The kernel doesn't understand that syntax at all.  Your initramfs
> probably does.
>
> When you don't use an initramfs (and you aren't using one, even if you
> think you are),

I have removed all my initramfs files from the /boot and found out
that the system boots anyway. So, you are right.

Before doing this I was sure that it is not the case because back in 2013,
when I first installed Gentoo, the system refused to boot until I created
ininramfs...

> the kernel reads the value of root= and mounts it as
> root.  It doesn't understand the UUID syntax.
>
> When you do use an initramfs then the kernel ignores the root=
> setting, and the initramfs reads it and mounts root.  Typically these
> do understand the UUID syntax, but of course that depends on what
> initramfs you're using.
>
>>
>>> So, the next question becomes, how are you generating an initramfs,
>>> and how is it named?  Pasting the output of "ls /boot" might be
>>> helpful here.
>>
>> I generate initramfs by
>> # genkernel --install initramfs
>> and the rename it to match the name of the kernel, eg,
>> initramfs-4.4.6-gentoo
>> vmlinuz-4.4.6-gentoo
>
> And if you read /etc/grub.d/10_linux you'll see that the script
> doesn't look for an initramfs with the filename initramfs-.
>
> It will accept initramfs-.img or initramfs-genkernel-
>
> It accepts 11 other variations of the filename, but not the one you picked.
>
> So, grub-mkconfig doesn't think you have an initramfs, so it generated
> a configuration file which:
> 1.  Doesn't load an initramfs (so any attempt to stick a root=UUID=*
> option in there will fail).
> 2.  Just references the device name for root that it finds, since that
> is the best it can do without an initramfs.
>
>>
>> But I think that this is unrelevant to the problem because of the following
>> explanation I have just posted. (If I am wrong here, please, let me know
>> and I will post all the conf files you will ask.)
>
> No need, your filenames likely solved the problem.  Just tack a .img
> on the end of that initramfs and you should be good after running
> grub-mkconfig again.

I did this, and now have the following GRUB menu entry in /boot/grub/grub:
menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class
gnu --class os $menuentry_id_option 'gnulinux-simple-44***' {
load_video
insmod gzio
insmod part_msdos
insmod ext2
set root='hd2,msdos3'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos3
--hint-efi=hd2,msdos3 --hint-baremetal=ahci2,msdos3  44***
else
  search --no-floppy --fs-uuid --set=root 44***
fi
echo'Loading Linux 4.4.6-gentoo ...'
linux/boot/vmlinuz-4.4.6-gentoo root=UUID=44*** ro
echo'Loading initial ramdisk ...'
initrd/boot/initramfs-4.4.6-gentoo.img
}
where, again, 44*** stands for the UUID of my root-boot partition.

So, here you are, again, right.

>> When I connected a new SATA disk to the SATA controller, the order of
>> hard disks during the boot time changed because the new disk "jumpt
>> in front" of the boot drive. As the result, the GRUB could not find the
>> boot partition by its UUID on the "wrong" non-boot drive and gave up,
>> without even trying to look for the boot partition by its UUID on other
>> hard drives!
>
> Grub doesn't look for boot partitions at all.  Grub just reads the
> configuration file and loads the kernel (and optionally initramfs)
> that it finds in grub.cfg.  In your case the grub.cfg didn't list an
> initramfs, so it didn't load one.
>
> The initramfs generated by genkernel will look for a drive by UUID,
> and as long as the device exists it will probably find it.  Obviously
> if you're missing a kernel module needed to access the drive that
> would stop it.  However, it doesn't care what order the devices are
> numbered in.
>
>>
>> So, the question remains: why not to desing th

Re: [gentoo-user] Kernel does not boot after adding a new SATA drive

2016-09-07 Thread Rich Freeman
On Wed, Sep 7, 2016 at 2:25 PM, gevisz  wrote:
>
> What you have just said implies that I had not had a problem
> booting the system after adding a new drive had I used initramfs
> correctly. Well, I do agree that, after loading the initramfs, the system
> may find the kernel to load with the help of initramfs that understands
> UUID. However, how the GRUB could find the initramfs in the first place,
> if it could not find the kerner allocated in the same directory as the
> initramfs itself?

grub-mkconfig simply searches for a configurable list of filename
specifications which your initramfs didn't match.  Since /boot could
contain all sorts of files, with all sorts of naming conventions, it
obviously would be very difficult to accomodate any possible naming
convention.  We apparently do have it set up to search the filenames
generated by the initramfs tools we actually use, so as long as you
don't go renaming them you're probably fine.

At boot time grub doesn't search for anything.  It simply reads the
config file and does what it tells it.

>
> Moreover, in the GRUB menu entry provided above, the initramfs loads
> already after the kernel. So, using the initramfs should be irrelevant to
> the question of finding the kernel to load by GRUB.
>

Grub is loading the kernel in your case.  The kernel just isn't
mounting the root filesystem since there is no initramfs to tell it
how to do that.  Grub has nothing to do with mounting root at boot
time.

Grub also loads the initramfs before it ever executes the kernel.  The
kernel doesn't know how to load an initramfs from disk.  It expects it
to be in RAM when it runs.

The initramfs loaded by grub is just a cpio image that is copied into
RAM, and I believe the address gets passed as a kernel command line
argument (one you don't even see in grub, it appends it at runtime).
The kernel creates a ramfs, extracts the cpio image into the ramfs,
and executes init inside of it.  At that point the kernel is
essentially done with booting the system, the initramfs can mount and
pivot to a new root, or the whole system could just run off of an
initramfs until it shuts down.  This is why the kernel developers have
shunned kernel mounting logic/etc in favor of the initramfs; it moves
more of the logic into userspace where it is easier to
change/maintain/etc, and doesn't have to necessarily run with kernel
privs either.  Heck, your initramfs could go out on the network, pull
in another kernel image and initramfs, and kexec that (which I think
is basically the design of coreboot which is a linux-based
bootloader).


-- 
Rich



Re: [gentoo-user] Wastebin or trash?

2016-09-07 Thread Alan McKinnon
On 07/09/2016 19:53, Simon Thelen wrote:
> On 16-09-07 at 18:41, Mick wrote:
>> On Thursday 08 Sep 2016 00:47:13 Andrew Lowe wrote:
>>> On 07/09/16 23:45, Peter Humphrey wrote:
 Hello list,

 As I said in the "emerge @system" thread, I've built a fresh ~amd64 system
 on this i7 box. I also created a new user directory for myself, copying in
 only .bash*, .gkrellm2 and .mozilla.

 After spending a good long time setting up KDE and friends just the way I
 like them, the one remaining task was to set up KMail and import my
 1000-or- so messages. That worked all right, with just the one same
 exception as before: KMail's recycle bin is call "trash" in the folder
 list, but the right-click menu on it offers to "empty wastebin".

 I'm sure I have all my linguas, l10ns i18ns and everything set up right,
 so
 I think I'm just seeing an intermediate stage in KMail development.

 Is anyone else seeing this?
>>>
>>> I'm reading this whilst sitting in Perth, Australia so both should read
>>> "Rubbish Bin" or possibly "Wheelie Bin"  ;)
>> One IMAP4 account of mine shows 'Bin' and another shows 'Trash'.  As I 
>> understand it you need to configure the locale on the mail server.
> IMAP itself does not have a concept of "Trash", the creation of such a
> mailbox is the prerogative of the client (unless the server itself feels
> that the imap client doesn't know what it's doing and moves deleted
> emails into a different mailbox; not that I've ever seen a mail server
> do that), therefore changing the locale on the mail server won't help
> and it is indeed something on the client that needs to be changed.
> 

Or maybe wastebin in "empty wastebin" is a simple common noun whereas
the folder called "Trash" is a proper noun.

KDE widgets in my experience often have oddities like this.

If it's something like that, you may have to find the file containing
display strings and change it there

-- 
Alan McKinnon
alan.mckin...@gmail.com




Re: [gentoo-user] Re: help! IP blocking not working

2016-09-07 Thread Alan McKinnon
On 07/09/2016 18:39, Grant wrote:
>> Hi, my site is being ravaged by an IP but dropping the IP via
>> shorewall is seeming to have no effect.  I'm using his IP from nginx
>> logs.  IP blocking in shorewall has always worked before.  What could
>> be happening?
>
>
> I'm blocking like this with the firewall running on the web server:
>
> /etc/shorewall/rules
> DROPnet:1.2.3.4  $FW
>
> Could shorewall/iptables see a different IP address than the one seen by 
> nginx?


 Most likely the file is configured but the firewall service wasn't
 restarted or the rules no loaded.
>>>
>>>
>>> I restarted shorewall plenty.  :)  I believe the issue was either a
>>> persistent connection which conntrack-tools would have allowed me to
>>> flush, or my blocking in /etc/shorewall/rules instead of
>>> /etc/shorewall/blrules, or both.
>>>
>>
>> What exactly is your issue?  That is, what makes you think you even
>> have an issue?
>>
>> The reason I ask is that all iptables is going to do is drop packets
>> when they reach the kernel. They still go through your network and
>> network card and consume some CPU (even more if you're logging them).
>> If you're being flooded by a very large volume of packets then that
>> will saturate your connection and simply dropping them at the server
>> won't fix the latency this will cause for the good packets.  In such
>> an attack you need to block those packets as far upstream as you can
>> before connections start getting saturated.  This might be outside of
>> your network perimeter.  This is why DDoS attacks are so potent, if
>> you use something like fail2ban to just set iptables are done you're
>> fixing the barn doors after the horses have already left.
> 
> 
> I said I was under attack but it was really just an unthrottled and
> very greedy bot.  fail2ban would have gotten him.  But while we're on
> the subject, how would you recommend thwarting a DDoS attack against a
> dedicated server in a hosted environment?  Cloudflare?

A proper DDos? Phone your ISP and ask them to help you. You almost
certainly don't have the resources.


-- 
Alan McKinnon
alan.mckin...@gmail.com




[gentoo-user] Re: Wastebin or trash?

2016-09-07 Thread Grant Edwards
On 2016-09-07, Simon Thelen  wrote:

> IMAP itself does not have a concept of "Trash", the creation of such
> a mailbox is the prerogative of the client (unless the server itself
> feels that the imap client doesn't know what it's doing and moves
> deleted emails into a different mailbox; not that I've ever seen a
> mail server do that),

Gmail's IMAP server doesn't do that exact thing, but it does have some
similar, sometimes odd-seeming, behaviors due to behind-the-curtains
stuff it does because IMAP mailboxes being mapped into Gmail labels.

-- 
Grant Edwards   grant.b.edwardsYow! I just got my PRINCE
  at   bumper sticker ... But now
  gmail.comI can't remember WHO he
   is ...




Re: [gentoo-user] Wastebin or trash?

2016-09-07 Thread Mick
On Wednesday 07 Sep 2016 20:51:51 Alan McKinnon wrote:
> On 07/09/2016 19:53, Simon Thelen wrote:
> > On 16-09-07 at 18:41, Mick wrote:
> >> On Thursday 08 Sep 2016 00:47:13 Andrew Lowe wrote:
> >>> On 07/09/16 23:45, Peter Humphrey wrote:
>  Hello list,
>  
>  As I said in the "emerge @system" thread, I've built a fresh ~amd64
>  system
>  on this i7 box. I also created a new user directory for myself, copying
>  in
>  only .bash*, .gkrellm2 and .mozilla.
>  
>  After spending a good long time setting up KDE and friends just the way
>  I
>  like them, the one remaining task was to set up KMail and import my
>  1000-or- so messages. That worked all right, with just the one same
>  exception as before: KMail's recycle bin is call "trash" in the folder
>  list, but the right-click menu on it offers to "empty wastebin".
>  
>  I'm sure I have all my linguas, l10ns i18ns and everything set up
>  right,
>  so
>  I think I'm just seeing an intermediate stage in KMail development.
>  
>  Is anyone else seeing this?
>  
> >>>   I'm reading this whilst sitting in Perth, Australia so both should 
read
> >>> 
> >>> "Rubbish Bin" or possibly "Wheelie Bin"  ;)
> >> 
> >> One IMAP4 account of mine shows 'Bin' and another shows 'Trash'.  As I
> >> understand it you need to configure the locale on the mail server.
> > 
> > IMAP itself does not have a concept of "Trash", the creation of such a
> > mailbox is the prerogative of the client (unless the server itself feels
> > that the imap client doesn't know what it's doing and moves deleted
> > emails into a different mailbox; not that I've ever seen a mail server
> > do that), therefore changing the locale on the mail server won't help
> > and it is indeed something on the client that needs to be changed.

Yes, you're right. The IMAP4 protocol uses tags to signify deleted messages, 
which until they are expunged stay on the server.

Most mail clients typically move messages flagged as deleted into a 
bin/trash/deleted IMAP4 mailbox (i.e. the representation of a mail client 
folder) if configured to do so.  The name of the mailbox is down to the user, 
if created manually, or down to the presets of the mail client GUI.  If a 
webmail or desktop mail client is used, then the language settings (on the 
webmail server or local PC) come into play.

One of my accounts has GB settings, hence the 'bin' folder.  The other appears 
to have US settings, hence the 'trash' folder. 


> Or maybe wastebin in "empty wastebin" is a simple common noun whereas
> the folder called "Trash" is a proper noun.
> 
> KDE widgets in my experience often have oddities like this.
> 
> If it's something like that, you may have to find the file containing
> display strings and change it there

This may be a bit drastic.  In my experience changing locale on the local 
client, or the remote webmail server if one exists sorts this out.

Using local Vs server-side subscriptions on Kmail may affect the outcome 
between different clients.
-- 
Regards,
Mick

signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] [OT] Is it still advisable to partition a big hard drive?

2016-09-07 Thread Volker Armin Hemmann
Am 07.09.2016 um 08:18 schrieb Alan McKinnon:
> On 07/09/2016 01:57, Volker Armin Hemmann wrote:
>> Am 01.09.2016 um 11:01 schrieb Alan McKinnon:
>>> On 01/09/2016 09:18, gevisz wrote:
 2016-09-01 9:13 GMT+03:00 Alan McKinnon :
> On 01/09/2016 08:04, gevisz wrote:
>>> [snip]
>>>
> it will take about 5 seconds to partition it.
> And a few more to mkfs it.
 Just to partition - may be, but I very much doubt
 that it will take seconds to create a full-fledged
 ext4 file system on these 5TB via USB2 connention.
>>> Do it. Tell me how long it tool.
>>>
>>> Discussing it without doing it and offering someone else's opinion is a
>>> 100% worthless activity
>>>
 Even more: my aquiantance from the Window world
 that recomended me this disc scared me that it may
 take days...
>>> Mickey Mouse told me it takes microseconds. So what?
>>>
>>> Do it. Tell me how long it took.
>>>
>> Is it still advisable to partition a big hard drive
>> into smaller logical ones and why?
> The only reason to partition a drive is to get 2 or more
> smaller ones that differ somehow (size, inode ratio, mount options, etc)
>
> Go with no partition table by all means, but if you one day find you
> need one, you will have to copy all your data off, repartition, and copy
> your data back. If you are certain that will not happen (eg you will
> rather buy a second drive) then by all means dispense with partitions.
>
> They are after all nothing more than a Microsoft invention from the 80s
> so people could install UCSD Pascal next to MS-DOS
 I definitely will not need more than one mount point for this hard drive
 but I do remember some arguments that partitioning a large hard drive
 into smaller logical ones gives me more safety in case a file system
 suddenly will get corrupted because in this case I will loose my data
 only on one of the logical partitions and not on the whole drive.

 Is this argument still valid nowadays?
>>> That is the most stupid dumbass argument I've heard in weeks.
>>> It doesn't even deserve a response.
>>>
>>> Who the fuck is promoting this shit?
>>>
>>>
>> people who had to deal with corrupted filesystems in the past?
>>
>>
> The way to deal with the problem of fs corruption is to have reliable
> tested backups.
>
> The wrong way to deal with the problem of fs corruption is to get into
> cargo-cult manoeuvrers thinking that lots of little bits making a whole
> is going to solve the problem.
>
> Especially when the part of the disk statistically most at risk is the
> valuable data itself. OS code can be rebuilt easily, without backups
> data can't.
>

the bigger the drive, the greater the chance of fs corruption. Just by
statistics. Better one minor partition is lost than everything.

You can disagree as much as you like, but with the size of drives and
the current error rate of consumer hard drives it is not a question of
'if' but just a matter of 'when'.



Re: [gentoo-user] [OT] Is it still advisable to partition a big hard drive?

2016-09-07 Thread Alan McKinnon

On 08/09/2016 00:12, Volker Armin Hemmann wrote:

Am 07.09.2016 um 08:18 schrieb Alan McKinnon:

On 07/09/2016 01:57, Volker Armin Hemmann wrote:

Am 01.09.2016 um 11:01 schrieb Alan McKinnon:

On 01/09/2016 09:18, gevisz wrote:

2016-09-01 9:13 GMT+03:00 Alan McKinnon :

On 01/09/2016 08:04, gevisz wrote:

[snip]


it will take about 5 seconds to partition it.
And a few more to mkfs it.

Just to partition - may be, but I very much doubt
that it will take seconds to create a full-fledged
ext4 file system on these 5TB via USB2 connention.

Do it. Tell me how long it tool.

Discussing it without doing it and offering someone else's opinion is a
100% worthless activity


Even more: my aquiantance from the Window world
that recomended me this disc scared me that it may
take days...

Mickey Mouse told me it takes microseconds. So what?

Do it. Tell me how long it took.


Is it still advisable to partition a big hard drive
into smaller logical ones and why?

The only reason to partition a drive is to get 2 or more
smaller ones that differ somehow (size, inode ratio, mount options, etc)

Go with no partition table by all means, but if you one day find you
need one, you will have to copy all your data off, repartition, and copy
your data back. If you are certain that will not happen (eg you will
rather buy a second drive) then by all means dispense with partitions.

They are after all nothing more than a Microsoft invention from the 80s
so people could install UCSD Pascal next to MS-DOS

I definitely will not need more than one mount point for this hard drive
but I do remember some arguments that partitioning a large hard drive
into smaller logical ones gives me more safety in case a file system
suddenly will get corrupted because in this case I will loose my data
only on one of the logical partitions and not on the whole drive.

Is this argument still valid nowadays?

That is the most stupid dumbass argument I've heard in weeks.
It doesn't even deserve a response.

Who the fuck is promoting this shit?



people who had to deal with corrupted filesystems in the past?



The way to deal with the problem of fs corruption is to have reliable
tested backups.

The wrong way to deal with the problem of fs corruption is to get into
cargo-cult manoeuvrers thinking that lots of little bits making a whole
is going to solve the problem.

Especially when the part of the disk statistically most at risk is the
valuable data itself. OS code can be rebuilt easily, without backups
data can't.



the bigger the drive, the greater the chance of fs corruption. Just by
statistics. Better one minor partition is lost than everything.


What are the statistical chances of that one minor partition being the 
one that gets corrupted? Statistically the odds are very small.


Think about it, if the minor partition is say 5% of the disk and if all 
other things are exactly equal, the odds are 1 in 20.


Apart from inherent defects in the drive itself, the sectors that are 
more prone to failing are those that are read the most and to a larger 
extent those that are written the most.


What is read the most? OS and Data
What is written the most? Data
What has by far the greatest likelihood of suffering fs corruption? Data





You can disagree as much as you like, but with the size of drives and
the current error rate of consumer hard drives it is not a question of
'if' but just a matter of 'when'.



I don't disagree with you. I'm disagreeing with cargo cult mentality 
that dividing a disk up into lots of smaller partitions somehow 
magically confers significant safety margins of some magical kind. Go 
read the OPs opening statement again, he's quoting a friend from 20 
years ago and the statement consists entirely of woo-woo magic 
hand-wavey statements, the kind of shit I have to deal with every day 
from twits with just enough IQ to read executive white papers.


Yes, drives fail. Yes, consumer drives are crap. With 3TB now being 
common place and prices plunging, we have 20G or so for OS and 2980GB 
full of data. That 20G is so small and immaterial in terms of risk we 
can just disregard it and assume the only thing that can be damaged is 
2980G of data.


Solution: back up the whole damn lot properly and forget what we did 20 
years ago. That was farting in a breeze, nowadays it's farting in a 
hurricane.




Re: [gentoo-user] [OT] Is it still advisable to partition a big hard drive?

2016-09-07 Thread waltdnes
On Thu, Sep 08, 2016 at 12:12:07AM +0200, Volker Armin Hemmann wrote

> You can disagree as much as you like, but with the size of drives and
> the current error rate of consumer hard drives it is not a question of
> 'if' but just a matter of 'when'.

  It's not just the drive; it's the entire PC.  My main desktop at home
has had a few panics recently.  It's several years old, and I'll be
getting rid of it, because I can't really trust it.  I've switched to my
"hot backup", and am currently setting up a new machine as the new "hot
backup".  After doing the initial Gentoo install, I copied over the
config files, with appropriate changes.  I copied /var/lib/portage/world
and launched "emerge --changed-use --deep --update @world".  A few
minutes ago, emerge was on package 228 of 337.

  I have 3 USB backup drives and I use them all.  This does not include
the monthly copying over of /home/waltdnes and /home/misc from the main
desktop to the "hot backup".

  BTW, this is probably the first email sent out from this machine to
the Gentoo list.

-- 
Walter Dnes 
I don't run "desktop environments"; I run useful applications