Solved [Solved] Can /etc/fstab lines be wrapped?

The question is very simple, but I couldn't find the answer in fstab(5): can lines in /etc/fstab be wrapped? E.g. would something like the following work or not:
Code:
/some/rather/long/path/here  \
/some/even/longer/mount/point/there \
nullfs   rw   0  0
 
Re: Can /etc/fstab lines be wrapped?

The man page specifically states:
Code:
Each file system is described on a separate line; fields on each line are separated by tabs or spaces.
A "\<newline>" is definitely not a tab or space, so I would say it would be treated as a "\" as the content of whatever field it occurred in, and the next line would be the start of the next file system description.
 
Re: Can /etc/fstab lines be wrapped?

When in doubt, try?

Code:
root@smtp2:/etc # cat fstab
//nobody@backup/transfer \
/opt/transfer \
smbfs   rw,noauto,-Ibackup,-N 0 0

root@smtp2:/etc # mount /opt/transfer
fstab: /etc/fstab:1: Inappropriate file type or format
fstab: /etc/fstab:2: Inappropriate file type or format
fstab: /etc/fstab:3: Inappropriate file type or format
fstab: /etc/fstab:1: Inappropriate file type or format
fstab: /etc/fstab:2: Inappropriate file type or format
fstab: /etc/fstab:3: Inappropriate file type or format
mount: /opt/transfer: unknown special file or file system
So I'd say the answer is no. I can't speak for FreeBSD 10 though but something tells me that this behaviour has probably been left unchanged.
 
Re: Can /etc/fstab lines be wrapped?

Nope, there's no backspace handling in /usr/src/lib/libc/gen/fstab.c... yet. Send patches! :)
 
Re: Can /etc/fstab lines be wrapped?

ShelLuser said:
When in doubt, try?
If I had a machine available, I would have ;) But thanks for doing my work for me :beergrin
worldi said:
Nope, there's no backspace handling in /usr/src/lib/libc/gen/fstab.c... yet. Send patches! :)
If I can find the time, maybe I will.

Thanks all.
 
Back
Top