Re: su - root => segmentation fault

2019-08-02 Thread dmitry.sensei
But we have some bug in heimdal's su 

пт, 2 авг. 2019 г., 20:27 dmitry.sensei :

> Ok. Thanks.
>
> пт, 2 авг. 2019 г., 20:25 Stuart Henderson :
>
>> On 2019-08-02, dmitry.sensei  wrote:
>> > Lol!
>> > ORLOV-NB$ kdump -f ktrace.out
>> >  58118 ktrace   RET   ktrace 0
>> >  58118 ktrace   CALL
>> execve(0x7f7d9100,0x7f7d9710,0x7f7d9730)
>> >  58118 ktrace   NAMI  "*/usr/local/heimdal/bin/su*"
>> >  58118 ktrace   ARGS
>> > [0] = "su"
>> > [1] = "-"
>> > [2] = "root"
>> > ORLOV-NB$ whereis su
>> > /usr/bin/su
>>
>> whereis isn't terribly useful, it doesn't use $PATH, instead uses a
>> fixed path of common directories.
>>
>> The "type" builtin in most Bourne-style shells is usually more helpful.
>>
>>
>>


Re: su - root => segmentation fault

2019-08-02 Thread dmitry.sensei
Ok. Thanks.

пт, 2 авг. 2019 г., 20:25 Stuart Henderson :

> On 2019-08-02, dmitry.sensei  wrote:
> > Lol!
> > ORLOV-NB$ kdump -f ktrace.out
> >  58118 ktrace   RET   ktrace 0
> >  58118 ktrace   CALL
> execve(0x7f7d9100,0x7f7d9710,0x7f7d9730)
> >  58118 ktrace   NAMI  "*/usr/local/heimdal/bin/su*"
> >  58118 ktrace   ARGS
> > [0] = "su"
> > [1] = "-"
> > [2] = "root"
> > ORLOV-NB$ whereis su
> > /usr/bin/su
>
> whereis isn't terribly useful, it doesn't use $PATH, instead uses a
> fixed path of common directories.
>
> The "type" builtin in most Bourne-style shells is usually more helpful.
>
>
>


Re: su - root => segmentation fault

2019-08-02 Thread Stuart Henderson
On 2019-08-02, dmitry.sensei  wrote:
> Lol!
> ORLOV-NB$ kdump -f ktrace.out
>  58118 ktrace   RET   ktrace 0
>  58118 ktrace   CALL  execve(0x7f7d9100,0x7f7d9710,0x7f7d9730)
>  58118 ktrace   NAMI  "*/usr/local/heimdal/bin/su*"
>  58118 ktrace   ARGS
> [0] = "su"
> [1] = "-"
> [2] = "root"
> ORLOV-NB$ whereis su
> /usr/bin/su

whereis isn't terribly useful, it doesn't use $PATH, instead uses a
fixed path of common directories.

The "type" builtin in most Bourne-style shells is usually more helpful.




Re: su - root => segmentation fault

2019-08-02 Thread dmitry.sensei
Lol!
ORLOV-NB$ kdump -f ktrace.out
 58118 ktrace   RET   ktrace 0
 58118 ktrace   CALL  execve(0x7f7d9100,0x7f7d9710,0x7f7d9730)
 58118 ktrace   NAMI  "*/usr/local/heimdal/bin/su*"
 58118 ktrace   ARGS
[0] = "su"
[1] = "-"
[2] = "root"
ORLOV-NB$ whereis su
/usr/bin/su
ORLOV-NB$

пт, 2 авг. 2019 г. в 04:15, dmitry.sensei :

> Amd64 from 30 jul. What does the "your kernel does not match the
> userspace" mean?
>
> ср, 31 июл. 2019 г., 19:22 Gregory Edigarov :
>
>> On 31.07.19 17:00, Solene Rapenne wrote:
>> > On Wed, Jul 31, 2019 at 04:49:54PM +0500, dmitry.sensei wrote:
>> >> Hi!
>> >> why did it happen?
>> >>
>> >> OpenBSD 6.5 current
>> >> $su - root
>> >> root's password:
>> >> Segmentation fault
>> >> $ doas su - root
>> >> #
>> >>
>> >> --
>> >> Dmitry Orlov
>> > what current? What arch?
>> >
>> > works for me©
>> > OpenBSD 6.5-current (GENERIC.MP) #153: Sun Jul 28 20:33:09 MDT 2019
>> usually it means that your kernel does not match the userspace
>>
>>

-- 
Dmitry Orlov


Re: su - root => segmentation fault

2019-08-01 Thread dmitry.sensei
Amd64 from 30 jul. What does the "your kernel does not match the userspace"
mean?

ср, 31 июл. 2019 г., 19:22 Gregory Edigarov :

> On 31.07.19 17:00, Solene Rapenne wrote:
> > On Wed, Jul 31, 2019 at 04:49:54PM +0500, dmitry.sensei wrote:
> >> Hi!
> >> why did it happen?
> >>
> >> OpenBSD 6.5 current
> >> $su - root
> >> root's password:
> >> Segmentation fault
> >> $ doas su - root
> >> #
> >>
> >> --
> >> Dmitry Orlov
> > what current? What arch?
> >
> > works for me©
> > OpenBSD 6.5-current (GENERIC.MP) #153: Sun Jul 28 20:33:09 MDT 2019
> usually it means that your kernel does not match the userspace
>
>


Re: su - root => segmentation fault

2019-07-31 Thread Gregory Edigarov

On 31.07.19 17:00, Solene Rapenne wrote:

On Wed, Jul 31, 2019 at 04:49:54PM +0500, dmitry.sensei wrote:

Hi!
why did it happen?

OpenBSD 6.5 current
$su - root
root's password:
Segmentation fault
$ doas su - root
#

--
Dmitry Orlov

what current? What arch?

works for me©
OpenBSD 6.5-current (GENERIC.MP) #153: Sun Jul 28 20:33:09 MDT 2019

usually it means that your kernel does not match the userspace



Re: su - root => segmentation fault

2019-07-31 Thread Solene Rapenne
On Wed, Jul 31, 2019 at 04:49:54PM +0500, dmitry.sensei wrote:
> Hi!
> why did it happen?
> 
> OpenBSD 6.5 current
> $su - root
> root's password:
> Segmentation fault
> $ doas su - root
> #
> 
> -- 
> Dmitry Orlov

what current? What arch?

works for me©
OpenBSD 6.5-current (GENERIC.MP) #153: Sun Jul 28 20:33:09 MDT 2019



Re: Adding root CA

2017-10-13 Thread Stuart Henderson
On 2017-10-13, Allan Streib  wrote:
> "Bryan C. Everly"  writes:
>
>> Where I work, we are required to install a self-signed root CA into
>> our machines in order to access https sites on the Internet.  It
>> basically allows our security appliances to do a MITM attack on the
>> traffic and look into it to examine the payload for viruses, data
>> exfiltration, etc.  I know, creepy.
>>
>> Regardless, I'd like to be able to set up my OpenBSD laptop with this
>> certificate; however, I have searched mailing lists, Google, etc. and
>> have come up dry.  It basically looks like I need to somehow hook it
>> into the certificate store in /etc/ssl but if someone could point me
>> to a resource that would help me figure out how to do this, I'd really
>> appreciate it.
>
> I think what you will find is that browsers like chromium and firefox
> don't use the OpenBSD-provided /etc/ssl/cert.pem CA file.
>
> They instead have their own interal list of trusted CAs so you will need
> to add your local CA root to the browser's trusted CAs.
> 
> I stand to be corrected, but I do know that I've tried just tacking on a
> local CA root at the end of /etc/ssl/cert.pem and firefox still sounded
> alarms when I tried to connect to one of our local websites.

Yes, that's correct for the usual graphical browsers. cert.pem is
still used for things like ftp (and thus pkg_add/syspatch}, lynx,
curl, svn, etc.

Remember that browsers will disable some things like cert pinning
for sites signed with these manually-added certificates. Basically
you are putting full trust in the middleware vendor/operator to 
verify certificates correctly as well as to not leak your data.



Re: Adding root CA

2017-10-13 Thread Allan Streib
"Bryan C. Everly"  writes:

> Where I work, we are required to install a self-signed root CA into
> our machines in order to access https sites on the Internet.  It
> basically allows our security appliances to do a MITM attack on the
> traffic and look into it to examine the payload for viruses, data
> exfiltration, etc.  I know, creepy.
>
> Regardless, I'd like to be able to set up my OpenBSD laptop with this
> certificate; however, I have searched mailing lists, Google, etc. and
> have come up dry.  It basically looks like I need to somehow hook it
> into the certificate store in /etc/ssl but if someone could point me
> to a resource that would help me figure out how to do this, I'd really
> appreciate it.

I think what you will find is that browsers like chromium and firefox
don't use the OpenBSD-provided /etc/ssl/cert.pem CA file.

They instead have their own interal list of trusted CAs so you will need
to add your local CA root to the browser's trusted CAs.

I stand to be corrected, but I do know that I've tried just tacking on a
local CA root at the end of /etc/ssl/cert.pem and firefox still sounded
alarms when I tried to connect to one of our local websites.

Allan



Re: Encrypted root - booting problems on USB3 only

2015-06-19 Thread Peter Pauly
I tried reinstalling to the USB drive from the current snapshot. This
time it just hangs at root device: .  UEFI can find the USB3 stick
to boot from, but it cannot be found to mount it as root. I installed
again without using encryption and got the same result. It hangs at
root device:  .


When booting from USB2, I get the following dmesg:

OpenBSD 5.8-beta (RAMDISK_CD) #985: Thu Jun 18 01:35:49 MDT 2015
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/RAMDISK_CD
real mem = 17057521664 (16267MB)
avail mem = 16538845184 (15772MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.7 @ 0xbc416018 (61 entries)
bios0: vendor American Megatrends Inc. version 2501 date 04/08/2014
bios0: ASUSTeK COMPUTER INC. SABERTOOTH 990FX R2.0
acpi0 at bios0: rev 2
acpi0: tables DSDT FACP APIC FPDT MCFG HPET BGRT SSDT IVRS
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 16 (boot processor)
cpu0: AMD FX(tm)-8350 Eight-Core Processor, 4013.99 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,POPCNT,AES,XSAVE,AVX,F16C,NXE,MMXX,FFXSR,PAGE1GB,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,XOP,SKINIT,WDT,FMA4,NODEID,TBM,TOPEXT,ITSC,BMI1
cpu0: 64KB 64b/line 2-way I-cache, 16KB 64b/line 4-way D-cache, 2MB
64b/line 16-way L2 cache, 8MB 64b/line 64-way L3 cache
cpu0: ITLB 48 4KB entries fully associative, 24 4MB entries fully associative
cpu0: DTLB 64 4KB entries fully associative, 64 4MB entries fully associative
cpu0: apic clock running at 200MHz
cpu0: mwait min=64, max=64, IBE
cpu at mainbus0: not configured
cpu at mainbus0: not configured
cpu at mainbus0: not configured
cpu at mainbus0: not configured
cpu at mainbus0: not configured
cpu at mainbus0: not configured
cpu at mainbus0: not configured
ioapic0 at mainbus0: apid 9 pa 0xfec0, version 21, 24 pins
ioapic1 at mainbus0: apid 10 pa 0xfec2, version 21, 32 pins
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 8 (P0PC)
acpiprt2 at acpi0: bus 1 (PC02)
acpiprt3 at acpi0: bus -1 (PC03)
acpiprt4 at acpi0: bus 2 (PC04)
acpiprt5 at acpi0: bus 3 (PC05)
acpiprt6 at acpi0: bus -1 (PC06)
acpiprt7 at acpi0: bus -1 (PC07)
acpiprt8 at acpi0: bus 4 (PC09)
acpiprt9 at acpi0: bus 5 (PC0A)
acpiprt10 at acpi0: bus 6 (PC0B)
acpiprt11 at acpi0: bus -1 (PC0C)
acpiprt12 at acpi0: bus 7 (PC0D)
acpiprt13 at acpi0: bus 9 (PE20)
acpiprt14 at acpi0: bus 10 (PE21)
acpiprt15 at acpi0: bus 11 (PE22)
acpiprt16 at acpi0: bus 12 (PE23)
acpiec0 at acpi0
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 vendor ATI, unknown product 0x5a14 rev 0x02
vendor ATI, unknown product 0x5a23 (class system unknown subclass
0x06, rev 0x00) at pci0 dev 0 function 2 not configured
ppb0 at pci0 dev 2 function 0 ATI SR5690 PCIE rev 0x00: msi
pci1 at ppb0 bus 1
vga1 at pci1 dev 0 function 0 ATI Radeon HD 5850 rev 0x00
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
ATI Radeon HD 5800 Audio rev 0x00 at pci1 dev 0 function 1 not configured
ppb1 at pci0 dev 4 function 0 ATI SR5690 PCIE rev 0x00: msi
pci2 at ppb1 bus 2
ahci0 at pci2 dev 0 function 0 ASMedia ASM1061 AHCI rev 0x01: msi, AHCI 1.2
scsibus0 at ahci0: 32 targets
ppb2 at pci0 dev 5 function 0 ATI SR5690 PCIE rev 0x00: msi
pci3 at ppb2 bus 3
ahci1 at pci3 dev 0 function 0 ASMedia ASM1061 AHCI rev 0x01: msi, AHCI 1.2
scsibus1 at ahci1: 32 targets
ppb3 at pci0 dev 9 function 0 ATI SR5690 PCIE rev 0x00: msi
pci4 at ppb3 bus 4
xhci0 at pci4 dev 0 function 0 ASMedia ASM1042A xHCI rev 0x00: msi
usb0 at xhci0: USB revision 3.0
uhub0 at usb0 ASMedia xHCI root hub rev 3.00/1.00 addr 1
ppb4 at pci0 dev 10 function 0 ATI SR5690 PCIE rev 0x00: msi
pci5 at ppb4 bus 5
ppb5 at pci0 dev 11 function 0 ATI SR5690 PCIE rev 0x00: msi
pci6 at ppb5 bus 6
ppb6 at pci0 dev 13 function 0 ATI SR5690 PCIE rev 0x00: msi
pci7 at ppb6 bus 7
ahci2 at pci0 dev 17 function 0 ATI SBx00 SATA rev 0x40: apic 9 int
19, AHCI 1.2
ahci2: port 4: 1.5Gb/s
scsibus2 at ahci2: 32 targets
cd0 at scsibus2 targ 4 lun 0: ASUS, DRW-24B1ST c, 1.05 ATAPI 5/cdrom removable
ohci0 at pci0 dev 18 function 0 ATI SB700 USB rev 0x00: apic 9 int
18, version 1.0, legacy support
ehci0 at pci0 dev 18 function 2 ATI SB700 USB2 rev 0x00: apic 9 int 17
usb1 at ehci0: USB revision 2.0
uhub1 at usb1 ATI EHCI root hub rev 2.00/1.00 addr 1
ohci1 at pci0 dev 19 function 0 ATI SB700 USB rev 0x00: apic 9 int
20, version 1.0, legacy support
ehci1 at pci0 dev 19 function 2 ATI SB700 USB2 rev 0x00: apic 9 int 21
usb2 at ehci1: USB revision 2.0
uhub2 at usb2 ATI EHCI root hub rev 2.00/1.00 addr 1
ATI SBx00 SMBus rev 0x42 at pci0 dev 20 function 0 not configured
ATI SBx00 HD Audio rev 0x40 at pci0 dev 20 function 2 not configured
ATI SB700 ISA rev 0x40 at pci0 dev 20 function 3 not configured
ppb7 at pci0 dev 20 function 4 ATI SB600 PCI rev 0x40
pci8 at ppb7 bus 8
ohci2 at pci0 dev 20 function 5 ATI SB700 USB rev 0x00: apic 9 int
18, version 1.0, legacy support

Re: INVALID ROOT NODE

2014-12-10 Thread Stuart Henderson
On 2014-12-09, Philip Guenther guent...@gmail.com wrote:
 On Sun, Nov 30, 2014 at 2:48 AM, Max Power open...@cpnetserver.net wrote:
 I have a CRYPTO - RAID 1 softraid device /dev/sd4a [3TB OpenBSD 5.6/amd64]
 on which I have about 1,400,000 files and I've never had problems reading
 or writing. If, however, launch the tree command, eg. tree c *, returns me:
 tree: invalid root node: name_of_file.

: morgaine; tree
 /bin/ksh: tree: not found
: morgaine;

 So this is a program from some port?  What does the documentation for
 program say about that error message?

 I tried to run a fsck and this is the result

 Huh, an error message from a random program makes you fsck your disks?
  That seems like an overreaction to me.  As far as we know, you're
 just invoking it with the wrong arguments...

It's half understandable, given how badly written the text of the error message 
is.

It seems that tree wants directory names, not filenames, on the command line.



Re: INVALID ROOT NODE

2014-12-08 Thread Philip Guenther
On Sun, Nov 30, 2014 at 2:48 AM, Max Power open...@cpnetserver.net wrote:
 I have a CRYPTO - RAID 1 softraid device /dev/sd4a [3TB OpenBSD 5.6/amd64]
 on which I have about 1,400,000 files and I've never had problems reading
 or writing. If, however, launch the tree command, eg. tree c *, returns me:
 tree: invalid root node: name_of_file.

: morgaine; tree
/bin/ksh: tree: not found
: morgaine;

So this is a program from some port?  What does the documentation for
program say about that error message?


 I tried to run a fsck and this is the result

Huh, an error message from a random program makes you fsck your disks?
 That seems like an overreaction to me.  As far as we know, you're
just invoking it with the wrong arguments...


Philip Guenther



Re: Changing root password from stdin value

2014-10-09 Thread Sébastien Marie
On Thu, Oct 09, 2014 at 06:22:05PM +0100, Nux! wrote:
 Hello,
 
 I'm trying to get some scripts working which would take a password from stdin 
 and set it for root.
 In Linux passwd --stdin is used, in FreeBSD pw mod user root -h 0. How 
 would I do this in OpenBSD?
 
 Thanks,
 Lucian
 

Hi,

You could use encrypt(1) + usermod(1).

encrypt will encrypt passwords from the command line or standard input.
usermod will accept an already-encrypted password.

-- 
Sébastien Marie



Re: Changing root password from stdin value

2014-10-09 Thread Nux!
Thanks, that worked great!

Lucian

--
Sent from the Delta quadrant using Borg technology!

Nux!
www.nux.ro

- Original Message -
 From: Sébastien Marie semarie-open...@latrappe.fr
 To: Nux! n...@li.nux.ro
 Cc: misc@openbsd.org
 Sent: Thursday, 9 October, 2014 18:48:54
 Subject: Re: Changing root password from stdin value

 On Thu, Oct 09, 2014 at 06:22:05PM +0100, Nux! wrote:
 Hello,
 
 I'm trying to get some scripts working which would take a password from stdin
 and set it for root.
 In Linux passwd --stdin is used, in FreeBSD pw mod user root -h 0. How 
 would
 I do this in OpenBSD?
 
 Thanks,
 Lucian
 
 
 Hi,
 
 You could use encrypt(1) + usermod(1).
 
 encrypt will encrypt passwords from the command line or standard input.
 usermod will accept an already-encrypted password.
 
 --
 Sébastien Marie



Re: Changing root password from stdin value

2014-10-09 Thread Nick Holland

On 10/09/14 13:21, Nux! wrote:

Hello,

I'm trying to get some scripts working which would take a password
from stdin and set it for root. In Linux passwd --stdin is used, in
FreeBSD pw mod user root -h 0. How would I do this in OpenBSD?

Thanks, Lucian



in addition to the already provided tip... consider this:

Disable root password logins completely.  Change the (encrypted) 
password to something nonsense or one or 13 *s, and use either sudo or 
SSH keys to get root acceess.  This has the added advantages of no one 
having extra access by having root pw, no need to share/distribute 
root pw, etc.  And unlike a number of other Unixes, this works very nicely.


Nick.



Re: Changing root password from stdin value

2014-10-09 Thread Артур Истомин
On Thu, Oct 09, 2014 at 02:23:54PM -0400, Nick Holland wrote:
 On 10/09/14 13:21, Nux! wrote:
 Hello,
 
 I'm trying to get some scripts working which would take a password
 from stdin and set it for root. In Linux passwd --stdin is used, in
 FreeBSD pw mod user root -h 0. How would I do this in OpenBSD?
 
 Thanks, Lucian
 
 
 in addition to the already provided tip... consider this:
 
 Disable root password logins completely.  Change the (encrypted) password to
 something nonsense or one or 13 *s, and use either sudo or SSH keys to get
 root acceess.  This has the added advantages of no one having extra access
 by having root pw, no need to share/distribute root pw, etc.  And unlike a
 number of other Unixes, this works very nicely.

Ubuntu-style? :)



