Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
feld
Feb 11, 2008

Out of nowhere its.....

Feldman

Expect reading from your CDROM/DVDROM to be broken in VLC and possibly other software in 9-RELEASE due to a CAM bug which the fix was never MFC'd because not enough people made noise about it during the RC process.


http://groups.google.com/group/mailing.freebsd.current/browse_thread/thread/37775fe36b3491f8/452e80419655fbca?show_docid=452e80419655fbca

Adbot
ADBOT LOVES YOU

Nam Taf
Jun 25, 2005

I am Fat Man, hear me roar!

How do I remove possibly wrong GPT info off a disk used as a raw zpool disk? I keep getting the error:
code:
GEOM: ada1: corrupt or invalid GPT detected.
GEOM: ada1: GPT rejected -- may not be recoverable.
This is loving with my boot process - it defaults to trying to boot ada0p2 (my old boot drive, pre-reinstall) rather than ada4p2, which is my current boot drive and works if I manually specify it. I believe it's because it's getting some incorrect info off the zpool drives. ada4 has all the boot info it needs and boots fine if I remove the zpool drives but as soon as they're in, they gently caress the system.

The zpool works fine and reports space fine. I've read that a raw zpool disk will start eating in to the GPT area unless you partition off space and use that instead.

The only way I've read to fix it is to zero the entire drive and resliver, but I don't really want to do that with the array if I can avoid it. Is there any less brute-force way of fixing this?

e: I've fixed the boot default by changing /etc/fstab but I'd still like to fix the GPT error regardless if possible. Thanks in advance for help :)

Nam Taf fucked around with this message at 17:18 on Jan 23, 2012

feld
Feb 11, 2008

Out of nowhere its.....

Feldman

Assuming you're OK with nuking this disk and re-adding it to your zpool, you'll have to do something like this:

gpart recover ada1 (to fix GPT)

then you can do

gpart destroy -f ada1


That should wipe all gpt partitions and headers and stuff

then just re-add it to your zpool. Or force a scrub so zfs fixes things up.

Nam Taf
Jun 25, 2005

I am Fat Man, hear me roar!

Hrm. I've tried scrubbing it before, for unrelated reasons, and it didn't fix it. I'll try it overnight and report back.

Regardless, I tried the gpart commands and gpart recover ada1 reports:
code:
gpart: arg0 'ada1': Invalid argument
If I do gpart recover ada0, it gives me:
code:
ada0 recovering is not needed
If I try gpart destory -f ada[0/1] it claims an invalid number of arguments.

I'll scrub it, see what happens and report back.

Computer viking
May 30, 2011
Now with less breakage.

Have you tried zeroing the last sector? GPT keeps a backup header there that might be detected.

feld
Feb 11, 2008

Out of nowhere its.....

Feldman

Computer viking posted:

Have you tried zeroing the last sector? GPT keeps a backup header there that might be detected.

I'm guessing gpart is "tasting" the device and seeing ZFS stuff but thinking it's GPT. If it was GPT the gpart command to recover would have read the last sector, copied it to the first, and then let him destroy it. If he sees *nothing* at all when he runs "gpart show ada0", then gpart definitely isn't seeing a true GPT header.

Nam Taf
Jun 25, 2005

I am Fat Man, hear me roar!

Yeh the scrub didn't help. I think I'll just write it off as some crazy poo poo going on. I don't really have any other options, do I?

roadhead
Dec 25, 2001

Ok I finally got around to the rest of the steps on the way to finishing up my 9.0 upgrade.


