190
votes
Accepted
FreeBSD: Directory called ^C (really!) - how to remove?
^V (ctrl+v) works as a kind of escape sequence for the next key-press, inserting the associated value instead of taking whatever action that would normally be associated.
Making use of this, ^V^C (...
90
votes
FreeBSD: Directory called ^C (really!) - how to remove?
You may also remove the file by inode:
$ ls -i1
290742 foo
293246 ^C
$ find . -inum 293246 -delete
Whatever you do, for God's sake, do not put -delete before -inum:
$ touch foo bar baz quux
$ find ....
35
votes
Accepted
Delete 10M+ files from ZFS, effectively
Deletes in ZFS are expensive. Even more so if you have deduplication enabled on the filesystem (since dereferencing deduped files is expensive). Snapshots could complicate matters too.
You may be ...
32
votes
FreeBSD: Directory called ^C (really!) - how to remove?
Another option is to use rm -ri ./*; rm will ask you before deleting any file and directory, so you just need to reply y to the "bad" file, and n to all the others.
Actually, in your case you can ...
31
votes
Accepted
FreeBSD Jails or Docker instances
I will address some of the aspects of FreeBSD jails and Linux Docker, of how they are similar and how they are different.
both serve the same goal: it's an implementation of lightweight ...
29
votes
Delete 10M+ files from ZFS, effectively
How is it possible that resilvering the whole array takes an hour, but deleting from the disk takes 4 days?
Consider an office building.
Removing all of the computers and furniture and fixings ...
27
votes
Accepted
How bad is it to have multiple devices with the same SSH server keys?
Rather than storing host-specific data such as ssh host keys on the SD card or other read-only media, you can store this in NVRAM, which is what it's for on an embedded system. You'll need to do some ...
23
votes
FreeBSD: Directory called ^C (really!) - how to remove?
One option is to look up the file name with something other than ls. If you know it was produced by a verbatim Ctrl+C, you can find the ASCII character produced using a table of control characters, or ...
22
votes
Accepted
Bare metal or virtualize?
No question, virtualize. The benefits and flexibility afforded by virtualization far outweigh the negligible performance hit.
Your plan, though is sub-optimal, primarily because Virtualbox is a ...
17
votes
How to install python3.4-pip in FreeBSD 10.1?
With Python 3.4 and later, you can use the ensurepip module to install pip on FreeBSD and elsewhere.
python3.4 -m ensurepip
should install pip as pip3.4.
16
votes
Accepted
How do I disable hard disk spin down or head parking in FreeBSD?
On FreeBSD 12, camcontrol is used to control HDD power management, including spinning down and hard parking. Previously, ataidle or atacontrol was used, but their functionalities have already been ...
15
votes
linux : netstat listening queue length
Let's look into source code, as it's the best documentation in the world of open source.
net/ipv4/tcp_diag.c:
if (sk->sk_state == TCP_LISTEN) {
r->idiag_rqueue = sk->sk_ack_backlog;
...
15
votes
ZFS import unable to find any pools
for future reference, simply doing zpool import -a (will search for all), usually helps as well when a zpool/zfs fs isn't recognised.
15
votes
Should I create ZFS zpools with whole disks or partitions?
Use one slice/partition dedicated for ZFS per physical disc and leave some space unpartitioned. That way if you ever need to replace a drive and the replacement is 10 sectors smaller, you'll still be ...
15
votes
FreeBSD: Directory called ^C (really!) - how to remove?
Often in this kind of situations it is easy to come up with a wildcard pattern that matches the relevant file.
In your case, this would be simply ? (matching all file names with precisely one ...
14
votes
Backing up a MySQL database via ZFS snapshots
You need a full database lock to backup a (most) database(s) consistently.
The manual https://dev.mysql.com/doc/refman/5.5/en/backup-methods.html says FLUSH TABLES WITH READ LOCK is correct for ZFS ...
13
votes
Accepted
BSD nc (netcat) does not terminate on EOF
I, too, was puzzled by netcat's behavior, so I dug into the code. Here's the whole story:
nc servers (nc -l) and clients only exit after the mutual connection was closed. That is, if each of the ...
12
votes
How bad is it to have multiple devices with the same SSH server keys?
The impact of shipping the same key pair with all your devices is directly related to the security of the clients connecting to them, as it means that there is no way (from an SSH client) to uniquely ...
12
votes
nginx php-fpm child exited with code 0
First, this is the expected behavior. The messages are marked as NOTICE, the default in php-fpm.conf:
; Log level
; Possible Values: alert, error, warning, notice, debug
; Default Value: notice
;...
11
votes
FreeBSD: Directory called ^C (really!) - how to remove?
You can use Midnight Commander (mc) to delete the file - just select with up/down buttons and press F8.
I did that occasionally when file names had strange characters due to encoding.
11
votes
Accepted
Offline uncorrectable sectors in SSDs being used for ZFS L2ARC?
Those numbers are obviously bogus. Your SSD doesn't have that many sectors at all, let alone offline uncorrectable ones. Check for firmware updates for your SSD that will fix the problem. Otherwise, ...
10
votes
Accepted
How to check if RAM is running in ECC mode?
Today I found out that there is a commercial version of memtest86 (without the +) from PassMark that offers a free version too which thankfully included ECC-Checks.
In addition it also supports DDR4 ...
9
votes
How do I non-interactively update FreeBSD system (and ports)?
On FreeBSD-10.2 there's a new option to allow this:
freebsd-update fetch --not-running-from-cron
From the manpage:
--not-running-from-cron
Force freebsd-update fetch to proceed when there is ...
8
votes
Delete 10M+ files from ZFS, effectively
Ian Howson gives a good answer on why it is slow.
If you delete files in parallel you may see an increase in speed due to the deletion may use the same blocks and thus can save rewriting the same ...
8
votes
Backing up a MySQL database via ZFS snapshots
I've ripped off and adapted a conceptually simple script in Bash which I found in another Server Fault post by Tobia. It should get you about 90% of the way there.
mysql_locked=/var/run/mysql_locked
...
8
votes
Accepted
FreeBSD rc.d script doesn't start as a daemon
The RC script itself is not intended to daemonize, but is expected to start and stop the daemon.
If your service does not have an option to start as a daemon, you can use daemon(8) to manage that ...
8
votes
Accepted
Install Java 9, 10, 11, or 12 on FreeBSD 11.1
Java 11 & 12
OpenJDK 11 and 12 can now be found in the Ports tree. See:
java/openjdk11
java/openjdk12
An effort is underway to see future versions of OpenJDK for FreeBSD regularly made ...
8
votes
Accepted
How to move iocage jails from one ZFS pool to another?
To move iocage from /mnt/OLD/iocage to /mnt/NEW/iocage:
Export jails
iocage stop JAILNAME
iocage export JAILNAME
This creates a dated .zip of the jail in /mnt/OLD/iocage/images.
Set up new pool
Use ...
7
votes
Installing multiple php versions plus extensions on freebsd
The variable noone talked about is called PHPBASE:
It allows working with multiple PHP installs on a FreeBSD server, placing each in it's own directory.
It's then used in make.conf to point specific ...
7
votes
Delete 10M+ files from ZFS, effectively
There's a number of things going on here.
First, all modern disk technologies are optimised for bulk transfers. If you need to move 100MB of data, they'll do it much faster if they're in one ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
freebsd × 1534zfs × 173
linux × 106
truenas × 99
networking × 75
jail × 60
pf × 58
pfsense × 52
apache-2.2 × 50
ssh × 47
firewall × 47
mysql × 44
bsd × 43
nginx × 42
unix × 38
php × 34
routing × 30
raid × 28
filesystems × 28
nfs × 27
ipfw × 27
postfix × 26
apache-2.4 × 26
security × 24
hard-drive × 24