Re: Migrate Root Partition to another disk

2013-05-14 Thread Otto Moerbeek
On Tue, May 14, 2013 at 11:08:49AM +0200, Adrien wrote:

 Hi,
 
 I have added a second hard drive in my virtual machine, as my root
 partition is full. My idea was to add a new disk to the system, then
 migrate the root partition to the new disk.
 
 What I did so far :
 
 - In recovery, add the second hard drive, fdisk to initialize it, then
 disklabel to add a new slice. -- OK
 
 - Mounted the new partition, copied everything from root to the new
 partition, then changed /etc/fstab to the new disk, as well as
 /mnt/etc/fstab.
 
 But after restart, my system can't boot :(
 
 Any hint about that ?
 
 I have been able to migrate other partition without any problems, but I
 guess I'm missing something for the root partition.

man installboot

-Otto



Re: Migrate Root Partition to another disk

2013-05-14 Thread Adrien
Thanks.

I have mounted my new hard drive to /mnt.

Then I ran :

/usr/mdec/installboot -v /mnt/boot /usr/mdec/biosboot sd2

Telling me that /boot will be written at sector 64.

But I'm still booting with my old hdd :(

Tried to enter boot hd1k:/bsd at boot prompt but it's telling me that no
such file or directory. Seems my drive is good as during the early
bootstage I have hd0+ (my old hdd) and hd1+ (new hdd).

Can this be due to the fact my filesystem is currently read-only, as I have
no more space left on my root partition ?



2013/5/14 Otto Moerbeek o...@drijf.net

 On Tue, May 14, 2013 at 11:08:49AM +0200, Adrien wrote:

  Hi,
 
  I have added a second hard drive in my virtual machine, as my root
  partition is full. My idea was to add a new disk to the system, then
  migrate the root partition to the new disk.
 
  What I did so far :
 
  - In recovery, add the second hard drive, fdisk to initialize it, then
  disklabel to add a new slice. -- OK
 
  - Mounted the new partition, copied everything from root to the new
  partition, then changed /etc/fstab to the new disk, as well as
  /mnt/etc/fstab.
 
  But after restart, my system can't boot :(
 
  Any hint about that ?
 
  I have been able to migrate other partition without any problems, but I
  guess I'm missing something for the root partition.

 man installboot

 -Otto



Re: Migrate Root Partition to another disk

2013-05-14 Thread Otto Moerbeek
On Tue, May 14, 2013 at 01:06:27PM +0200, Adrien wrote:

 Thanks.
 
 I have mounted my new hard drive to /mnt.

You don't mount hard drives, you mount partititons.

Tell us exactly what you did and show command output of fdisk and disklabel.

Without that info, we can only guess.

-Otto

 
 Then I ran :
 
 /usr/mdec/installboot -v /mnt/boot /usr/mdec/biosboot sd2
 
 Telling me that /boot will be written at sector 64.
 
 But I'm still booting with my old hdd :(
 
 Tried to enter boot hd1k:/bsd at boot prompt but it's telling me that no
 such file or directory. Seems my drive is good as during the early
 bootstage I have hd0+ (my old hdd) and hd1+ (new hdd).
 
 Can this be due to the fact my filesystem is currently read-only, as I have
 no more space left on my root partition ?
 
 
 
 2013/5/14 Otto Moerbeek o...@drijf.net
 
  On Tue, May 14, 2013 at 11:08:49AM +0200, Adrien wrote:
 
   Hi,
  
   I have added a second hard drive in my virtual machine, as my root
   partition is full. My idea was to add a new disk to the system, then
   migrate the root partition to the new disk.
  
   What I did so far :
  
   - In recovery, add the second hard drive, fdisk to initialize it, then
   disklabel to add a new slice. -- OK
  
   - Mounted the new partition, copied everything from root to the new
   partition, then changed /etc/fstab to the new disk, as well as
   /mnt/etc/fstab.
  
   But after restart, my system can't boot :(
  
   Any hint about that ?
  
   I have been able to migrate other partition without any problems, but I
   guess I'm missing something for the root partition.
 
  man installboot
 
  -Otto



Re: Migrate Root Partition to another disk

2013-05-14 Thread Adrien
OK, so :

1. Added new hdd within my virtual machine.

2. Started virtual machine, initialized the disk with fdisk :

root@bsd:~# fdisk -i sd2
Do you wish to write new MBR and partition table? [n] y
Writing MBR at offset 0.

3. Added new slice with Disklabel
root@bsd:~# disklabel -E sd2

Label editor (enter '?' for help at any prompt)
 p
OpenBSD area: 64-16771860; size: 16771796; free: 20
#size   offset  fstype [fsize bsize  cpg]
  c: 167772160  unused
  k: 16771776   64  4.2BSD   2048 163841

 d k

 a a

 p
OpenBSD area: 64-16771860; size: 16771796; free: 20
#size   offset  fstype [fsize bsize  cpg]
  a: 16771776   64  4.2BSD   2048 163841
  c: 167772160  unused

 w
 q


4. Made new fs to the partition :