I did the "shutdown -r now" part (really the thing that made me keep putting it off, didn't want to lose the up-time!) and started the "portupgrade -af" part earlier today... on a single user session... when I am ALWAYS OTHERWISE USING TMUX.

The reason I wasn't using tmux is because well - uhhh i was re-building all my ports and was going to do another "freebsd-update install" soon so I thought a single actual SSH session would be fine.

Of course this compiling went on ALL DAY TODAY. And when 5 rolled around I stupidly just shut my notebook (with the putty session on it) like I always do, cause hey, tmux right?

When I got home and ssh in from my desktop it hit me - I am an amazingly stupid human being who should not be allowed to play with the switches and knobs. I killed my shell in the middle of a "portupgrade -af" surely at least leaving some half-compiled port somewhere on my system.

So uhhh - will it start all over at the beginning you think or be able to pick up where it left off?

Ninja Rope
Oct 22, 2005

Wee.
It should pick up where it left off, give or take.

Sombrero!
Sep 11, 2001

So I bought an HP ProLiant N40L Microserver (this thing: http://www.newegg.com/Product/Product.aspx?Item=N82E16859107052 ) and I'm debating whether to toss Ubuntu/Mint or FreeBSD on it.

I'd basically be using it as a NAS that torrented/usenetted as well. Think FreeBSD would do the trick or should I stick with Ubuntu? I'd be looking at running Deluge, SABnzbdplus, Sickbeard, Couch Potato and possibly an IRC bouncer.

How much of a pain in the rear end is it to get network shares set up on FreeBSD for someone who always used the GUI in Ubuntu to get stuff shared?

EvilMoFo
Jan 1, 2006

edit /usr/local/etc/smb.conf file with the share you wish to create, there are examples available
`smbpasswd -a username`
add samba_enable="YES" to /etc/rc.conf
/usr/local/etc/rc.d/samba start


I think that pretty much covers it

Nystral
Feb 6, 2002

Every man likes a pretty girl with him at a skeleton dance.
I'm trying to create a shell script that runs the command below with an eye to add it to crontab:

rsync -az -e "ssh -i /home/user/.ssh/Private-key" User@remotehost:~/dir /localdir

I'm trying to use this script from http://troy.jdmz.net/rsync/index.html which was written for linux

#!/bin/sh

RSYNC=/usr/bin/rsync
SSH=/usr/bin/ssh
KEY=/home/thisuser/cron/thishost-rsync-key
RUSER=remoteuser
RHOST=remotehost
RPATH=/remote/dir
LPATH=/this/dir/

$RSYNC -az -e "$SSH -i $KEY" $RUSER@$RHOST:$RPATH $LPATH

So I create this script with the correct locations and I run it via the command "./rsync-remote-backup"

First error: rsync is not found in /usr/bin/rsync
Second error: ssh is found in /usr/bin/ssh

However if I modify the script to just use rsync and ssh (without the full path) and use the same ./rsync-remote-backup I get:
rsync: change_dir "/home/user" failed: No such file or directory (2)

Bit stumped here

FISHMANPET
Mar 3, 2007

Sweet 'N Sour
Can't
Melt
Steel Beams

Nystral posted:

I'm trying to create a shell script that runs the command below with an eye to add it to crontab:

rsync -az -e "ssh -i /home/user/.ssh/Private-key" User@remotehost:~/dir /localdir

I'm trying to use this script from http://troy.jdmz.net/rsync/index.html which was written for linux

#!/bin/sh

RSYNC=/usr/bin/rsync
SSH=/usr/bin/ssh
KEY=/home/thisuser/cron/thishost-rsync-key
RUSER=remoteuser
RHOST=remotehost
RPATH=/remote/dir
LPATH=/this/dir/

$RSYNC -az -e "$SSH -i $KEY" $RUSER@$RHOST:$RPATH $LPATH

So I create this script with the correct locations and I run it via the command "./rsync-remote-backup"

First error: rsync is not found in /usr/bin/rsync
Second error: ssh is found in /usr/bin/ssh

However if I modify the script to just use rsync and ssh (without the full path) and use the same ./rsync-remote-backup I get:
rsync: change_dir "/home/user" failed: No such file or directory (2)

Bit stumped here

I think cron runs without any enviroment, so just using the command won't work. Can you do 'which ssh' and 'which rsync' at the terminal to find where those are, and replace thoe /usr/bin path with the actual path for your binaries?

ppp
Feb 13, 2012

by angerbot

Nystral posted:

I'm trying to create a shell script that runs the command below with an eye to add it to crontab:

rsync -az -e "ssh -i /home/user/.ssh/Private-key" User@remotehost:~/dir /localdir

I'm trying to use this script from http://troy.jdmz.net/rsync/index.html which was written for linux

#!/bin/sh

RSYNC=/usr/bin/rsync
SSH=/usr/bin/ssh
KEY=/home/thisuser/cron/thishost-rsync-key
RUSER=remoteuser
RHOST=remotehost
RPATH=/remote/dir
LPATH=/this/dir/

$RSYNC -az -e "$SSH -i $KEY" $RUSER@$RHOST:$RPATH $LPATH

So I create this script with the correct locations and I run it via the command "./rsync-remote-backup"

First error: rsync is not found in /usr/bin/rsync
Second error: ssh is found in /usr/bin/ssh

However if I modify the script to just use rsync and ssh (without the full path) and use the same ./rsync-remote-backup I get:
rsync: change_dir "/home/user" failed: No such file or directory (2)

Bit stumped here

rsync is probably at "/usr/local/bin/rsync". Use "whereis rsync" to check this.

Ninja Rope
Oct 22, 2005

Wee.
It looks like you also have a path incorrect, but you obscured so much I can't tell.

feld
Feb 11, 2008

Out of nowhere its.....

Feldman

I feel like I need to share this with someone:

I recently stumbled upon cpdup, written by Matt Dillon. Think of it as rsync but originally not for over a network. It's faster than rsync on local disk, and uses less CPU -- especially when dealing with tons of hardlinks (rsync spawns 3 processes for this).

http://www.freshports.org/sysutils/cpdup/


Also, it does exactly what you tell it to do, not what ancient unix conventions imply.

Example:
pre:
# mkdir dir1
# mkdir dir2
# cp /random/files/* dir1/
# cpdup dir1 dir2
Normally you'd see this create dir2/dir1, but not with cpdup. You tell it what to clone over and it does. dir2 is now an EXACT clone of dir1.

This tool is great :3:

Nystral
Feb 6, 2002

Every man likes a pretty girl with him at a skeleton dance.

Ninja Rope posted:

It looks like you also have a path incorrect, but you obscured so much I can't tell.
Thanks everyone I never new of whereis as a command.


Working command is:
rsync -az -e "ssh -i /home/nystral/.ssh/Private-key" nystral@108.x.x.x:~/backup /mnt/NFS/backup

The script is NOW:
#!/bin/sh

RSYNC=/usr/local/bin/rsync
SSH=/usr/bin/ssh
KEY=/home/nystral/cron/Private-key (a copy of the key in .ssh/)
RUSER=nystral
RHOST=108.x.x.x
RPATH=~/backup
LPATH=/mnt/NFS/backup

$RSYNC -az -e "$SSH -i $KEY" $RUSER@$RHOST:$RPATH $LPATH

and I'm getting this error:
rsync: change_dir "/home/nystral" failed: No such file or directory (2)

Comatoast
Aug 1, 2003

by Fluffdaddy

Nystral posted:

rsync -az -e "ssh -i /home/nystral/.ssh/Private-key" nystral@108.x.x.x:~/backup /mnt/NFS/backup

KEY=/home/nystral/cron/Private-key (a copy of the key in .ssh/)

/home/nystral/.ssh/Private-key
!=
/home/nystral/cron/Private-key

Nystral
Feb 6, 2002

Every man likes a pretty girl with him at a skeleton dance.
However running the below command just works :(
rsync -az -e "ssh -i /home/nystral/cron/private-key" nystral@108.x.x.x:~/backup /mnt/NFS/backup

Anyone have a good resource on writing bash scripts?

Would the script be running as a different user - ie as the deamon cron vs as the user executing the command?

Ninja Rope
Oct 22, 2005

Wee.

Nystral posted:

However running the below command just works :(
rsync -az -e "ssh -i /home/nystral/cron/private-key" nystral@108.x.x.x:~/backup /mnt/NFS/backup

Anyone have a good resource on writing bash scripts?

Would the script be running as a different user - ie as the deamon cron vs as the user executing the command?

What if you do it without the tilde (~) in the path? Put in the whole absolute path instead.

Comatoast
Aug 1, 2003

by Fluffdaddy
Is ~/cron a symlink to ~/.ssh?

doomisland
Oct 5, 2004

Doesn't it assume you're going to your home directory so the ~ is unnecessary? Or put the absolute path.

Nystral
Feb 6, 2002

Every man likes a pretty girl with him at a skeleton dance.
So the issue was the ~ bit and hard linking it to /home/nystral/backup worked like a charm.

Thanks guys!

Only Shallow
Nov 12, 2005

show
Here's a nice how-to for putting together a decent FreeBSD desktop system.

kastein
Aug 31, 2011

Moderator at http://www.ridgelineownersclub.com/forums/and soon to be mod of AI. MAKE AI GREAT AGAIN. Motronic for VP.
How did I never see this thread before?

If I had realized in August that nVidia finally released amd64 FreeBSD drivers for their cards I would be running it on my desktop right now :smith: I ran it for years in college and just out of college and loved it.

That being said, I had one minor annoyance last time I ran it - iirc, that was 7.2-R. Everything worked great except sound - I could only have one program using sound at a time and occasionally my music player would freeze due to some sort of deadlock in the kernel driver code for the sound adapter in my system, think it was the ad1988 driver but I don't really remember too well. Everything else would keep working till I tried to kill the app, then I'd end up in the ninth circle of hell. Anyone seen this on more recent releases?

feld
Feb 11, 2008

Out of nowhere its.....

Feldman

kastein posted:

Anyone seen this on more recent releases?

It's my desktop at work and home. Also on my google CR48 netbook I'm typing on right now (gently caress ChromeOS). It works great; have never seen this issue.

Goon Matchmaker
Oct 23, 2003

I play too much EVE-Online

kastein posted:

I could only have one program using sound at a time

PulseAudio should take care of that issue, but IIRC, FreeBSD implemented some kind of in kernel sound mixing stuff a while back that should have solved that.

Only Shallow
Nov 12, 2005

show

Goon Matchmaker posted:

PulseAudio should take care of that issue, but IIRC, FreeBSD implemented some kind of in kernel sound mixing stuff a while back that should have solved that.

There are a few sysctl knobs that may take care of it.

Computer viking
May 30, 2011
Now with less breakage.

Only Shallow posted:

There are a few sysctl knobs that may take care of it.
The defaults tend to work fine these days, too.

feld
Feb 11, 2008

Out of nowhere its.....

Feldman

Goon Matchmaker posted:

PulseAudio should take care of that issue, but IIRC, FreeBSD implemented some kind of in kernel sound mixing stuff a while back that should have solved that.

FreeBSD's sound system is based on OSSv4's API. It's a kissing cousin with some features missing but the drivers are easily ported. That's why it has no issues with sound mixing.


Mrs. Finkle posted:

Lennart Poettering and Pulseaudio should die of gonorrhea and rot in hell. Would you like a cookie, son?

feld fucked around with this message at 15:07 on Apr 3, 2012

Computer viking
May 30, 2011
Now with less breakage.

I'll give pulseaudio this much: It works much better than it used to. It's not going on my FreeBSD desktop, but I no longer remove it from Linux installs.

Matt Zerella
Oct 7, 2002

Norris'es are back baby. It's good again. Awoouu (fox Howl)
So, I'm doing some traveling soon for work and I want to set up a L2TP VPN connection on my home box for my iPad and laptop for Netflix/HBOGO and other crap.

I found this guide, looks easy enough but one part concerns me, it looks like it involves PF which i believe is the BSD firewall. I don't really mess around with this because its just my home box and it's behind a firewall anyway.

My concern is, will the PF rules in that guide mess with my SSH connection? I have a bit of a dead day at work tomorrow so I'd like to get this set up and tested while I'm there.

My firewall has the proper ports forwarded for the ipsec and L2TP stuff.

Ninja Rope
Oct 22, 2005

Wee.
All of those firewall rules are allows. If you're not currently running pf (or another firewall) you don't need to change anything.

The pf docs say it defaults to passing all traffic, so you could enable pf and add those rules, but it wouldn't have any effect.

Also, you might want to look into openvpn. The client config is a little more complicated (having to set up default routes and some such, there's no automagic for Windows), but it's usually easier to configure on the server/router/firewall level since it runs over UDP.

Matt Zerella
Oct 7, 2002

Norris'es are back baby. It's good again. Awoouu (fox Howl)

Ninja Rope posted:

All of those firewall rules are allows. If you're not currently running pf (or another firewall) you don't need to change anything.

The pf docs say it defaults to passing all traffic, so you could enable pf and add those rules, but it wouldn't have any effect.

Also, you might want to look into openvpn. The client config is a little more complicated (having to set up default routes and some such, there's no automagic for Windows), but it's usually easier to configure on the server/router/firewall level since it runs over UDP.

Wish I could but iOS doesn't support it by default. The L2TP looks like more work but in the end it's just a lot easier to use OSX and iOS built in mechanism (I use it for work from our Sonicwall and it's great).

Anyway, thanks for the help!

Marinmo
Jan 23, 2005

Prisoner #95H522 Augustus Hill
I know this post is lacking information but I wanted to ask before going out of town for a few days and don't have access to the server in question right now, so with that out of the way ...

I recently set up my server with FreeBSD. It works very well for the most part, but somehow it seems completely unable to route properly to a select few sites whose IP numbers start with 192.x.x.x. My internal network is 192.168.1.x. The sites are not pingable from either the server itself, nor any computer on the network. I pretty much followed the handbook (section 32.10) because I don't need anything super advanced at first; just want a working box and work from there. Anyone seen this problem before and know of a one-shot solution? I'll come back and update/post additional information once I get back. Thanks!

underlig
Sep 13, 2007
I broke something.

I've migrated a virtualbox vhd to Esxi 5, which resulted in a 9gb vmdk-file for my FreeBSD 9.0 - RELEASE machine.

My problem now is when i grow the vmdk, FreeBSD sees the new size for the "physical drive" but i am unable to extend my filesystem to use all of the 25GB i grew.

I try to follow this guide: http://bsdbased.com/2009/11/30/grow-freebsd-ufs-filesystem-on-vmware-hdds but i am unsure of a lot of things, like Do i really have an ufs filesystem? (i think i do, "mount" says '/dev/ada0p2 on / (ufs, local, read-only)')

I boot into single user mode,
dmesg says ada0 25600MB (52428800 512 byte sectors: 15H 63S/T 16383C)

I used fdisk -u and answered yes to most of the questions, (the ones like in the guide)
fdisk -s shows size as "52428537" which i guess is somewhere close to 25GB.

Now my problem is using bsdlabel, bsdlabel -e just lists options, bsdlabel -e ada0 says "no valid label found", as do -e ada0p1 p2 and p3.

When i do "gpart list" i see my three (providers? 1,2,3 where 1 is freebsd-boot,2 is freebsd-ufs and 3 is freebsd-swap) all have label: (null). Is this why bsdlabel does not work?

I tried using gparted's livecd to resize any of them but that did not work at all.

If you haven't figured it out by now i have absolutely no idea what i'm doing.

** edit a few days later,
"gparted's livecd didn't work" = all partitions or whatever they are are listed as "unknown" and there is no option to resize any of them. I do however see the remaining free space after all current partitions.

So i booted on the freebsd 9 installationcd and chose to use it as a live cd,
gpart show ada0
says
ada0 GPT (25G)
1 freebsd-boot (64k)
2 freebsd-ufs (9.6G)
3 freebsd-swap (516M)
(space) - free - (14G)

But using gpart resize -i 2 ada0 just says "ada0p2 resized" but nothing actually happens to it.

underlig fucked around with this message at 11:07 on May 4, 2012

feld
Feb 11, 2008

Out of nowhere its.....

Feldman

Marinmo posted:

I recently set up my server with FreeBSD. It works very well for the most part, but somehow it seems completely unable to route properly to a select few sites whose IP numbers start with 192.x.x.x. My internal network is 192.168.1.x.

Please paste the output of "ifconfig" and "netstat -rn" when you get back. I'm guessing your netmask isn't a /24.


Thanks!

Marinmo
Jan 23, 2005

Prisoner #95H522 Augustus Hill

feld posted:

Please paste the output of "ifconfig" and "netstat -rn" when you get back. I'm guessing your netmask isn't a /24.


Thanks!
This was indeed the problem. Why are we using hexadecimal netmasks anyway?! Combination of being tired and not used to them proved to be a bad thing. Thank you, nevertheless!

feld
Feb 11, 2008

Out of nowhere its.....

Feldman

Marinmo posted:

This was indeed the problem. Why are we using hexadecimal netmasks anyway?! Combination of being tired and not used to them proved to be a bad thing. Thank you, nevertheless!

That's a holdover from ages ago. You don't *have* to use hex. Just use CIDR notation. It's perfectly fine for you to run ifconfig/put in rc.conf: 192.168.1.5/24

feld fucked around with this message at 14:36 on May 4, 2012

Adbot
ADBOT LOVES YOU

doomisland
Oct 5, 2004

Is there a way to enable PXE booting on an Intel NIC while booted into the OS? On intel's site they have the Boot Util tool for linux, windows, and dos but I haven't been able to find anything.

  • Locked thread