root@bsd:/# newfs /dev/rsd2a
/dev/rsd2a: 8189.3MB in 16771776 sectors of 512 bytes
41 cylinder groups of 202.47MB, 12958 blocks, 25984 inodes each
super-block backups (for fsck -b #) at:
 32, 414688, 829344, 1244000, 1658656, 2073312, 2487968, 2902624, 3317280,
3731936, 4146592, 4561248, 4975904, 5390560,
 5805216, 6219872, 6634528, 7049184, 7463840, 7878496, 8293152, 8707808,
9122464, 9537120, 9951776, 10366432, 10781088,
 11195744, 11610400, 12025056, 12439712, 12854368, 13269024, 13683680,
14098336, 14512992, 14927648, 15342304, 15756960,
 16171616, 16586272,


5. Rebooted in rescue to mount the new partition and copy old root to the
new partition :
mount /dev/sd2a /mnt   -- New partition
mount /dev/sd0a /mnt2   -- Old root partition

6.

Copied everything from old root to the new partition :

(cd /mnt2; tar cf - .) | (cd /mnt; tar xpf -)

7. Then runned install boot with :

/usr/mdec/installboot -v /mnt/boot /usr/mdec/biosboot sd2

8. My BSD is still booting on hd0 instead of hd1 :(


2013/5/14 Otto Moerbeek o...@drijf.net

 On Tue, May 14, 2013 at 01:06:27PM +0200, Adrien wrote:

  Thanks.
 
  I have mounted my new hard drive to /mnt.

 You don't mount hard drives, you mount partititons.

 Tell us exactly what you did and show command output of fdisk and
 disklabel.

 Without that info, we can only guess.

 -Otto

 
  Then I ran :
 
  /usr/mdec/installboot -v /mnt/boot /usr/mdec/biosboot sd2
 
  Telling me that /boot will be written at sector 64.
 
  But I'm still booting with my old hdd :(
 
  Tried to enter boot hd1k:/bsd at boot prompt but it's telling me that no
  such file or directory. Seems my drive is good as during the early
  bootstage I have hd0+ (my old hdd) and hd1+ (new hdd).
 
  Can this be due to the fact my filesystem is currently read-only, as I
 have
  no more space left on my root partition ?
 
 
 
  2013/5/14 Otto Moerbeek o...@drijf.net
 
   On Tue, May 14, 2013 at 11:08:49AM +0200, Adrien wrote:
  
Hi,
   
I have added a second hard drive in my virtual machine, as my root
partition is full. My idea was to add a new disk to the system, then
migrate the root partition to the new disk.
   
What I did so far :
   
- In recovery, add the second hard drive, fdisk to initialize it,
 then
disklabel to add a new slice. -- OK
   
- Mounted the new partition, copied everything from root to the new
partition, then changed /etc/fstab to the new disk, as well as
/mnt/etc/fstab.
   
But after restart, my system can't boot :(
   
Any hint about that ?
   
I have been able to migrate other partition without any problems,
 but I
guess I'm missing something for the root partition.
  
   man installboot
  
   -Otto



Re: Migrate Root Partition to another disk

2013-05-14 Thread Otto Moerbeek
On Tue, May 14, 2013 at 03:52:03PM +0200, Adrien wrote:

 OK, so :
 
 1. Added new hdd within my virtual machine.
 
 2. Started virtual machine, initialized the disk with fdisk :
 
 root@bsd:~# fdisk -i sd2
 Do you wish to write new MBR and partition table? [n] y
 Writing MBR at offset 0.
 
 3. Added new slice with Disklabel
 root@bsd:~# disklabel -E sd2
 
 Label editor (enter '?' for help at any prompt)
  p
 OpenBSD area: 64-16771860; size: 16771796; free: 20
 #size   offset  fstype [fsize bsize  cpg]
   c: 167772160  unused
   k: 16771776   64  4.2BSD   2048 163841
 
  d k
 
  a a
 
  p
 OpenBSD area: 64-16771860; size: 16771796; free: 20
 #size   offset  fstype [fsize bsize  cpg]
   a: 16771776   64  4.2BSD   2048 163841
   c: 167772160  unused
 
  w
  q
 
 
 4. Made new fs to the partition :
 
 root@bsd:/# newfs /dev/rsd2a
 /dev/rsd2a: 8189.3MB in 16771776 sectors of 512 bytes
 41 cylinder groups of 202.47MB, 12958 blocks, 25984 inodes each
 super-block backups (for fsck -b #) at:
  32, 414688, 829344, 1244000, 1658656, 2073312, 2487968, 2902624, 3317280,
 3731936, 4146592, 4561248, 4975904, 5390560,
  5805216, 6219872, 6634528, 7049184, 7463840, 7878496, 8293152, 8707808,
 9122464, 9537120, 9951776, 10366432, 10781088,
  11195744, 11610400, 12025056, 12439712, 12854368, 13269024, 13683680,
 14098336, 14512992, 14927648, 15342304, 15756960,
  16171616, 16586272,
 
 
 5. Rebooted in rescue to mount the new partition and copy old root to the
 new partition :
 mount /dev/sd2a /mnt   -- New partition
 mount /dev/sd0a /mnt2   -- Old root partition
 
 6.
 
 Copied everything from old root to the new partition :
 
 (cd /mnt2; tar cf - .) | (cd /mnt; tar xpf -)
 
 7. Then runned install boot with :
 
 /usr/mdec/installboot -v /mnt/boot /usr/mdec/biosboot sd2
 
 8. My BSD is still booting on hd0 instead of hd1 :(

Did you tell the bios to boot from the other disk?

-Otto

 
 
 2013/5/14 Otto Moerbeek o...@drijf.net
 
  On Tue, May 14, 2013 at 01:06:27PM +0200, Adrien wrote:
 
   Thanks.
  
   I have mounted my new hard drive to /mnt.
 
  You don't mount hard drives, you mount partititons.
 
  Tell us exactly what you did and show command output of fdisk and
  disklabel.
 
  Without that info, we can only guess.
 
  -Otto
 
  
   Then I ran :
  
   /usr/mdec/installboot -v /mnt/boot /usr/mdec/biosboot sd2
  
   Telling me that /boot will be written at sector 64.
  
   But I'm still booting with my old hdd :(
  
   Tried to enter boot hd1k:/bsd at boot prompt but it's telling me that no
   such file or directory. Seems my drive is good as during the early
   bootstage I have hd0+ (my old hdd) and hd1+ (new hdd).
  
   Can this be due to the fact my filesystem is currently read-only, as I
  have
   no more space left on my root partition ?
  
  
  
   2013/5/14 Otto Moerbeek o...@drijf.net
  
On Tue, May 14, 2013 at 11:08:49AM +0200, Adrien wrote:
   
 Hi,

 I have added a second hard drive in my virtual machine, as my root
 partition is full. My idea was to add a new disk to the system, then
 migrate the root partition to the new disk.

 What I did so far :

 - In recovery, add the second hard drive, fdisk to initialize it,
  then
 disklabel to add a new slice. -- OK

 - Mounted the new partition, copied everything from root to the new
 partition, then changed /etc/fstab to the new disk, as well as
 /mnt/etc/fstab.

 But after restart, my system can't boot :(

 Any hint about that ?

 I have been able to migrate other partition without any problems,
  but I
 guess I'm missing something for the root partition.
   
man installboot
   
-Otto



Re: Migrate Root Partition to another disk

2013-05-14 Thread Adrien
I'm really ashamed about that, I told it the wrong diskMy bad

All is working correctly now, a big thanks for your hints.

Here the final steps I did, for anyone else who might be interested  :

- I forgot to edit my /etc/fstab before rebooting. So my system was mounted
as read-only, and couldn't update /etc/fstab

- Did mount -uw /dev/sd2a /
- Edited fstab to reflect the new duid

Thank you very much for your help


2013/5/14 Otto Moerbeek o...@drijf.net

 On Tue, May 14, 2013 at 03:52:03PM +0200, Adrien wrote:

  OK, so :
 
  1. Added new hdd within my virtual machine.
 
  2. Started virtual machine, initialized the disk with fdisk :
 
  root@bsd:~# fdisk -i sd2
  Do you wish to write new MBR and partition table? [n] y
  Writing MBR at offset 0.
 
  3. Added new slice with Disklabel
  root@bsd:~# disklabel -E sd2
 
  Label editor (enter '?' for help at any prompt)
   p
  OpenBSD area: 64-16771860; size: 16771796; free: 20
  #size   offset  fstype [fsize bsize  cpg]
c: 167772160  unused
k: 16771776   64  4.2BSD   2048 163841
 
   d k
 
   a a
 
   p
  OpenBSD area: 64-16771860; size: 16771796; free: 20
  #size   offset  fstype [fsize bsize  cpg]
a: 16771776   64  4.2BSD   2048 163841
c: 167772160  unused
 
   w
   q
 
 
  4. Made new fs to the partition :
 
  root@bsd:/# newfs /dev/rsd2a
  /dev/rsd2a: 8189.3MB in 16771776 sectors of 512 bytes
  41 cylinder groups of 202.47MB, 12958 blocks, 25984 inodes each
  super-block backups (for fsck -b #) at:
   32, 414688, 829344, 1244000, 1658656, 2073312, 2487968, 2902624,
 3317280,
  3731936, 4146592, 4561248, 4975904, 5390560,
   5805216, 6219872, 6634528, 7049184, 7463840, 7878496, 8293152, 8707808,
  9122464, 9537120, 9951776, 10366432, 10781088,
   11195744, 11610400, 12025056, 12439712, 12854368, 13269024, 13683680,
  14098336, 14512992, 14927648, 15342304, 15756960,
   16171616, 16586272,
 
 
  5. Rebooted in rescue to mount the new partition and copy old root to the
  new partition :
  mount /dev/sd2a /mnt   -- New partition
  mount /dev/sd0a /mnt2   -- Old root partition
 
  6.
 
  Copied everything from old root to the new partition :
 
  (cd /mnt2; tar cf - .) | (cd /mnt; tar xpf -)
 
  7. Then runned install boot with :
 
  /usr/mdec/installboot -v /mnt/boot /usr/mdec/biosboot sd2
 
  8. My BSD is still booting on hd0 instead of hd1 :(

 Did you tell the bios to boot from the other disk?

 -Otto

 
 
  2013/5/14 Otto Moerbeek o...@drijf.net
 
   On Tue, May 14, 2013 at 01:06:27PM +0200, Adrien wrote:
  
Thanks.
   
I have mounted my new hard drive to /mnt.
  
   You don't mount hard drives, you mount partititons.
  
   Tell us exactly what you did and show command output of fdisk and
   disklabel.
  
   Without that info, we can only guess.
  
   -Otto
  
   
Then I ran :
   
/usr/mdec/installboot -v /mnt/boot /usr/mdec/biosboot sd2
   
Telling me that /boot will be written at sector 64.
   
But I'm still booting with my old hdd :(
   
Tried to enter boot hd1k:/bsd at boot prompt but it's telling me
 that no
such file or directory. Seems my drive is good as during the early
bootstage I have hd0+ (my old hdd) and hd1+ (new hdd).
   
Can this be due to the fact my filesystem is currently read-only, as
 I
   have
no more space left on my root partition ?
   
   
   
2013/5/14 Otto Moerbeek o...@drijf.net
   
 On Tue, May 14, 2013 at 11:08:49AM +0200, Adrien wrote:

  Hi,
 
  I have added a second hard drive in my virtual machine, as my
 root
  partition is full. My idea was to add a new disk to the system,
 then
  migrate the root partition to the new disk.
 
  What I did so far :
 
  - In recovery, add the second hard drive, fdisk to initialize it,
   then
  disklabel to add a new slice. -- OK
 
  - Mounted the new partition, copied everything from root to the
 new
  partition, then changed /etc/fstab to the new disk, as well as
  /mnt/etc/fstab.
 
  But after restart, my system can't boot :(
 
  Any hint about that ?
 
  I have been able to migrate other partition without any problems,
   but I
  guess I'm missing something for the root partition.

 man installboot

 -Otto



Re: ksh's HISTFILE [was: Re: SSH, root can repeat commands with up arrow, others cannot]

2012-03-14 Thread Nicholas Marriott
I dunno, I hadn't really noticed this behaviour but now that you point
it out I kind of like it, apologist or not. It frequently annoys me with
bash that I lose $LONGCOMMAND I typed in one shell because I exited it,
it's nice to be able to search for and find it in existing shells as
well.

Maybe history should be merged, but in such a way that history from
other shells is always the last thing the current shell reaches for -
then you get the last thing in current shell if you navigate, but you
can still search for and find commands from other shells.

Still, I don't have time or inclination to work on it right now, and I
strongly suspect you're not going to try.

There has been a diff floating around to make the ksh history code
better for ages, I don't know if it changes the behaviour.


On Tue, Mar 13, 2012 at 09:53:00PM -0400, Hugo Villeneuve wrote:
 On Mon, Mar 12, 2012 at 01:03:54PM +0200, lilit-aibolit wrote:
  11.03.2012 21:43, Chris Bennett P?P8QP5Q:
  This started for me a while back.
  Login as root, I can repeat older commands with up down arrows.
  History command shows history.
  
  su -l otheruser
  
  Cannot use up down arrows to access history.
  History command shows correct history.
  
  Login remotely as otheruser.
  Same problem.
  
  Chris Bennett
  
 
  try to add this to your .profile:
 
  export HISTFILE=~/.sh_history
 
  and re-login.
 
  it is work for me and save all history after disconnect
  and start new session.

 Has there been improvement in ksh's history file recently? Like
 since 5.0?

 Because last time I tried, it was unusable if you ran more than two
 session concurently, as both shell would use the same file directly
 which lead to odd behavior. Like you did up history in one shell,
 and you would see a command entered in the other one. Very wierd
 to grasp.

 (50+ OpenBSD's apologist will email me right back to tell me that
 it's a feature. It's not GNU's bash the standard. Things can be
 different.)



ksh's HISTFILE [was: Re: SSH, root can repeat commands with up arrow, others cannot]

2012-03-13 Thread Hugo Villeneuve
On Mon, Mar 12, 2012 at 01:03:54PM +0200, lilit-aibolit wrote:
 11.03.2012 21:43, Chris Bennett P?P8QP5Q:
 This started for me a while back.
 Login as root, I can repeat older commands with up down arrows.
 History command shows history.
 
 su -l otheruser
 
 Cannot use up down arrows to access history.
 History command shows correct history.
 
 Login remotely as otheruser.
 Same problem.
 
 Chris Bennett
 

 try to add this to your .profile:

 export HISTFILE=~/.sh_history

 and re-login.

 it is work for me and save all history after disconnect
 and start new session.

Has there been improvement in ksh's history file recently? Like
since 5.0?

Because last time I tried, it was unusable if you ran more than two
session concurently, as both shell would use the same file directly
which lead to odd behavior. Like you did up history in one shell,
and you would see a command entered in the other one. Very wierd
to grasp.

(50+ OpenBSD's apologist will email me right back to tell me that
it's a feature. It's not GNU's bash the standard. Things can be
different.)



Re: SSH, root can repeat commands with up arrow, others cannot

2012-03-12 Thread Stuart Henderson
On 2012-03-11, Tobias Ulmer tobi...@tmux.org wrote:
 On Sun, Mar 11, 2012 at 02:43:42PM -0500, Chris Bennett wrote:
 This started for me a while back.
 Login as root, I can repeat older commands with up down arrows.
 History command shows history.
 
 su -l otheruser
 
 Cannot use up down arrows to access history.
 History command shows correct history.

 You most likely set EDITOR to something containing vi. ksh parses that
 and switches to vi mode. IMO it's a disgusting feature, but that
 appears to be just me.

 set -o emacs
 set +o vi

I've wasted countless time because of this feature, it's probably
my no.1 annoyance with the OS. It used to be possible to set this
in a file sourced via ENV so it could be applied automatically,
but sudo now (rightly) prohibits passing this variable.

After using stupid things like EDITOR=/usr/bin/emacs-not-really
symlinked to vi for a while on some machines, I came up with this
approach instead. Does anyone else think this is worth the extra
bytes?

Index: bin/ksh/ksh.1
===
RCS file: /cvs/src/bin/ksh/ksh.1,v
retrieving revision 1.141
diff -u -p -r1.141 ksh.1
--- bin/ksh/ksh.1   3 Sep 2011 22:59:08 -   1.141
+++ bin/ksh/ksh.1   12 Mar 2012 09:37:28 -
@@ -1362,14 +1362,36 @@ This parameter is used by the interactiv
 and
 .Ic kill -l
 commands to format information columns.
+.It Ev EDITMODE
+If set, this parameter controls the command-line editing mode for interactive
+shells.
+If the last component of the path specified in this parameter contains
+the string
+.Dq vi ,
+.Dq emacs ,
+or
+.Dq gmacs ,
+the
+.Xr vi ,
+.Xr emacs ,
+or
+.Xr gmacs
+(Gosling emacs) editing mode is enabled, respectively.
+Also see the
+.Ev EDITOR
+and
+.Ev VISUAL
+parameters below.
 .It Ev EDITOR
 If the
 .Ev VISUAL
-parameter is not set, this parameter controls the command-line editing mode for
-interactive shells.
+and
+.Ev EDITMODE
+parameters are not set, this parameter controls the command-line editing mode
+for interactive shells.
 See the
-.Ev VISUAL
-parameter below for how this works.
+.Ev EDITMODE
+parameter above for how this works.
 .Pp
 Note:
 traditionally,
@@ -1381,8 +1403,9 @@ and
 was used to specify a (new-style) screen editor, such as
 .Xr vi 1 .
 Hence if
-.Ev VISUAL
-is set, it overrides
+.Ev VISUAL or
+.Ev EDITMODE
+are set, they override
 .Ev EDITOR .
 .It Ev ENV
 If this parameter is found to be set after any profile files are executed, the
@@ -1745,23 +1768,13 @@ set, or does not contain the absolute pa
 files are created in
 .Pa /tmp .
 .It Ev VISUAL
-If set, this parameter controls the command-line editing mode for interactive
-shells.
-If the last component of the path specified in this parameter contains
-the string
-.Dq vi ,
-.Dq emacs ,
-or
-.Dq gmacs ,
-the
-.Xr vi ,
-.Xr emacs ,
-or
-.Xr gmacs
-(Gosling emacs) editing mode is enabled, respectively.
-See also the
-.Ev EDITOR
-parameter, above.
+If the
+.Ev EDITMODE
+parameter is not set, this parameter controls the command-line editing mode
+for interactive shells.
+See the
+.Ev EDITMODE
+parameter above for how this works.
 .El
 .Ss Tilde expansion
 Tilde expansion, which is done in parallel with parameter substitution, is done
Index: bin/ksh/table.h
===
RCS file: /cvs/src/bin/ksh/table.h,v
retrieving revision 1.8
diff -u -p -r1.8 table.h
--- bin/ksh/table.h 19 Feb 2012 07:52:30 -  1.8
+++ bin/ksh/table.h 12 Mar 2012 09:37:28 -
@@ -170,6 +170,7 @@ extern const struct builtin shbuiltins [
 #define V_TMOUT15
 #define V_TMPDIR   16
 #define V_LINENO   17
+#define V_EDITMODE 18
 
 /* values for set_prompt() */
 #define PS10   /* command */
Index: bin/ksh/var.c
===
RCS file: /cvs/src/bin/ksh/var.c,v
retrieving revision 1.34
diff -u -p -r1.34 var.c
--- bin/ksh/var.c   15 Oct 2007 02:16:35 -  1.34
+++ bin/ksh/var.c   12 Mar 2012 09:37:28 -
@@ -96,6 +96,7 @@ initvar(void)
{ HISTSIZE,   V_HISTSIZE },
 #endif /* HISTORY */
 #ifdef EDIT
+   { EDITMODE,   V_EDITMODE },
{ EDITOR, V_EDITOR },
{ VISUAL, V_VISUAL },
 #endif /* EDIT */
@@ -1004,11 +1005,16 @@ setspec(struct tbl *vp)
break;
 #endif /* HISTORY */
 #ifdef EDIT
-   case V_VISUAL:
+   case V_EDITMODE:
set_editmode(str_val(vp));
break;
+   case V_VISUAL:
+   if (!(global(EDITMODE)-flag  ISSET))
+   set_editmode(str_val(vp));
+   break;
case V_EDITOR:
-   if (!(global(VISUAL)-flag  ISSET))
+   if ((!(global(EDITMODE)-flag  ISSET)) 
+   (!(global(VISUAL)-flag  ISSET)))

Re: SSH, root can repeat commands with up arrow, others cannot

2012-03-12 Thread Stuart Henderson
On 2012-03-11, Chris Bennett ch...@bennettconstruction.us wrote:
 On Sun, Mar 11, 2012 at 09:02:58PM +0100, Tobias Ulmer wrote:
 
 You most likely set EDITOR to something containing vi. ksh parses that
 and switches to vi mode. IMO it's a disgusting feature, but that
 appears to be just me.
 
  Wow, that is a disgusting pile of crap!
  alias mutt='env EDITOR=vim mutt'
  does the trick.

Plenty of things pick up EDITOR, I tried that approach for a while
but it soon became unmaintainable.
.



Re: SSH, root can repeat commands with up arrow, others cannot

2012-03-12 Thread Stuart Henderson
to be clear, this doesn't change anything unless the optional new
variable is set. users who are happy with the current behaviour
should just leave things as they are.

On 2012-03-12, Stuart Henderson s...@spacehopper.org wrote:
 On 2012-03-11, Tobias Ulmer tobi...@tmux.org wrote:
 On Sun, Mar 11, 2012 at 02:43:42PM -0500, Chris Bennett wrote:
 This started for me a while back.
 Login as root, I can repeat older commands with up down arrows.
 History command shows history.
 
 su -l otheruser
 
 Cannot use up down arrows to access history.
 History command shows correct history.

 You most likely set EDITOR to something containing vi. ksh parses that
 and switches to vi mode. IMO it's a disgusting feature, but that
 appears to be just me.

 set -o emacs
 set +o vi

 I've wasted countless time because of this feature, it's probably
 my no.1 annoyance with the OS. It used to be possible to set this
 in a file sourced via ENV so it could be applied automatically,
 but sudo now (rightly) prohibits passing this variable.

 After using stupid things like EDITOR=/usr/bin/emacs-not-really
 symlinked to vi for a while on some machines, I came up with this
 approach instead. Does anyone else think this is worth the extra
 bytes?

 Index: bin/ksh/ksh.1
===
 RCS file: /cvs/src/bin/ksh/ksh.1,v
 retrieving revision 1.141
 diff -u -p -r1.141 ksh.1
 --- bin/ksh/ksh.1 3 Sep 2011 22:59:08 -   1.141
 +++ bin/ksh/ksh.1 12 Mar 2012 09:37:28 -
 @@ -1362,14 +1362,36 @@ This parameter is used by the interactiv
  and
  .Ic kill -l
  commands to format information columns.
 +.It Ev EDITMODE
 +If set, this parameter controls the command-line editing mode for interactive
 +shells.
 +If the last component of the path specified in this parameter contains
 +the string
 +.Dq vi ,
 +.Dq emacs ,
 +or
 +.Dq gmacs ,
 +the
 +.Xr vi ,
 +.Xr emacs ,
 +or
 +.Xr gmacs
 +(Gosling emacs) editing mode is enabled, respectively.
 +Also see the
 +.Ev EDITOR
 +and
 +.Ev VISUAL
 +parameters below.
  .It Ev EDITOR
  If the
  .Ev VISUAL
 -parameter is not set, this parameter controls the command-line editing mode 
 for
 -interactive shells.
 +and
 +.Ev EDITMODE
 +parameters are not set, this parameter controls the command-line editing mode
 +for interactive shells.
  See the
 -.Ev VISUAL
 -parameter below for how this works.
 +.Ev EDITMODE
 +parameter above for how this works.
  .Pp
  Note:
  traditionally,
 @@ -1381,8 +1403,9 @@ and
  was used to specify a (new-style) screen editor, such as
  .Xr vi 1 .
  Hence if
 -.Ev VISUAL
 -is set, it overrides
 +.Ev VISUAL or
 +.Ev EDITMODE
 +are set, they override
  .Ev EDITOR .
  .It Ev ENV
  If this parameter is found to be set after any profile files are executed, 
 the
 @@ -1745,23 +1768,13 @@ set, or does not contain the absolute pa
  files are created in
  .Pa /tmp .
  .It Ev VISUAL
 -If set, this parameter controls the command-line editing mode for interactive
 -shells.
 -If the last component of the path specified in this parameter contains
 -the string
 -.Dq vi ,
 -.Dq emacs ,
 -or
 -.Dq gmacs ,
 -the
 -.Xr vi ,
 -.Xr emacs ,
 -or
 -.Xr gmacs
 -(Gosling emacs) editing mode is enabled, respectively.
 -See also the
 -.Ev EDITOR
 -parameter, above.
 +If the
 +.Ev EDITMODE
 +parameter is not set, this parameter controls the command-line editing mode
 +for interactive shells.
 +See the
 +.Ev EDITMODE
 +parameter above for how this works.
  .El
  .Ss Tilde expansion
  Tilde expansion, which is done in parallel with parameter substitution, is 
 done
 Index: bin/ksh/table.h
===
 RCS file: /cvs/src/bin/ksh/table.h,v
 retrieving revision 1.8
 diff -u -p -r1.8 table.h
 --- bin/ksh/table.h   19 Feb 2012 07:52:30 -  1.8
 +++ bin/ksh/table.h   12 Mar 2012 09:37:28 -
 @@ -170,6 +170,7 @@ extern const struct builtin shbuiltins [
  #define V_TMOUT  15
  #define V_TMPDIR 16
  #define V_LINENO 17
 +#define V_EDITMODE   18
  
  /* values for set_prompt() */
  #define PS1  0   /* command */
 Index: bin/ksh/var.c
===
 RCS file: /cvs/src/bin/ksh/var.c,v
 retrieving revision 1.34
 diff -u -p -r1.34 var.c
 --- bin/ksh/var.c 15 Oct 2007 02:16:35 -  1.34
 +++ bin/ksh/var.c 12 Mar 2012 09:37:28 -
 @@ -96,6 +96,7 @@ initvar(void)
   { HISTSIZE,   V_HISTSIZE },
  #endif /* HISTORY */
  #ifdef EDIT
 + { EDITMODE,   V_EDITMODE },
   { EDITOR, V_EDITOR },
   { VISUAL, V_VISUAL },
  #endif /* EDIT */
 @@ -1004,11 +1005,16 @@ setspec(struct tbl *vp)
   break;
  #endif /* HISTORY */
  #ifdef EDIT
 - case V_VISUAL:
 + case V_EDITMODE:
   set_editmode(str_val(vp));
   break;
 + case V_VISUAL:
 + 

Re: SSH, root can repeat commands with up arrow, others cannot

2012-03-12 Thread lilit-aibolit

11.03.2012 21:43, Chris Bennett P?P8QP5Q:

This started for me a while back.
Login as root, I can repeat older commands with up down arrows.
History command shows history.

su -l otheruser

Cannot use up down arrows to access history.
History command shows correct history.

Login remotely as otheruser.
Same problem.

Chris Bennett


.



try to add this to your .profile:

export HISTFILE=~/.sh_history

and re-login.

it is work for me and save all history after disconnect
and start new session.



Re: SSH, root can repeat commands with up arrow, others cannot

2012-03-12 Thread Chris Bennett
On Mon, Mar 12, 2012 at 10:09:13AM +, Stuart Henderson wrote:
 
 I've wasted countless time because of this feature, it's probably
 my no.1 annoyance with the OS. It used to be possible to set this
 in a file sourced via ENV so it could be applied automatically,
 but sudo now (rightly) prohibits passing this variable.
 
 After using stupid things like EDITOR=/usr/bin/emacs-not-really
 symlinked to vi for a while on some machines, I came up with this
 approach instead. Does anyone else think this is worth the extra
 bytes?
 
 Index: bin/ksh/ksh.1
 ===
 RCS file: /cvs/src/bin/ksh/ksh.1,v
 retrieving revision 1.141
 diff -u -p -r1.141 ksh.1
 --- bin/ksh/ksh.1 3 Sep 2011 22:59:08 -   1.141
 +++ bin/ksh/ksh.1 12 Mar 2012 09:37:28 -
 @@ -1362,14 +1362,36 @@ This parameter is used by the interactiv
  and
  .Ic kill -l
  commands to format information columns.
 +.It Ev EDITMODE
 +If set, this parameter controls the command-line editing mode for interactive
 +shells.
 +If the last component of the path specified in this parameter contains
 +the string
 +.Dq vi ,
 +.Dq emacs ,
 +or
 +.Dq gmacs ,
 +the
 +.Xr vi ,
 +.Xr emacs ,
 +or
 +.Xr gmacs
 +(Gosling emacs) editing mode is enabled, respectively.
 +Also see the
 +.Ev EDITOR
 +and
 +.Ev VISUAL
 +parameters below.
  .It Ev EDITOR
  If the
  .Ev VISUAL
 -parameter is not set, this parameter controls the command-line editing mode 
 for
 -interactive shells.
 +and
 +.Ev EDITMODE
 +parameters are not set, this parameter controls the command-line editing mode
 +for interactive shells.
  See the
 -.Ev VISUAL
 -parameter below for how this works.
 +.Ev EDITMODE
 +parameter above for how this works.
  .Pp
  Note:
  traditionally,
 @@ -1381,8 +1403,9 @@ and
  was used to specify a (new-style) screen editor, such as
  .Xr vi 1 .
  Hence if
 -.Ev VISUAL
 -is set, it overrides
 +.Ev VISUAL or
 +.Ev EDITMODE
 +are set, they override
  .Ev EDITOR .
  .It Ev ENV
  If this parameter is found to be set after any profile files are executed, 
 the
 @@ -1745,23 +1768,13 @@ set, or does not contain the absolute pa
  files are created in
  .Pa /tmp .
  .It Ev VISUAL
 -If set, this parameter controls the command-line editing mode for interactive
 -shells.
 -If the last component of the path specified in this parameter contains
 -the string
 -.Dq vi ,
 -.Dq emacs ,
 -or
 -.Dq gmacs ,
 -the
 -.Xr vi ,
 -.Xr emacs ,
 -or
 -.Xr gmacs
 -(Gosling emacs) editing mode is enabled, respectively.
 -See also the
 -.Ev EDITOR
 -parameter, above.
 +If the
 +.Ev EDITMODE
 +parameter is not set, this parameter controls the command-line editing mode
 +for interactive shells.
 +See the
 +.Ev EDITMODE
 +parameter above for how this works.
  .El
  .Ss Tilde expansion
  Tilde expansion, which is done in parallel with parameter substitution, is 
 done
 Index: bin/ksh/table.h
 ===
 RCS file: /cvs/src/bin/ksh/table.h,v
 retrieving revision 1.8
 diff -u -p -r1.8 table.h
 --- bin/ksh/table.h   19 Feb 2012 07:52:30 -  1.8
 +++ bin/ksh/table.h   12 Mar 2012 09:37:28 -
 @@ -170,6 +170,7 @@ extern const struct builtin shbuiltins [
  #define V_TMOUT  15
  #define V_TMPDIR 16
  #define V_LINENO 17
 +#define V_EDITMODE   18
  
  /* values for set_prompt() */
  #define PS1  0   /* command */
 Index: bin/ksh/var.c
 ===
 RCS file: /cvs/src/bin/ksh/var.c,v
 retrieving revision 1.34
 diff -u -p -r1.34 var.c
 --- bin/ksh/var.c 15 Oct 2007 02:16:35 -  1.34
 +++ bin/ksh/var.c 12 Mar 2012 09:37:28 -
 @@ -96,6 +96,7 @@ initvar(void)
   { HISTSIZE,   V_HISTSIZE },
  #endif /* HISTORY */
  #ifdef EDIT
 + { EDITMODE,   V_EDITMODE },
   { EDITOR, V_EDITOR },
   { VISUAL, V_VISUAL },
  #endif /* EDIT */
 @@ -1004,11 +1005,16 @@ setspec(struct tbl *vp)
   break;
  #endif /* HISTORY */
  #ifdef EDIT
 - case V_VISUAL:
 + case V_EDITMODE:
   set_editmode(str_val(vp));
   break;
 + case V_VISUAL:
 + if (!(global(EDITMODE)-flag  ISSET))
 + set_editmode(str_val(vp));
 + break;
   case V_EDITOR:
 - if (!(global(VISUAL)-flag  ISSET))
 + if ((!(global(EDITMODE)-flag  ISSET)) 
 + (!(global(VISUAL)-flag  ISSET)))
   set_editmode(str_val(vp));
   break;
   case V_COLUMNS:
 Index: usr.bin/sudo/sudoers
 ===
 RCS file: /cvs/src/usr.bin/sudo/sudoers,v
 retrieving revision 1.25
 diff -u -p -r1.25 sudoers
 --- usr.bin/sudo/sudoers  26 Oct 2009 19:28:26 -  1.25
 +++ usr.bin/sudo/sudoers  12 Mar 2012 09:37:28 -
 

Re: SSH, root can repeat commands with up arrow, others cannot

2012-03-11 Thread Alexander Hall

On 03/11/12 20:43, Chris Bennett wrote:

This started for me a while back.
Login as root, I can repeat older commands with up down arrows.
History command shows history.

su -l otheruser

Cannot use up down arrows to access history.
History command shows correct history.

Login remotely as otheruser.
Same problem.

Chris Bennett



check the HISTFILE variable in the shell. probably set in /root/.profile 
or any of the likes.


/Alexander



Re: SSH, root can repeat commands with up arrow, others cannot

2012-03-11 Thread patrick keshishian
On Sun, Mar 11, 2012 at 12:43 PM, Chris Bennett
ch...@bennettconstruction.us wrote:
 This started for me a while back.
 Login as root, I can repeat older commands with up down arrows.
 History command shows history.

 su -l otheruser

 Cannot use up down arrows to access history.
 History command shows correct history.

 Login remotely as otheruser.
 Same problem.

 Chris Bennett

What shell are you using for the users and root? ksh? do you have
HISTORY set for root?

--patrick



Re: SSH, root can repeat commands with up arrow, others cannot

2012-03-11 Thread Tobias Ulmer
On Sun, Mar 11, 2012 at 02:43:42PM -0500, Chris Bennett wrote:
 This started for me a while back.
 Login as root, I can repeat older commands with up down arrows.
 History command shows history.
 
 su -l otheruser
 
 Cannot use up down arrows to access history.
 History command shows correct history.

You most likely set EDITOR to something containing vi. ksh parses that
and switches to vi mode. IMO it's a disgusting feature, but that
appears to be just me.

set -o emacs
set +o vi

 
 Login remotely as otheruser.
 Same problem.
 
 Chris Bennett



Re: SSH, root can repeat commands with up arrow, others cannot

2012-03-11 Thread Andres Perera
On Sun, Mar 11, 2012 at 3:32 PM, Tobias Ulmer tobi...@tmux.org wrote:
 On Sun, Mar 11, 2012 at 02:43:42PM -0500, Chris Bennett wrote:
 This started for me a while back.
 Login as root, I can repeat older commands with up down arrows.
 History command shows history.

 su -l otheruser

 Cannot use up down arrows to access history.
 History command shows correct history.

 You most likely set EDITOR to something containing vi. ksh parses that
 and switches to vi mode. IMO it's a disgusting feature, but that
 appears to be just me.

 set -o emacs
 set +o vi

after `set -o emacs`, the final line is redundant



 Login remotely as otheruser.
 Same problem.

 Chris Bennett



Re: SSH, root can repeat commands with up arrow, others cannot

2012-03-11 Thread Chris Bennett
On Sun, Mar 11, 2012 at 09:02:58PM +0100, Tobias Ulmer wrote:
 
 You most likely set EDITOR to something containing vi. ksh parses that
 and switches to vi mode. IMO it's a disgusting feature, but that
 appears to be just me.
 
 Wow, that is a disgusting pile of crap!

 alias mutt='env EDITOR=vim mutt'

 does the trick.

 Thanks!
 Chris Bennett



Re: Copy root partition to another machine

2011-11-07 Thread Benny Lofgren
On 2011-11-06 21.42, David Vasek wrote:
 On Sun, 6 Nov 2011, Benny Lofgren wrote:
 On 2011-11-06 18.00, Bambero wrote:
 Thanks, but without skip=1 dd will copy partition table and mbr too
 (first block 521b).
 So it may damage my partition table on second machine. I'm I wrong ?

 No, you will not copy the partition table with your command, since
 you are using wd0a. That partition starts after the boot sector(s)
 and partition table, so what you're in fact doing is skipping the
 first blocks of the file system that is on partition a of wd0. Which
 you don't want to do. (If you had used wd0c on the other hand, you
 would have gotten the disk partition metadata as well. But you don't
 want that either.)

[...]
 
 Benny, with this you will overwrite the disklabel of whole target disk,
 as the disklabel in a typical case indeed resides at the beginning of
 the wd0a. See disklabel(5).

Ah, you are absolutely correct, thanks. Please ignore my previous advice!

(Except the part about seek= and skip= not operating on 512 byte block
sizes but on the block size set by bs=/ibs=/obs=, that one will bite
anyone not paying attention to detail.)

Sorry for spreading FUD. (Although I can't really seem to find this out
from just reading disklabel(5) (I did check prior to my last comment), but
then again my brain's English language center might very well be somewhat
deficient...)

The best bet is probably to either go the dump/restore route like someone
suggested or simply save the target disk's label to file using something
like disklabel wd1 /tmp/disklabel.wd1 and then restoring it after dd
with disklabel -R wd1 /tmp/disklabel.wd1 (since the in-core copy of the
original disk label will keep the working layout, there is no risk involved
with temporarily overwriting the label as long as it is restored prior to
the new disk's partitions being used).


Regards,
/Benny

-- 
internetlabbet.se / work:   +46 8 551 124 80  / Words must
Benny Lofgren/  mobile: +46 70 718 11 90 /   be weighed,
/   fax:+46 8 551 124 89/not counted.
   /email:  benny -at- internetlabbet.se



Re: Copy root partition to another machine

2011-11-07 Thread Otto Moerbeek
On Mon, Nov 07, 2011 at 03:54:14PM +0100, Benny Lofgren wrote:

 On 2011-11-06 21.42, David Vasek wrote:
  On Sun, 6 Nov 2011, Benny Lofgren wrote:
  On 2011-11-06 18.00, Bambero wrote:
  Thanks, but without skip=1 dd will copy partition table and mbr too
  (first block 521b).
  So it may damage my partition table on second machine. I'm I wrong ?
 
  No, you will not copy the partition table with your command, since
  you are using wd0a. That partition starts after the boot sector(s)
  and partition table, so what you're in fact doing is skipping the
  first blocks of the file system that is on partition a of wd0. Which
  you don't want to do. (If you had used wd0c on the other hand, you
  would have gotten the disk partition metadata as well. But you don't
  want that either.)
 
 [...]
  
  Benny, with this you will overwrite the disklabel of whole target disk,
  as the disklabel in a typical case indeed resides at the beginning of
  the wd0a. See disklabel(5).
 
 Ah, you are absolutely correct, thanks. Please ignore my previous advice!
 
 (Except the part about seek= and skip= not operating on 512 byte block
 sizes but on the block size set by bs=/ibs=/obs=, that one will bite
 anyone not paying attention to detail.)
 
 Sorry for spreading FUD. (Although I can't really seem to find this out
 from just reading disklabel(5) (I did check prior to my last comment), but
 then again my brain's English language center might very well be somewhat
 deficient...)
 
 The best bet is probably to either go the dump/restore route like someone
 suggested or simply save the target disk's label to file using something
 like disklabel wd1 /tmp/disklabel.wd1 and then restoring it after dd
 with disklabel -R wd1 /tmp/disklabel.wd1 (since the in-core copy of the
 original disk label will keep the working layout, there is no risk involved
 with temporarily overwriting the label as long as it is restored prior to
 the new disk's partitions being used).

There's also /etc/daily, you can get some inspiration from the
ROOTBACKUP part of it. 

-Otto

 
 
 Regards,
 /Benny
 
 -- 
 internetlabbet.se / work:   +46 8 551 124 80  / Words must
 Benny Lofgren/  mobile: +46 70 718 11 90 /   be weighed,
 /   fax:+46 8 551 124 89/not counted.
/email:  benny -at- internetlabbet.se



Re: Copy root partition to another machine

2011-11-07 Thread Raimo Niskanen
On Mon, Nov 07, 2011 at 04:03:37PM +0100, Otto Moerbeek wrote:
 On Mon, Nov 07, 2011 at 03:54:14PM +0100, Benny Lofgren wrote:
 
  On 2011-11-06 21.42, David Vasek wrote:
   On Sun, 6 Nov 2011, Benny Lofgren wrote:
   On 2011-11-06 18.00, Bambero wrote:
   Thanks, but without skip=1 dd will copy partition table and mbr too
   (first block 521b).
   So it may damage my partition table on second machine. I'm I wrong ?
  
   No, you will not copy the partition table with your command, since
   you are using wd0a. That partition starts after the boot sector(s)
   and partition table, so what you're in fact doing is skipping the
   first blocks of the file system that is on partition a of wd0. Which
   you don't want to do. (If you had used wd0c on the other hand, you
   would have gotten the disk partition metadata as well. But you don't
   want that either.)
  
  [...]
   
   Benny, with this you will overwrite the disklabel of whole target disk,
   as the disklabel in a typical case indeed resides at the beginning of
   the wd0a. See disklabel(5).
  
  Ah, you are absolutely correct, thanks. Please ignore my previous advice!
  
  (Except the part about seek= and skip= not operating on 512 byte block
  sizes but on the block size set by bs=/ibs=/obs=, that one will bite
  anyone not paying attention to detail.)
  
  Sorry for spreading FUD. (Although I can't really seem to find this out
  from just reading disklabel(5) (I did check prior to my last comment), but
  then again my brain's English language center might very well be somewhat
  deficient...)
  
  The best bet is probably to either go the dump/restore route like someone
  suggested or simply save the target disk's label to file using something
  like disklabel wd1 /tmp/disklabel.wd1 and then restoring it after dd
  with disklabel -R wd1 /tmp/disklabel.wd1 (since the in-core copy of the
  original disk label will keep the working layout, there is no risk involved
  with temporarily overwriting the label as long as it is restored prior to
  the new disk's partitions being used).
 
 There's also /etc/daily, you can get some inspiration from the
 ROOTBACKUP part of it. 

Especially these lines:
sync
dd if=/dev/r$rootdev of=/dev/r$rootbak bs=16b seek=1 skip=1 \
conv=noerror
fsck -y /dev/r$rootbak
that looks very much like what triggered the OP's question.

Note; sync before, dd that skips disklabel on filesystem mounted read-write,
fsck -y after to fix inconsistencies due to that. Dirty but practical.

I am myself curious to know if the 16 sectors are unused by all
4.2BSD filesystem partitions or if this is true only for partition 'a'.
Also, what if 'a' is RAID, or if e.g 'd' is the first used partition?

 
   -Otto
 
  
  
  Regards,
  /Benny
  
  -- 
  internetlabbet.se / work:   +46 8 551 124 80  / Words must
  Benny Lofgren/  mobile: +46 70 718 11 90 /   be weighed,
  /   fax:+46 8 551 124 89/not counted.
 /email:  benny -at- internetlabbet.se

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB



Re: Copy root partition to another machine

2011-11-06 Thread Bambero
Thanks, but without skip=1 dd will copy partition table and mbr too
(first block 521b).
So it may damage my partition table on second machine. I'm I wrong ?

On Fri, Nov 4, 2011 at 6:25 PM, Marc Smith marc_sm...@gmx.com wrote:
 dd if=/dev/wd0a of=root.img bs=32m [or compress it using: dd
 if=/dev/wd0a bs=32m | gzip  root.img.gz]

 and

 dd if=root.img of=/dev/wd0a bs=32m [decompression: gzip -d -c
 root.img.gz | dd of=/dev/wd0a bs=32m]

 And yes, you can ommit additional values.

 Dnia piD , 4 lis 2011, 17:43:28 Bambero pisze:
 Hello

 I want to copy my root partition to another with dd without ssh. Is
 this correct:

 1. On first machine:
 dd if=/dev/rwd0a of=root.img bs=16b skip=1 conv=noerror

 2. On second machine:
 dd if=root.img of=/dev/rwd0a bs=16b seek=1

 May/should I ommit seek, skip, conv, bs  parameters ?

 Regards,
 Bambero



Re: Copy root partition to another machine

2011-11-06 Thread Marc Smith
Well, to me the point of using DD is to save everything in one file: 
filesystem, boot sectors, etc. Otherwise I'd probobly use dump, as 
someone else suggested, or other backup tool. Saving additional info 
[MBR, PBR] is not a problem, you can always restore your system using 
'skip' parameter [skipping MBR info]. That'd make you go

Dnia nie, 6 lis 2011, 18:00:45 Bambero pisze:
 Thanks, but without skip=1 dd will copy partition table and mbr too
 (first block 521b).
 So it may damage my partition table on second machine. I'm I wrong ?

 On Fri, Nov 4, 2011 at 6:25 PM, Marc Smith marc_sm...@gmx.com wrote:
 dd if=/dev/wd0a of=root.img bs=32m [or compress it using: dd
 if=/dev/wd0a bs=32m | gzip  root.img.gz]

 and

 dd if=root.img of=/dev/wd0a bs=32m [decompression: gzip -d -c
 root.img.gz | dd of=/dev/wd0a bs=32m]

 And yes, you can ommit additional values.

 Dnia piD , 4 lis 2011, 17:43:28 Bambero pisze:
 Hello

 I want to copy my root partition to another with dd without ssh. Is
 this correct:

 1. On first machine:
 dd if=/dev/rwd0a of=root.img bs=16b skip=1 conv=noerror

 2. On second machine:
 dd if=root.img of=/dev/rwd0a bs=16b seek=1

 May/should I ommit seek, skip, conv, bs  parameters ?

 Regards,
 Bambero



Re: Copy root partition to another machine

2011-11-06 Thread Benny Lofgren
On 2011-11-06 18.00, Bambero wrote:
 Thanks, but without skip=1 dd will copy partition table and mbr too
 (first block 521b).
 So it may damage my partition table on second machine. I'm I wrong ?

No, you will not copy the partition table with your command, since
you are using wd0a. That partition starts after the boot sector(s)
and partition table, so what you're in fact doing is skipping the
first blocks of the file system that is on partition a of wd0. Which
you don't want to do. (If you had used wd0c on the other hand, you
would have gotten the disk partition metadata as well. But you don't
want that either.)

By the way, seek= and skip= gets multiplied by whatever block size you
set (in your case, 16b == 16 x 512 == 8 Kb) so you're not even skipping
the first sector which you think but the first 16 sectors.

Also, don't use the block device when doing this, use the raw (character)
device.

And, and I hope this goes without saying, DON'T DO THIS ON A MOUNTED DEVICE.

So, skip the skip.   Just do the following:

On the source machine:

Boot from something other than your root disk, or boot into single user
mode and remount root read-only. Then:

dd if=/dev/rwd0a of=/tmp/root.img bs=16m

On the target machine, booted from some install media:

dd if=/your/tmp/drive/root.img of=/dev/rwd0a bs=16m


Regards,
/Benny


 On Fri, Nov 4, 2011 at 6:25 PM, Marc Smith marc_sm...@gmx.com wrote:
 dd if=/dev/wd0a of=root.img bs=32m [or compress it using: dd
 if=/dev/wd0a bs=32m | gzip  root.img.gz]

 and

 dd if=root.img of=/dev/wd0a bs=32m [decompression: gzip -d -c
 root.img.gz | dd of=/dev/wd0a bs=32m]

 And yes, you can ommit additional values.

 Dnia piD , 4 lis 2011, 17:43:28 Bambero pisze:
 Hello

 I want to copy my root partition to another with dd without ssh. Is
 this correct:

 1. On first machine:
 dd if=/dev/rwd0a of=root.img bs=16b skip=1 conv=noerror

 2. On second machine:
 dd if=root.img of=/dev/rwd0a bs=16b seek=1

 May/should I ommit seek, skip, conv, bs  parameters ?

 Regards,
 Bambero
 

-- 
internetlabbet.se / work:   +46 8 551 124 80  / Words must
Benny Lofgren/  mobile: +46 70 718 11 90 /   be weighed,
/   fax:+46 8 551 124 89/not counted.
   /email:  benny -at- internetlabbet.se



Re: Copy root partition to another machine

2011-11-06 Thread David Vasek

On Sun, 6 Nov 2011, Benny Lofgren wrote:


On 2011-11-06 18.00, Bambero wrote:

Thanks, but without skip=1 dd will copy partition table and mbr too
(first block 521b).
So it may damage my partition table on second machine. I'm I wrong ?


No, you will not copy the partition table with your command, since
you are using wd0a. That partition starts after the boot sector(s)
and partition table, so what you're in fact doing is skipping the
first blocks of the file system that is on partition a of wd0. Which
you don't want to do. (If you had used wd0c on the other hand, you
would have gotten the disk partition metadata as well. But you don't
want that either.)

By the way, seek= and skip= gets multiplied by whatever block size you
set (in your case, 16b == 16 x 512 == 8 Kb) so you're not even skipping
the first sector which you think but the first 16 sectors.

Also, don't use the block device when doing this, use the raw (character)
device.

And, and I hope this goes without saying, DON'T DO THIS ON A MOUNTED DEVICE.

So, skip the skip.   Just do the following:

On the source machine:

Boot from something other than your root disk, or boot into single user
mode and remount root read-only. Then:

dd if=/dev/rwd0a of=/tmp/root.img bs=16m

On the target machine, booted from some install media:

dd if=/your/tmp/drive/root.img of=/dev/rwd0a bs=16m


Benny, with this you will overwrite the disklabel of whole target disk, as 
the disklabel in a typical case indeed resides at the beginning of the 
wd0a. See disklabel(5).


Regards,
David



Re: Copy root partition to another machine

2011-11-04 Thread Marc Smith
dd if=/dev/wd0a of=root.img bs=32m [or compress it using: dd 
if=/dev/wd0a bs=32m | gzip  root.img.gz]

and

dd if=root.img of=/dev/wd0a bs=32m [decompression: gzip -d -c 
root.img.gz | dd of=/dev/wd0a bs=32m]

And yes, you can ommit additional values.

Dnia piD, 4 lis 2011, 17:43:28 Bambero pisze:
 Hello

 I want to copy my root partition to another with dd without ssh. Is
 this correct:

 1. On first machine:
 dd if=/dev/rwd0a of=root.img bs=16b skip=1 conv=noerror

 2. On second machine:
 dd if=root.img of=/dev/rwd0a bs=16b seek=1

 May/should I ommit seek, skip, conv, bs  parameters ?

 Regards,
 Bambero



Re: Copy root partition to another machine

2011-11-04 Thread Josh Grosse
Bambero bambero at gmail.com writes:

 
 Hello
 
 I want to copy my root partition to another with dd without ssh. Is
 this correct:
 
 1. On first machine:
 dd if=/dev/rwd0a of=root.img bs=16b skip=1 conv=noerror
 
 2. On second machine:
 dd if=root.img of=/dev/rwd0a bs=16b seek=1
 
 May/should I ommit seek, skip, conv, bs  parameters ?

You've already received a recommendation for simpler use of dd(1), including
compression for the partition image.

But, dd(1) will not prepare your boot blocks.  To make this bootable on i386 or
amd64, flag the OpenBSD MBR partition active with fdisk(8) and use
installboot(8) to install the PBR and aim it at the second stage bootloader.



Re: Copy root partition to another machine

2011-11-04 Thread Norman Golisz
On Fri Nov  4 2011 17:43, Bambero wrote:
 Hello
 
 I want to copy my root partition to another with dd without ssh. Is
 this correct:
 
 1. On first machine:
 dd if=/dev/rwd0a of=root.img bs=16b skip=1 conv=noerror
 
 2. On second machine:
 dd if=root.img of=/dev/rwd0a bs=16b seek=1
 
 May/should I ommit seek, skip, conv, bs  parameters ?

I'd recommend the use of dump(8) and restore(8).
This has the advantage of only copying occupied bytes of your
filesystem, which can drastically reduce the output's size and time
required. Further, you don't run into issues when restoring your fs into
a freshly created partition on a different machine, with a possibly
different hard drive model and different geometry layout. You can even
decide to change fs parameters before restoring your dump.
Much more robust than dd'ing in this case.

Finally, as others pointed out already, installboot(8) the boot blocks
for your machine.

Norman.



Re: ports/root/make install

2010-10-21 Thread J Sisson
On Thu, Oct 21, 2010 at 12:20 PM, Jay K jay.kr...@cornell.edu wrote:

  ssh r...@localhost cd `pwd`  make install


From man mk.conf:

 SUDO   Command run by make(1) when doing certain
operations requiring root privileges (e.g. the
make install portion of make build).  If set
to /usr/bin/sudo, this allows one to run make
build as a user other than root (assuming sudo
is
set up for that user).



Re: ports/root/make install

2010-10-21 Thread Jay K
sudo won't work for me -- root password is *.
I'll have to try it with ssh r...@localhost, which will work.

Thanks,
 - Jay



 Date: Thu, 21 Oct 2010 12:30:32 -0500
 Subject: Re: ports/root/make install
 From: sisso...@gmail.com
 To: jay.kr...@cornell.edu
 CC: misc@openbsd.org

 On Thu, Oct 21, 2010 at 12:20 PM, Jay K
  wrote:
 ssh r...@localhost cd `pwd`  make install


 From man mk.conf:

 SUDO Command run by make(1) when doing certain
 operations requiring root privileges (e.g. the
 make install portion of make build). If set
 to /usr/bin/sudo, this allows one to run make
 build as a user other than root (assuming
 sudo is
 set up for that user).



Re: ports/root/make install

2010-10-21 Thread Tomas Bodzar
On Thu, Oct 21, 2010 at 8:33 PM, Jay K jay.kr...@cornell.edu wrote:
 sudo won't work for me -- root password is *.
 I'll have to try it with ssh r...@localhost, which will work.

You must read this first http://www.openbsd.org/faq/faq15.html#Ports
then you will have correct setup and for system you need to read at
least man afterboot



 Thanks,
 B - Jay


 
 Date: Thu, 21 Oct 2010 12:30:32 -0500
 Subject: Re: ports/root/make install
 From: sisso...@gmail.com
 To: jay.kr...@cornell.edu
 CC: misc@openbsd.org

 On Thu, Oct 21, 2010 at 12:20 PM, Jay K
  wrote:
 ssh r...@localhost cd `pwd`  make install


 From man mk.conf:

 SUDO Command run by make(1) when doing certain
 operations requiring root privileges (e.g. the
 make install portion of make build). If set
 to /usr/bin/sudo, this allows one to run make
 build as a user other than root (assuming
 sudo is
 set up for that user).





--
bIf youbre good at something, never do it for free.bB bThe Joker



Re: ports/root/make install

2010-10-21 Thread Dan Harnett
On Thu, Oct 21, 2010 at 05:33:24PM +, Jay K wrote:
 sudo won't work for me -- root password is *.
 I'll have to try it with ssh r...@localhost, which will work.

sudo prompts you for the password to your user account, not the root
account.  Also, you can setup sudo to not require a password for
whatever commands it needs to run when building a port.



Re: ports/root/make install

2010-10-21 Thread Ted Unangst
On Thu, Oct 21, 2010 at 1:33 PM, Jay K jay.kr...@cornell.edu wrote:
 sudo won't work for me -- root password is *.

The root password has nothing to do with sudo.



Re: ports/root/make install

2010-10-21 Thread Jay K
I thought it'd need me to enter it.
  And there isn't one.

Thanks,
 - Jay

 Date: Thu, 21 Oct 2010 15:09:25 -0400
 Subject: Re: ports/root/make install
 From: ted.unan...@gmail.com
 To: jay.kr...@cornell.edu
 CC: sisso...@gmail.com; misc@openbsd.org

 On Thu, Oct 21, 2010 at 1:33 PM, Jay K jay.kr...@cornell.edu wrote:
  sudo won't work for me -- root password is *.

 The root password has nothing to do with sudo.



Re: ports/root/make install

2010-10-21 Thread roberth
On Thu, 21 Oct 2010 19:25:42 +
Jay K jay.kr...@cornell.edu wrote:

 I thought it'd need me to enter it.
   And there isn't one.
 
 Thanks,
  - Jay
 
  Date: Thu, 21 Oct 2010 15:09:25 -0400
  Subject: Re: ports/root/make install
  From: ted.unan...@gmail.com
  To: jay.kr...@cornell.edu
  CC: sisso...@gmail.com; misc@openbsd.org
 
  On Thu, Oct 21, 2010 at 1:33 PM, Jay K jay.kr...@cornell.edu
  wrote:
   sudo won't work for me -- root password is *.
 
  The root password has nothing to do with sudo.
 

sudo still asks for the executing users password, not root's.
maybe you want to uncomment
%wheel  ALL=(ALL) NOPASSWD: SETENV: ALL
in /etc/sudoers.conf to get your barn doors wide open scenario.



Re: Change root password from shell-script

2010-01-28 Thread Julian Leyh

Am 27.01.10 18:14, schrieb Paul Branston:

A little more generic in case there is no usermod -p

PASSWORD=$(echo my_new_password | encrypt -b 6)
perl -p -i.bk -e  's/^root:.*?:/root:$PASSWORD:/' /etc/shadow



/etc/shadow: no such file



Re: Change root password from shell-script

2010-01-27 Thread Gregory Edigarov
On Wed, 27 Jan 2010 17:05:17 +0100
Jordi Espasa Clofent jordi.esp...@opengea.org wrote:

 HI all,
 
 ?Is there any way t change the root password using a shell-script
 (aka non-interactive mod as passwd uses)?
 
 I've used pw in FreeBSD and chpasswd in Debian GNU/Linux to do it,
 bit I've not found a way/command to do it with my OpenBSD boxes.
 
 At present my approach will be install except from ports and use it
 to get my goal.
 
Have you looked at man usermod? -p flag in particular. 

-- 
With best regards,
Gregory Edigarov



Re: Change root password from shell-script

2010-01-27 Thread Jordi Espasa Clofent

Have you looked at man usermod? -p flag in particular.


Shame on me, indeed. It has been a game:

#!/bin/sh
PASSWORD=$(echo my_new_password | encrypt -b 6)
usermod -p $PASSWORD root

Thanks.

--
I must not fear. Fear is the mind-killer. Fear is the little-death that 
brings total obliteration. I will face my fear. I will permit it to pass 
over me and through me. And when it has gone past I will turn the inner 
eye to see its path. Where the fear has gone there will be nothing. Only 
I will remain.


Bene Gesserit Litany Against Fear.



Re: Change root password from shell-script

2010-01-27 Thread Paul Branston
On Wed, Jan 27, 2010 at 05:48:15PM +0100, Jordi Espasa Clofent wrote:
 Have you looked at man usermod? -p flag in particular.

 Shame on me, indeed. It has been a game:

 #!/bin/sh
 PASSWORD=$(echo my_new_password | encrypt -b 6)
 usermod -p $PASSWORD root


A little more generic in case there is no usermod -p

PASSWORD=$(echo my_new_password | encrypt -b 6)
perl -p -i.bk -e  's/^root:.*?:/root:$PASSWORD:/' /etc/shadow



Re: Change root password from shell-script

2010-01-27 Thread Brynet
Paul Branston wrote:
 A little more generic in case there is no usermod -p
 
 PASSWORD=$(echo my_new_password | encrypt -b 6)
 perl -p -i.bk -e  's/^root:.*?:/root:$PASSWORD:/' /etc/shadow

Wow,

Question: are you even using OpenBSD?

-Bryan.



Re: Change root password from shell-script

2010-01-27 Thread Chris Dukes
On Wed, Jan 27, 2010 at 05:14:51PM +, Paul Branston wrote:
 On Wed, Jan 27, 2010 at 05:48:15PM +0100, Jordi Espasa Clofent wrote:
  Have you looked at man usermod? -p flag in particular.
 
  Shame on me, indeed. It has been a game:
 
  #!/bin/sh
  PASSWORD=$(echo my_new_password | encrypt -b 6)
  usermod -p $PASSWORD root
 
 
 A little more generic in case there is no usermod -p
 
 PASSWORD=$(echo my_new_password | encrypt -b 6)
 perl -p -i.bk -e  's/^root:.*?:/root:$PASSWORD:/' /etc/shadow

Breaks on AIX :-).  Breaks with NIS and LDAP as well :-).

I've always had the pipe dream of there being a chpasswd(8)
on *BSD like there is on current AIX and Linux distros.
But usually there isn't that much headache using something like usermod.


 

-- 
Chris Dukes



Re: the root is on

2010-01-18 Thread Manuel Giraud
Brad Tilley b...@16systems.com writes:

 Not sure I understand, but I have similar softraid crypto setups and
 there's no need to boot bsd.rd to edit /etc/fstab. When booting bsd or
 bsd.mp and you are dumped to sh to run bioctl, use ed to correct
 /etc/fstab there.

Yes, but I cannot edit /etc/fstab from here since the root_device is
mounted read-only.

In fact, I first do a mount -uw / and now I can edit fstab. But if the
root_device (as detected by kernel) is not what is said in fstab then
this won't work.

-- 
Manuel Giraud



Re: the root is on

2010-01-18 Thread Manuel Giraud
Raimo Niskanen raimo+open...@erix.ericsson.se writes:

 You can always mount -t ffs / /dev/sd1a.

Thanks for that! I didn't want to mess the real /etc/rc so I end up with
the following script that I put in /bin.
#!/bin/ksh

set_kbd() {
local _layout _resp _default=1

[[ -x /sbin/kbd ]] || return
while :; do
echo -n Keyboard layout (1: fr; 2: fr.dvorak; 3: us)? [$_default] 
read _resp  : ${_resp:=$_default}
case $_resp in
1) _layout=fr ;;
2) _layout=fr.dvorak ;;
3) _layout=us ;;
esac
[[ -z $_layout ]] || { /sbin/kbd $_layout  break; }
done
}

# Set ROOT and RAID global var
get_devname() {
local _str _arr

_str=`ed -s !dmesg EOF
/^root on/,p
q
EOF`
set -A _arr $_str

ROOT=${_arr[2]}
RAID=${ROOT%%a*}d
}

build_fstab() {
cat EOF  /etc/fstab
/dev/${ROOT} / ffs rw 1 1
swap /tmp mfs rw,nodev,nosuid,-s=40960 0 0
/dev/${DECRYPT}f /home ffs rw,nodev,nosuid,noatime,softdep 1 2
/dev/${DECRYPT}e /usr ffs rw,nodev,noatime,softdep 1 2
/dev/${DECRYPT}d /var ffs rw,nodev,nosuid,noatime,softdep 1 2
EOF
}

decrypt() {
local _str _arr

bioctl -c C -l /dev/$RAID softraid0

# Reads revelant bioctl line
_str=`ed -s !bioctl -i softraid0 EOF
/CRYPTO/,p
q
EOF`
(( $? ))  return 1

# Split it
set -A _arr $_str
DECRYPT=${_arr[4]}

return 0
}

# ed needs a /tmp
mount -t mfs -o rw,nodev,nosuid,-s=1000 swap /tmp
get_devname
mount -t ffs /dev/${ROOT} /
set_kbd
decrypt  build_fstab
fsck -p
-- 
Manuel Giraud



Re: the root is on

2010-01-18 Thread Raimo Niskanen
On Mon, Jan 18, 2010 at 01:14:53PM +0100, Manuel Giraud wrote:
 Brad Tilley b...@16systems.com writes:
 
  Not sure I understand, but I have similar softraid crypto setups and
  there's no need to boot bsd.rd to edit /etc/fstab. When booting bsd or
  bsd.mp and you are dumped to sh to run bioctl, use ed to correct
  /etc/fstab there.
 
 Yes, but I cannot edit /etc/fstab from here since the root_device is
 mounted read-only.
 
 In fact, I first do a mount -uw / and now I can edit fstab. But if the
 root_device (as detected by kernel) is not what is said in fstab then
 this won't work.

You can always mount -t ffs / /dev/sd1a.

It is possible to rename the existing /etc/rc and write a
new one that use only /bin and /sbin to figure out what
the root device is e.g by parsing dmesg, fsck it, mount
it read-write, edit /etc/fstab using ed and then
go on to execute the original /etc/rc...

 
 -- 
 Manuel Giraud

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB



Re: the root is on

2010-01-16 Thread Manuel Giraud
Otto Moerbeek o...@drijf.net writes:

 Here's a probably stupid question: since the kernel can detect the root
 on sd0a why is there still a need for fstab entry for it?

 Because you might want to specify mount options, or an alternate root.

In fact, I was wondering because I have installed OpenBSD on an usb
flash drive.

I use softraid and have a script to decrypt the RAID partition and setup
a custom fstab with the correct 'sd?' for decrypted devices, it works
alrigh. But if root is not sd0a, I have to 'boot bsd.rd' and 'ed
/etc/fstab' before. Does anybody doing this and have a better solution?

-- 
Manuel Giraud



Re: the root is on

2010-01-16 Thread Brad Tilley
On Sat, 16 Jan 2010 14:37 +0100, Manuel Giraud manuel.gir...@univ-nantes.fr 
wrote:
 Otto Moerbeek o...@drijf.net writes:
 
  Here's a probably stupid question: since the kernel can detect the root
  on sd0a why is there still a need for fstab entry for it?
 
  Because you might want to specify mount options, or an alternate root.
 
 In fact, I was wondering because I have installed OpenBSD on an usb
 flash drive.
 
 I use softraid and have a script to decrypt the RAID partition and setup
 a custom fstab with the correct 'sd?' for decrypted devices, it works
 alrigh. But if root is not sd0a, I have to 'boot bsd.rd' and 'ed
 /etc/fstab' before. Does anybody doing this and have a better solution?

Not sure I understand, but I have similar softraid crypto setups and there's no 
need to boot bsd.rd to edit /etc/fstab. When booting bsd or bsd.mp and you are 
dumped to sh to run bioctl, use ed to correct /etc/fstab there.

Also, in my experience, this is not an issue unless you are adding and removing 
sd devices. For example, the physical volume may be wd0 and the softraid volume 
may be sd0 at the moment, but when you insert a USB stick and reboot, then that 
USB stick will become sd0 and the softraid volume will become sd1. In that case 
/etc/fstab must be edited. I think Marco is working on a general fix for this.

Brad

 
 -- 
 Manuel Giraud



Re: the root is on

2010-01-15 Thread Ted Unangst
On Fri, Jan 15, 2010 at 11:50 AM, Manuel Giraud
manuel.gir...@univ-nantes.fr wrote:
 Here's a probably stupid question: since the kernel can detect the root
 on sd0a why is there still a need for fstab entry for it?

Maybe you want to use softdep.



Re: the root is on

2010-01-15 Thread Otto Moerbeek
On Fri, Jan 15, 2010 at 05:50:21PM +0100, Manuel Giraud wrote:

 Hi,
 
 Here's a probably stupid question: since the kernel can detect the root
 on sd0a why is there still a need for fstab entry for it?

Because you might want to specify mount options, or an alternate root.

-Otto



Re: Local root exploit for FreeBSD

2009-12-03 Thread Ted Unangst
On Fri, Dec 4, 2009 at 1:13 AM, Fernando Quintero
fernando.a.quint...@gmail.com wrote:
 Do you read it?
 http://seclists.org/fulldisclosure/2009/Dec/16

 What about OpenBSD ?,  Is it vuln?

Reading the code for _dl_unsetenv it looks like it correctly smushes
all copies of the variable.

The FreeBSD libc code for the env functions is crazy!



Re: current /root/.login question

2009-07-12 Thread Philip Guenther
On Fri, Jul 10, 2009 at 10:12 AM, Emilio Pereaepe...@walkereng.com wrote:
 There have been some changes to the default /root/.login recently that I
 don't understand, and hope someone can enlighten me.

 On my oldest server, the root shell is still csh, so the change is very
 noticeable:  Using the /root/.login from the 4.5 CD, when I login there
 is a terminal type prompt which has always included the proper terminal
 type as default.  The /root/.login from the current snapshot always
 results in an unknown terminal type, so I have to type in the terminal
 type myself before proceeding.  Is this as intended?
...
 Last login: Fri Jul 10 11:35:12 2009 from herakles.walkereng.net
 OpenBSD 4.6 (GENERIC) #58: Thu Jul  9 21:24:42 MDT 2009
...
 tset: unknown terminal type !*
 Terminal type? nxterm
 Erase is delete.
 Kill is control-U (^U).
 Interrupt is control-C (^C).
 Read the afterboot(8) man page for administration advice.

Something is weird about your 4.6-almost system:
 - the error from tset implies that it was passed !* on the command line
 - the Erase is.../Kill is.../Interrupt is... output implies that
tset was *not*
   passed the -Q option

The latter would seem to imply that the tset in the /root/.login file
has either been changed or it is not the tset invocation that's
causing that output.  Do you perhaps have anything in your /etc/csh.*
files?

If nothing turns up there, I suggest adding set echo to the top of
/root/.cshrc, and maybe echo starting .login and such at the top of
each sourced file, then loggin in and seeing where the problem tset is
being invoked and with what.

If that small hammer doesn't give you enough information, there's
always the big hammer: use ktrace -i on whatever is starting the
shell (the terminal program, the login process, whatever).


Philip Guenther



Re: current /root/.login question

2009-07-12 Thread Emilio Perea
On Sun, Jul 12, 2009 at 05:04:58PM -0700, Philip Guenther wrote:
 On Fri, Jul 10, 2009 at 10:12 AM, Emilio Pereaepe...@walkereng.com wrote:
  There have been some changes to the default /root/.login recently that I
  don't understand, and hope someone can enlighten me.
 
  On my oldest server, the root shell is still csh, so the change is very
  noticeable:  Using the /root/.login from the 4.5 CD, when I login there
  is a terminal type prompt which has always included the proper terminal
  type as default.  The /root/.login from the current snapshot always
  results in an unknown terminal type, so I have to type in the terminal
  type myself before proceeding.  Is this as intended?
 ...
  Last login: Fri Jul 10 11:35:12 2009 from herakles.walkereng.net
  OpenBSD 4.6 (GENERIC) #58: Thu Jul  9 21:24:42 MDT 2009
 ...
  tset: unknown terminal type !*
  Terminal type? nxterm
  Erase is delete.
  Kill is control-U (^U).
  Interrupt is control-C (^C).
  Read the afterboot(8) man page for administration advice.
 
 Something is weird about your 4.6-almost system:
  - the error from tset implies that it was passed !* on the command line
  - the Erase is.../Kill is.../Interrupt is... output implies that
 tset was *not*
passed the -Q option
 
 The latter would seem to imply that the tset in the /root/.login file
 has either been changed or it is not the tset invocation that's
 causing that output.  Do you perhaps have anything in your /etc/csh.*
 files?

That was it!  The line 

alias tset 'set noglob histchars=; eval `\tset -s \!*`; unset noglob 
histchars'

which was removed in version 1.9 (25-Apr-1998!) was somehow still in
root's .cshrc.

My apologies...  I'm ashamed to say that I thought .login was executed
ahead of .cshrc and didn't check the man page.



Re: Reset root password on system with console insecure?

2009-02-06 Thread Jacob Yocom-Piatt

bofh wrote:

On Thu, Feb 5, 2009 at 1:38 PM, Pierre Riteau pierre.rit...@gmail.com wrote:

  

Or learn to use ed :)



My god, ed?  He should be editing the file on the hard drive by hand,
poking it in with dip switches!


  



so you've never had to edit text files with only programs under /{,s}bin?

ed has gotten me out of a number of crunches, don't knock it til you try it.



Re: Reset root password on system with console insecure?

2009-02-06 Thread Phusion
On Thu, Feb 5, 2009 at 7:44 AM, Hannah Schroeter han...@schlund.de wrote:
 Hi!

 On Thu, Feb 05, 2009 at 02:39:18PM +0100, Hannah Schroeter wrote:
On Thu, Feb 05, 2009 at 07:27:56AM -0600, Phusion wrote:
I am looking for advice on how to reset the root password on an
OpenBSD system that has console set to insecure in /etc/ttys. I have
booted off the install CD and into the shell and mounted the /
partition read-write, but don't have access to vi to modify
/etc/master.passwd. I was thinking I could clear out the root password
and afterwards run pwd_mkdb. Let me know. Thanks.

If you mount the original / partition (like in mount /dev/wd0a /mnt),
you can then mount /usr, /var, too (e.g. mount /dev/wd0d /mnt/usr, mount
/dev/wd0e /mnt/var). Then you can chroot into your system:
/mnt/usr/sbin/chroot /mnt /bin/ksh. Then you can setup the terminal
(export TERM=pcvt25) and the editor (export EDITOR=/usr/bin/vi) and
use vipw.

 Of course, after chroot you could also use the passwd command (passwd
 root) to directly set a new password for root (and perhaps your own
 user account if you've lost that password too). passwd doesn't ask the
 old password if you use it as root.

 And then, perhaps setup sudo so you can get root from your user account...

 Kind regards,

 Hannah.


This suggestion of using chroot worked great. Thanks for the help.

Phusion



Re: Reset root password on system with console insecure?

2009-02-05 Thread Hannah Schroeter
Hi!

On Thu, Feb 05, 2009 at 07:27:56AM -0600, Phusion wrote:
I am looking for advice on how to reset the root password on an
OpenBSD system that has console set to insecure in /etc/ttys. I have
booted off the install CD and into the shell and mounted the /
partition read-write, but don't have access to vi to modify
/etc/master.passwd. I was thinking I could clear out the root password
and afterwards run pwd_mkdb. Let me know. Thanks.

If you mount the original / partition (like in mount /dev/wd0a /mnt),
you can then mount /usr, /var, too (e.g. mount /dev/wd0d /mnt/usr, mount
/dev/wd0e /mnt/var). Then you can chroot into your system:
/mnt/usr/sbin/chroot /mnt /bin/ksh. Then you can setup the terminal
(export TERM=pcvt25) and the editor (export EDITOR=/usr/bin/vi) and
use vipw.

Kind regards,

Hannah.



Re: Reset root password on system with console insecure?

2009-02-05 Thread Hannah Schroeter
Hi!

On Thu, Feb 05, 2009 at 02:39:18PM +0100, Hannah Schroeter wrote:
On Thu, Feb 05, 2009 at 07:27:56AM -0600, Phusion wrote:
I am looking for advice on how to reset the root password on an
OpenBSD system that has console set to insecure in /etc/ttys. I have
booted off the install CD and into the shell and mounted the /
partition read-write, but don't have access to vi to modify
/etc/master.passwd. I was thinking I could clear out the root password
and afterwards run pwd_mkdb. Let me know. Thanks.

If you mount the original / partition (like in mount /dev/wd0a /mnt),
you can then mount /usr, /var, too (e.g. mount /dev/wd0d /mnt/usr, mount
/dev/wd0e /mnt/var). Then you can chroot into your system:
/mnt/usr/sbin/chroot /mnt /bin/ksh. Then you can setup the terminal
(export TERM=pcvt25) and the editor (export EDITOR=/usr/bin/vi) and
use vipw.

Of course, after chroot you could also use the passwd command (passwd
root) to directly set a new password for root (and perhaps your own
user account if you've lost that password too). passwd doesn't ask the
old password if you use it as root.

And then, perhaps setup sudo so you can get root from your user account...

Kind regards,

Hannah.



Re: Reset root password on system with console insecure?

2009-02-05 Thread Pierre Riteau
On Thu, Feb 05, 2009 at 02:44:49PM +0100, Hannah Schroeter wrote:
 Hi!
 
 On Thu, Feb 05, 2009 at 02:39:18PM +0100, Hannah Schroeter wrote:
 On Thu, Feb 05, 2009 at 07:27:56AM -0600, Phusion wrote:
 I am looking for advice on how to reset the root password on an
 OpenBSD system that has console set to insecure in /etc/ttys. I have
 booted off the install CD and into the shell and mounted the /
 partition read-write, but don't have access to vi to modify
 /etc/master.passwd. I was thinking I could clear out the root password
 and afterwards run pwd_mkdb. Let me know. Thanks.
 
 If you mount the original / partition (like in mount /dev/wd0a /mnt),
 you can then mount /usr, /var, too (e.g. mount /dev/wd0d /mnt/usr, mount
 /dev/wd0e /mnt/var). Then you can chroot into your system:
 /mnt/usr/sbin/chroot /mnt /bin/ksh. Then you can setup the terminal
 (export TERM=pcvt25) and the editor (export EDITOR=/usr/bin/vi) and
 use vipw.
 
 Of course, after chroot you could also use the passwd command (passwd
 root) to directly set a new password for root (and perhaps your own
 user account if you've lost that password too). passwd doesn't ask the
 old password if you use it as root.
 
 And then, perhaps setup sudo so you can get root from your user account...
 
 Kind regards,
 
 Hannah.
 

Or learn to use ed :)



Re: Reset root password on system with console insecure?

2009-02-05 Thread bofh
On Thu, Feb 5, 2009 at 1:38 PM, Pierre Riteau pierre.rit...@gmail.com wrote:

 Or learn to use ed :)

My god, ed?  He should be editing the file on the hard drive by hand,
poking it in with dip switches!


-- 
http://www.glumbert.com/media/shift
http://www.youtube.com/watch?v=tGvHNNOLnCk
This officer's men seem to follow him merely out of idle curiosity.
-- Sandhurst officer cadet evaluation.
Securing an environment of Windows platforms from abuse - external or
internal - is akin to trying to install sprinklers in a fireworks
factory where smoking on the job is permitted.  -- Gene Spafford
learn french:  http://www.youtube.com/watch?v=j1G-3laJJP0feature=related



Re: Reset root password on system with console insecure?

2009-02-05 Thread Grumpy
  Or learn to use ed :)
 
 My god, ed?  He should be editing the file on the hard drive by hand,
 poking it in with dip switches!

Dip switches? Back in my time, we had to use magnets. Kids are so
spoiled those days...

Grumpy



Re: Reset root password on system with console insecure?

2009-02-05 Thread bofh
On Thu, Feb 5, 2009 at 2:24 PM, Grumpy gru...@grumble-bubble.org wrote:
  Or learn to use ed :)

 My god, ed?  He should be editing the file on the hard drive by hand,
 poking it in with dip switches!

 Dip switches? Back in my time, we had to use magnets. Kids are so
 spoiled those days...

Normally I just breed butterflies.


-- 
http://www.glumbert.com/media/shift
http://www.youtube.com/watch?v=tGvHNNOLnCk
This officer's men seem to follow him merely out of idle curiosity.
-- Sandhurst officer cadet evaluation.
Securing an environment of Windows platforms from abuse - external or
internal - is akin to trying to install sprinklers in a fireworks
factory where smoking on the job is permitted.  -- Gene Spafford
learn french:  http://www.youtube.com/watch?v=j1G-3laJJP0feature=related



Re: ftpchroot root directories

2008-05-08 Thread Joachim Schipper
On Thu, May 08, 2008 at 02:52:50PM -0700, David Newman wrote:
 Greetings. I'm setting up ftp access* for a number of users to a directory 
 structure like this (assume / is an alias for the top of the tree):

 Username directory perms
 
 user1/  rw
 user2/projects  r
 user3/projects  rw
 user4/  r

 The FAQ and the ftpd(8) manpage say that chrooting goes to a user's home 
 directory, and nothing about permissions.

 Is there some other way of setting this up?

 ps. FTP is the client's choice, not mine. Same with this directory 
 structure.

You could switch to a more featureful FTP daemon - vsftpd is likely to
be enough. It also supports FTP-with-SSL, which, while a many-tentacled
monstrosity, is at least preferable to plain FTP. As long as you don't
have to traverse stateful firewalls. (In vsftpd's defence, you can open
a range of ports only.)

However, OpenBSD's ftpd(8) should do. Aside from user4 being able to
write to /tmp and so on, at least - user/group permissions should
suffice. (Mode 0640? Feel free to set umask to 0137, see login.conf(5))

But you should probably at least try to get your client to consider
using sftp instead. Note that you can now have per-user chroots and
sftp-only accounts using sshd, and it's both less of a firewall-headache
and more secure than FTP. WinSCP is a very usable[1] interface for
anyone who is able to use an FTP client.

Also note that using sshd makes this directory layout almost sane.

FInally, if you do go with FTP, don't allow FTP accounts to log in.

Joachim

[1] Well, it is a graphical program and runs on Windows. But within
those constraints, I haven't had many problems with it.

-- 
PotD: x11/xcursor-themes - X11 Cursors themes



Re: cwm: root window unavailable

2008-01-14 Thread Martin Toft
On Sat, Jan 12, 2008 at 08:32:50PM +0100, Martin Toft wrote:
 Hi,
 
 when starting X (and thereby cwm due to my .xinitrc), I get the
 following error:
 
 cwm: root window unavailable - perhaps another wm is running?
 
 It happens right after boot up, where I'm sure no other wm is running.
 My computer boots up without starting e.g. xdm and I type startx to
 launch X.

For the archive: I've solved the problem.

cwm echoes the error message above and terminates if xbindkeys is
running. My solution at the moment is to not use xbindkeys...

Martin



Re: cwm: root window unavailable

2008-01-14 Thread Jan Stary
On Jan 14 14:55:32, Martin Toft wrote:
 On Sat, Jan 12, 2008 at 08:32:50PM +0100, Martin Toft wrote:
  when starting X (and thereby cwm due to my .xinitrc), I get the
  following error:
  
  cwm: root window unavailable - perhaps another wm is running?

 cwm echoes the error message above and terminates if xbindkeys is
 running. My solution at the moment is to not use xbindkeys...

This is strange. I am running xbindkeys and it never bothered cwm
(or any other WM). This is my ~/.xinitrc:

--- cut -
#!/bin/sh

xset -b -c dpms 300 600 900 m 4 100 r rate 400 30 s off
xsetroot -solid black
xrdb $HOME/.Xresources
xbindkeys

setxkbmap -rules xorg -model pc105 -layout us,cz \
-option grp:shifts_toggle,grp_led:scroll

exec cwm
--- cut -

What exactly is yours? In particular, how are you launching xbindkeys?
I really doubt xbindkeys would be causing it.

Looking at the source,

if (Starting  
e-error_code == BadAccess
e-request_code == X_GrabKey)
errx(1, root window unavailable - perhaps another 
wm is running?);  

is the only place where the message appears.
What exactly is a BadAccess when trying to X_GrabKey?

Jan



Re: cwm: root window unavailable

2008-01-14 Thread Martin Toft
On Mon, Jan 14, 2008 at 03:54:33PM +0100, Jan Stary wrote:
 On Jan 14 14:55:32, Martin Toft wrote:
  cwm echoes the error message above and terminates if xbindkeys is
  running. My solution at the moment is to not use xbindkeys...
 
 This is strange. I am running xbindkeys and it never bothered cwm (or
 any other WM). This is my ~/.xinitrc:
[snip]

After a bit of poking around, I've discovered that the error only occurs
if I define one or more short cuts using xbindkeys that use the same
keys as the short cuts in cwm do. I guess this behaviour should be
expected, even though I was confused about cwm's error message.

I had this short cut for starting firefox in .xbindkeysrc:

firefox
  control + alt + q

After replacing q with b (b for browser ;-)), xbindkeys and cwm are
friends again.

Jan: You ask how I start xbindkeys -- if you still want to know, my
.xinitrc is attached inline in my original mail.

Martin



Re: cwm: root window unavailable

2008-01-14 Thread Owain Ainsworth
On Mon, Jan 14, 2008 at 05:35:25PM +0100, Martin Toft wrote:
 After a bit of poking around, I've discovered that the error only occurs
 if I define one or more short cuts using xbindkeys that use the same
 keys as the short cuts in cwm do. I guess this behaviour should be
 expected, even though I was confused about cwm's error message.

If you want to solve this (in current):

either use cwm's keybinding support (it abuses symlinks right now, which
is evil, but at least it works), or look into the unmap keyword. For
both man 1 cwm is your friend. I may look into if there's a nicer way of
dealing with this conflict.

Cheers,

-0-
-- 
Learned men are the cisterns of knowledge, not the fountainheads.



Re: cwm: root window unavailable

2008-01-13 Thread Martin Toft
On Sat, Jan 12, 2008 at 08:32:50PM +0100, Martin Toft wrote:
 Hi,
 
 when starting X (and thereby cwm due to my .xinitrc), I get the
 following error:
 
 cwm: root window unavailable - perhaps another wm is running?
 
 It happens right after boot up, where I'm sure no other wm is running.
 My computer boots up without starting e.g. xdm and I type startx to
 launch X.

I can add that twm works fine (I've temporarily substituted exec cwm
with exec twm in my .xinitrc), so I guess the problem is attributeable
to cwm. Of course, it might also be attributeable to the user in front
of the computer -- me :-)

Martin



Re: copy root disk from IDE to scsi

2007-12-10 Thread Nick Guenther
On Dec 10, 2007 5:40 AM, Khalid Schofield [EMAIL PROTECTED] wrote:
 Hi,
 random question. I've a sun system running obsd 4.2. I though I didn'
 have a scsi card with openfirmware so I installed on an IDE disk and
 spent ages configuring the system. It's a mail server also so I don't
 have the time to have a few hours of down time.

 How would I go about cloning the 80Gb IDE disk which has only a few
 Gb's in use to my 73Gb scsi disk? Also what boot variables need to be
 set in openfirmware to get it to autoboot from the scsi disk?

There's no way to do this without downtime, but you can probably
minimize it by 1) cloning over the network (i.e. put the scsi in a
different box, and use `scp mailserver:/$part dev_box:/mnt/$part`
(where part is one of 'home', 'usr', 'var') 2) figuring out what files
are getting written to and cloning them last, since you must shutdown
the mailserver for this or risk losing consistency. Since it's a
mailserver, you can probably copy every partition except for var
without shutting down the machine.
You can't copy the disklabels directly because the disks are different
sizes, so you'll have to re-disklabel manually. Plug the scsi into an
extra box OpenBSD box you have lying around (you have extras, right?).
fdisk and disklabel the scsi. Mount its partitions somewhere (I
suggested /mnt/$part but you can pick).
Does this help?

-Nick



Re: lost root account

2007-11-19 Thread Gilles Chehade
On Mon, Nov 19, 2007 at 08:18:47PM +0100, Jumping Mouse wrote:
 Hi there,  I have inherited an openBSD machine with no root account.  When I
 boot up in single user mode   boot -s and do a   cat /etc/master.passwd | root
 the only thing I get is:  daemon:*:1:1::0:0:The devil
 himself:/root:/sbin/nologin I can't seem to make changes to the master.passwd
 account by using vipw  in single usermode.   I get a message that the file is
 locked or busy.  Can anyone help in what I can do next?  How can I add the
 root account back to the master.passwd file.  thanks.
 

you are getting this message because / is mounted read-only in single user mode.
to use vipw you will have to manually mount / read/write and mount /usr if it is
on its own partition.

Gilles

-- 
Gilles Chehade
http://www.evilkittens.org/
http://www.evilkittens.org/blog/gilles/



Re: lost root account

2007-11-19 Thread Marcus Andree
Boot your machine in single user mode (boot -s) and
use plain vi and pwd_mkdb soon after that.

There's no need to use vipw when running in boot -s.

On Nov 19, 2007 5:18 PM, Jumping Mouse [EMAIL PROTECTED] wrote:
 Hi there,  I have inherited an openBSD machine with no root account.  When I
 boot up in single user mode   boot -s and do a   cat /etc/master.passwd | root
 the only thing I get is:  daemon:*:1:1::0:0:The devil
 himself:/root:/sbin/nologin I can't seem to make changes to the master.passwd
 account by using vipw  in single usermode.   I get a message that the file is
 locked or busy.  Can anyone help in what I can do next?  How can I add the
 root account back to the master.passwd file.  thanks.

 Express yourself instantly with MSN Messenger! MSN Messenger
 http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/



Re: lost root account

2007-11-19 Thread Juan Miscaro
--- Jumping Mouse [EMAIL PROTECTED] wrote:

 Hi there,  I have inherited an openBSD machine with no root account. 
 When I
 boot up in single user mode   boot -s and do a   cat
 /etc/master.passwd | root
 the only thing I get is:  daemon:*:1:1::0:0:The devil
 himself:/root:/sbin/nologin I can't seem to make changes to the
 master.passwd
 account by using vipw  in single usermode.   I get a message that the
 file is
 locked or busy.  Can anyone help in what I can do next?  How can I
 add the
 root account back to the master.passwd file.  thanks.


There is FAQ 8.1 on that.

// juan


  Get a sneak peak at messages with a handy reading pane with All new 
Yahoo! Mail: http://mail.yahoo.ca



Re: lost root account

2007-11-19 Thread Jumping Mouse
Hi Marcus,

I thought it was enough to add the root account through vipw.  that this edits
the master.passwd  file and would automatically update everything else?
how would I use pwd_mkdb, i don't want to delete any other accounts from the
master.passwd file.

thanks





 Date: Mon, 19 Nov 2007 17:41:01 -0200 From: [EMAIL PROTECTED] To:
[EMAIL PROTECTED]; misc@openbsd.org Subject: Re: lost root account  Boot
your machine in single user mode (boot -s) and use plain vi and pwd_mkdb soon
after that.  There's no need to use vipw when running in boot -s.  On Nov
19, 2007 5:18 PM, Jumping Mouse [EMAIL PROTECTED] wrote:  Hi there, I
have inherited an openBSD machine with no root account. When I  boot up in
single user mode boot -s and do a cat /etc/master.passwd | root  the only
thing I get is: daemon:*:1:1::0:0:The devil  himself:/root:/sbin/nologin I
can't seem to make changes to the master.passwd  account by using vipw in
single usermode. I get a message that the file is  locked or busy. Can
anyone help in what I can do next? How can I add the  root account back to
the master.passwd file. thanks.   Express yourself instantly with MSN
Messenger! MSN Messenger 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/  
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/



Re: lost root account

2007-11-19 Thread Jumping Mouse
thanks Juan,  faq8.1  shows me how to reset my root passord but i could not
find anything on recreating the root account.
Perhaps I am missing something?



 Date: Mon, 19 Nov 2007 14:36:18 -0500 From: [EMAIL PROTECTED] Subject: Re:
lost root account To: [EMAIL PROTECTED]; misc@openbsd.org   --- Jumping
Mouse [EMAIL PROTECTED] wrote:   Hi there, I have inherited an openBSD
machine with no root account.   When I  boot up in single user mode boot
-s and do a cat  /etc/master.passwd | root  the only thing I get is:
daemon:*:1:1::0:0:The devil  himself:/root:/sbin/nologin I can't seem to
make changes to the  master.passwd  account by using vipw in single
usermode. I get a message that the  file is  locked or busy. Can anyone
help in what I can do next? How can I  add the  root account back to the
master.passwd file. thanks.   There is FAQ 8.1 on that.  // juan   Get
a sneak peak at messages with a handy reading pane with All new Yahoo! Mail:
http://mail.yahoo.ca
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/



Re: lost root account

2007-11-19 Thread Nick Holland

Jumping Mouse wrote:

Hi there,  I have inherited an openBSD machine with no root account.  When I
boot up in single user mode   boot -s and do a   cat /etc/master.passwd | root


I presume there's a grep missing in there. :)


the only thing I get is:  daemon:*:1:1::0:0:The devil
himself:/root:/sbin/nologin I can't seem to make changes to the master.passwd
account by using vipw  in single usermode.   I get a message that the file is
locked or busy.  Can anyone help in what I can do next?  How can I add the
root account back to the master.passwd file.  thanks.


try doing a rm /etc/ptmp before vipw.
That's the lock file which apparently exists on the machine for some 
reason (i.e., someone was sitting in vipw when you powered down the 
machine).


/etc/ptmp isn't documented in vipw (it probably should be), but it is 
covered in passwd(1).  It should also be documented in faq8.html, I'll 
try to fix that this evening. :)


Nick.



Re: lost root account

2007-11-19 Thread Jason McIntyre
On Mon, Nov 19, 2007 at 04:20:22PM -0500, Nick Holland wrote:
 
 /etc/ptmp isn't documented in vipw (it probably should be), but it is 
 covered in passwd(1).  It should also be documented in faq8.html, I'll 
 try to fix that this evening. :)
 

cvs up!
that is to say, i agree, and just added it.

jmc



Re: lost root account

2007-11-19 Thread Jumping Mouse
Ok the issue was solved!

mount -s -uw /

vipw

I typed the missing root account line back in and saved the file and can now
log back in as root.
this then invoked pwd_mkdb to do all the rest.

thanks everyone.

only issue now is that if I try to change another users account password I get
the following:

enter:   passwd  username
enter:  new password

get:

pwd_mkdb:  corrupted entry
pwd_mkdb: at line #24
pwd_mkdb: /etc/ptmp: Innapropriate file type or format
passwd: etc/master.passwd unchanged

Do you have any idea what could be causing this,  the user entery in
master.passwd looks fine.  From: [EMAIL PROTECTED] To:
[EMAIL PROTECTED]; misc@openbsd.org Subject: Re: lost root account
Date: Mon, 19 Nov 2007 21:37:19 +0100  Hi Marcus,  I thought it was enough
to add the root account through vipw. that this edits the master.passwd file
and would automatically update everything else? how would I use pwd_mkdb, i
don't want to delete any other accounts from the master.passwd file. 
thanks   Date: Mon, 19 Nov 2007 17:41:01 -0200 From:
[EMAIL PROTECTED] To: [EMAIL PROTECTED]; misc@openbsd.org Subject:
Re: lost root account  Boot your machine in single user mode (boot -s) and
use plain vi and pwd_mkdb soon after that.  There's no need to use vipw
when running in boot -s.  On Nov 19, 2007 5:18 PM, Jumping Mouse
[EMAIL PROTECTED] wrote:  Hi there, I have inherited an openBSD machine
with no root account. When I  boot up in single user mode boot -s and do a
cat /etc/master.passwd | root  the only thing I get is:
daemon:*:1:1::0:0:The devil  himself:/root:/sbin/nologin I can't seem to
make changes to the master.passwd  account by using vipw in single
usermode. I get a message that the file is  locked or busy. Can anyone help
in what I can do next? How can I add the  root account back to the
master.passwd file. thanks.   Express yourself instantly with MSN
Messenger! MSN Messenger 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/  
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/



Re: [solved] Re: RAIDFrame root autoconfig fails in -current

2007-06-15 Thread Otto Moerbeek
On Thu, 14 Jun 2007, Josh Grosse wrote:

 This thread had started with a root-on-raid problem, where the disklabel
 was not being acquired properly.
 
 Ken Westerback determined that I'd had a disklabel marked as Version 1, but
 I had values from Version 0 for my failing partitions.  Editing the disklabel
 and replacing fsize/bsize/cpg seemed to resolve my issue.
 
 I now think I understand exactly how the old partition data structure ended 
 up in a new format partition; the affected partitions were restored via 
 newfs/restore, and that is the most likely culprit as the restore was 
 of a pre-ffs2 environment, executed from a post-ffs2 system.

The old newfs is the cuplrit, since it writes the fsze/bsize/cpg in
the label.  restore does not. 

-Otto



[solved] Re: RAIDFrame root autoconfig fails in -current

2007-06-14 Thread Josh Grosse
This thread had started with a root-on-raid problem, where the disklabel
was not being acquired properly.

Ken Westerback determined that I'd had a disklabel marked as Version 1, but
I had values from Version 0 for my failing partitions.  Editing the disklabel
and replacing fsize/bsize/cpg seemed to resolve my issue.

I now think I understand exactly how the old partition data structure ended 
up in a new format partition; the affected partitions were restored via 
newfs/restore, and that is the most likely culprit as the restore was 
of a pre-ffs2 environment, executed from a post-ffs2 system.

Thank you, Ken!



Re: RAIDFrame root autoconfig fails in -current

2007-06-13 Thread Nick Bender

I have current running under VMWare Server using both single and multiprocessor
raidframe enabled kernels (dmsgs below). As far as I  can tell everything is
working and softraid is not causing any issues with raidframe autoconfiguration.

I'll try and test on VMWare ESX tomorrow - that emulates an LSI SCSI
controlller.
I'll also see if I can round up some real hardware to test on as well.

disklabel for wd0 (same for wd1):

# /dev/rwd0c:
type: ESDI
disk: ESDI/IDE disk
label: VMware Virtual I
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 15
sectors/cylinder: 945
cylinders: 16383
total sectors: 41943040
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0   # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0

16 partitions:
# sizeoffset  fstype [fsize bsize  cpg]
a:  1887442263  4.2BSD   2048 163841 # Cyl 0*-
19972
b:   2097900  18874485swap   # Cyl 19973 -
22192
c:  41943040 0  unused  0 0  # Cyl 0 -
44384*
d:  20957265  20972385RAID   # Cyl 22193 -
44369

disklabel for raid partition:

# /dev/rraid0c:
type: RAID
disk: raid
label: fictitious
flags:
bytes/sector: 512
sectors/track: 128
tracks/cylinder: 8
sectors/cylinder: 1024
cylinders: 20466
total sectors: 20957184
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0   # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0

16 partitions:
# sizeoffset  fstype [fsize bsize  cpg]
a:   2097152 0  4.2BSD   2048 163841 # Cyl 0 -
2047
b:   2097152   2097152swap   # Cyl  2048 -
4095
c:  20957184 0  unused  0 0  # Cyl 0 -
20465
d:   2097152   4194304  4.2BSD   2048 163841 # Cyl  4096 -
6143
e:   8388608   6291456  4.2BSD   2048 163841 # Cyl  6144 -
14335
f:   2097152  14680064  4.2BSD   2048 163841 # Cyl 14336 -
16383
g:   4179968  16777216  4.2BSD   2048 163841 # Cyl 16384 -
20465

raid0.conf:

START array
1 2 0
START disks
/dev/wd0d
/dev/wd1d
START layout
128 1 1 1
START queue
fifo 100

Any other info required just email...

-N


OpenBSD 4.1-current (RAID) #9: Wed Jun 13 11:09:24 EDT 2007
   [EMAIL PROTECTED]:/usr/src/sys/arch/i386/compile/RAID
cpu0: Intel(R) Xeon(TM) CPU 3.20GHz (GenuineIntel 686-class) 3.20 GHz
cpu0:
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,
CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,SSE3,DS-CPL
real mem  = 267939840 (255MB)
avail mem = 250142720 (238MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 04/17/06, BIOS32 rev. 0 @ 0xfd880,
SMBIOS rev. 2.31 @ 0xe0010 (45 entries)
bios0: VMware, Inc. VMware Virtual Platform
apm0 at bios0: Power Management spec V1.2
apm0: AC on, battery charge unknown
apm0: flags 30102 dobusy 0 doidle 1
pcibios0 at bios0: rev 2.1 @ 0xfd880/0x780
pcibios0: PCI IRQ Routing Table rev 1.0 @ 0xfdf30/176 (9 entries)
pcibios0: PCI Interrupt Router at 000:07:0 (Intel 82371FB ISA rev
0x00)
pcibios0: PCI bus #1 is the last bus
bios0: ROM list: 0xc/0x8000 0xc8000/0x1000 0xdc000/0x4000!
0xe/0x4000!
cpu0 at mainbus0
pci0 at mainbus0 bus 0: configuration mode 1 (no bios)
pchb0 at pci0 dev 0 function 0 Intel 82443BX AGP rev 0x01
ppb0 at pci0 dev 1 function 0 Intel 82443BX AGP rev 0x01
pci1 at ppb0 bus 1
piixpcib0 at pci0 dev 7 function 0 Intel 82371AB PIIX4 ISA rev 0x08
pciide0 at pci0 dev 7 function 1 Intel 82371AB IDE rev 0x01: DMA,
channel 0 configured to compatibility, channel 1 configured to
compatibility
wd0 at pciide0 channel 0 drive 0: VMware Virtual IDE Hard Drive
wd0: 64-sector PIO, LBA, 20480MB, 41943040 sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2
atapiscsi0 at pciide0 channel 1 drive 0
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0: SONY, CD-RW CRX217E, 1DS2 SCSI0 5/cdrom
removable
wd1 at pciide0 channel 1 drive 1: VMware Virtual IDE Hard Drive
wd1: 64-sector PIO, LBA, 20480MB, 41943040 sectors
cd0(pciide0:1:0): using PIO mode 4, Ultra-DMA mode 2
wd1(pciide0:1:1): using PIO mode 4, Ultra-DMA mode 2
piixpm0 at pci0 dev 7 function 3 Intel 82371AB Power rev 0x08: SMBus
disabled
vga1 at pci0 dev 15 function 0 VMware Virtual SVGA II rev 0x00
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
bha3 at pci0 dev 16 function 0 BusLogic MultiMaster rev 0x01: irq 11,
BusLogic 9xxC SCSI
bha3: model BT-958, firmware 5.07B
bha3: sync, parity
scsibus1 at bha3: 8 targets
pcn0 at pci0 dev 17 function 0 AMD 79c970 PCnet-PCI rev 0x10,
Am79c970A, rev 0: irq 9, address 00:0c:29:9b:9e:b9
isa0 at piixpcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pmsi0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pmsi0 mux 0

Re: RAIDFrame root autoconfig fails in -current

2007-06-12 Thread Kenneth R Westerback
On Mon, Jun 11, 2007 at 02:10:34PM -0400, Brian A. Seklecki wrote:
 On Mon, 11 Jun 2007, Otto Moerbeek wrote:
 
 
 Please contact krw@, he has been searching testers for RAIDframe root
 autoconfig on [EMAIL PROTECTED] There's even a diff posted there, iirc.
 
 I'm your point-man there.  A while back I wrote 3 pages of 
 technical detritus on making it work in 3.9/4.0.  ISOs w/ install.sh 
 patches, too.
 
 So we're changing the software raid subsystems eh?
 
 ~BAS
 
 
  -Otto
 
 
 The disklabel is correct, and if I use a non-RAID boot drive, raid0a can
 

I committed the diff to raidframe to 'fix' raidgetdisklabel() so it
behaves/gets used like other drivers. It should be in snapshots
after today.

With this and the other disklabel changes going on, hammering at
raidframe to uncover issues in odd cases (or normal cases for that
matter) much appreciated.

 Ken



Re: RAIDFrame root autoconfig fails in -current

2007-06-12 Thread Josh Grosse
On Tue, Jun 12, 2007 at 08:36:03AM -0400, Kenneth R Westerback wrote:
 I committed the diff to raidframe to 'fix' raidgetdisklabel() so it
 behaves/gets used like other drivers. It should be in snapshots
 after today.

Unfortunately, this patch to rf_openbsdkintf.c didn't solve whatever
problem I'm having ... even with softraid0 removed from the config.
 
 With this and the other disklabel changes going on, hammering at
 raidframe to uncover issues in odd cases (or normal cases for that
 matter) much appreciated.



Re: RAIDFrame root autoconfig fails in -current

2007-06-11 Thread Stuart Henderson
On 2007/06/11 13:00, Josh Grosse wrote:
 Running i386-current with a 26-May build everything is fine.  I just built
 a new kernel today, and got:

softraidtm* is in GENERIC now and it autoconfigures; it may be causing
a conflict with raidframe since they both use partitions with type raid.

If you want to try disabling it, it's in the MI kernel config,
/sys/conf/GENERIC.

(if it's raid1 you want, the other option is to rebuild the box with
softraid instead, if you do this and move files with dump/restore,
update to the very recent sbin/dump/traverse.c first to keep ctime/mtime
intact).



* well, it wass, but the owners didn't renew it, so that's ok.



Re: RAIDFrame root autoconfig fails in -current

2007-06-11 Thread Brian A. Seklecki

On Mon, 11 Jun 2007, Otto Moerbeek wrote:



Please contact krw@, he has been searching testers for RAIDframe root
autoconfig on [EMAIL PROTECTED] There's even a diff posted there, iirc.


I'm your point-man there.  A while back I wrote 3 pages of 
technical detritus on making it work in 3.9/4.0.  ISOs w/ install.sh 
patches, too.


So we're changing the software raid subsystems eh?

~BAS



-Otto



The disklabel is correct, and if I use a non-RAID boot drive, raid0a can




Re: RAIDFrame root autoconfig fails in -current

2007-06-11 Thread Otto Moerbeek
On Mon, 11 Jun 2007, Brian A. Seklecki wrote:

 On Mon, 11 Jun 2007, Otto Moerbeek wrote:
 
  
  Please contact krw@, he has been searching testers for RAIDframe root
  autoconfig on [EMAIL PROTECTED] There's even a diff posted there, iirc.
 
 I'm your point-man there.  A while back I wrote 3 pages of technical detritus
 on making it work in 3.9/4.0.  ISOs w/ install.sh patches, too.
 
 So we're changing the software raid subsystems eh?

Well, if possible, we would like to have a working RAIDframe with the
new disklabel stuff. Hence krw@ searching for testers. I believe he
got very little responce on [EMAIL PROTECTED] 

Anyway, to anwer your question, yes, at some point in time RAIDFrame
will probaly be even more unsupported than it is now; in contrast, the
new softraid(4) will become part of a release in the future. But do
not draw the conclusion that these two events will occur at the same
time. 

-Otto



Re: RAIDFrame root autoconfig fails in -current

2007-06-11 Thread Nick Bender

On 6/11/07, Otto Moerbeek [EMAIL PROTECTED] wrote:

On Mon, 11 Jun 2007, Brian A. Seklecki wrote:

 On Mon, 11 Jun 2007, Otto Moerbeek wrote:

 
  Please contact krw@, he has been searching testers for RAIDframe root
  autoconfig on [EMAIL PROTECTED] There's even a diff posted there, iirc.

 I'm your point-man there.  A while back I wrote 3 pages of technical detritus
 on making it work in 3.9/4.0.  ISOs w/ install.sh patches, too.

 So we're changing the software raid subsystems eh?

Well, if possible, we would like to have a working RAIDframe with the
new disklabel stuff. Hence krw@ searching for testers. I believe he
got very little responce on [EMAIL PROTECTED]

Anyway, to anwer your question, yes, at some point in time RAIDFrame
will probaly be even more unsupported than it is now; in contrast, the
new softraid(4) will become part of a release in the future. But do
not draw the conclusion that these two events will occur at the same
time.

-Otto



I have the patch sitting in my inbox - it was against rev. 1.35 while current
looks to be up to 1.39. I should have time to test it on Wednesday, any
chance of an updated diff? If not I'll make do...

-N



Re: RAIDFrame root autoconfig fails in -current

2007-06-11 Thread Josh Grosse
On Mon, Jun 11, 2007 at 06:48:22PM +0100, Stuart Henderson wrote:
 softraidtm* is in GENERIC now and it autoconfigures; it may be causing
 a conflict with raidframe since they both use partitions with type raid.
 
 If you want to try disabling it, it's in the MI kernel config,
 /sys/conf/GENERIC.

I have attempted disabling softraid0 via UKC, which doesn't change the
results -- so it looks like the patch in tech@ is my next step.
 
 (if it's raid1 you want, the other option is to rebuild the box with
 softraid instead, if you do this and move files with dump/restore,
 update to the very recent sbin/dump/traverse.c first to keep ctime/mtime
 intact).

Hmmm I was under the impression -- from reading commits -- that softraid
recoverability is not yet developed and committed.  

(It might be, as commit logs are often very terse.  I'm not singling out any 
developer, just noting a generality.  My favorite commits are the ones that 
only say, Oops.) 



  1   2   >