NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [SOLVED] newfs_udf(8) and other OSes



Here is a summary of the solution as found with the help of Benny
Siegert's suggestion:

My use case is a 2To USB disk that was used as a last resort backup for
a small network of mainly (various) Windows node with two NetBSD nodes,
one with a KerGIS server, and the other one built as a fileserver doing
internal backups and an "external" backup on USB disks changed every
week with the not connected one stored elsewhere (if something
absolutely desastrous should happen to two partitions on distinct disks
holding the same data, work could continue, without the NetBSD server,
by connecting the USB disk or, in case of total desaster, with the spare
one not in the same building with a maximum of 5 days of work lost).

I used NTFS via ntfs-3g(8) (from pkgsrc) but the performance is
abysmal and it is neither a documented format nor a filesystem directly
usable under NetBSD.

So I have tested UDF (newfs_udf(8) and mount_udf(8).

Sharing between NetBSD and Windows (tested resp. on 6.1.5 and 8.1), with
read/write support, one has to do the following (I created the GPT under
Windows, and formatted under Windows, but the reverse should work) :

1) Create a GPT header on the disk (on Windows, with the disk manager;
on NetBSD with gpt(8));

2) Add a GPT partition covering what space is left between the GPT
header and the backup copies.
	Under Windows, with the disk manager, assign a letter to
the single volume partition---this letter will be used when
formatting;
	Under NetBSD, still with gpt(8), specifying the type as "linux" or 
"windows" (it is in fact "Basic data partition") since UDF has no
identifier by itself;

3) Format the partition created (so it is not the whole disk, but the
slice starting after the header). 
	Under Windows, when assigning a letter to the partition,
this letter is to be used as the volume name: in a command prompt (it
is not accessible from the graphical interface):
	FORMAT volume_name /FS:UDF /Q
volume_name is for example "D:", the letter assigned to the partition;
"/Q" is for not scanning the whole disk to detect bad blocks (with
USB and To sizes this takes a loooooooong time). FWIW, I added
"/A:512" to specify a 512 bytes sector size, but I don't know if
it was taken into account or if it was needed for NetBSD compatibility.
	Under NetBSD, this slice has to be accessed not via /dev/rsd0d (this
is the whole disk) but by the wedge name. Whether create it with
dkctl(8) if you has just created the GPT using the information from 
gpt(8), or, if the disk has been deconnected or reconnected, the
/dev/dkN has already be assigned, and use this. Then format with
newfs_udf(8) (the message about the created wedges are on the console;
dmesg(8)).

4) On Windows, when the USB disk is ejected, the sessions are closed.
Under NetBSD, mount_udf(8) with "-c" to close the sessions after
unmouting.

Et voilà ! You could share read/write a disk with Windows and others,
using tools that are NetBSD system ones!

The uid etc. work under NetBSD (for NetBSD written files);
for Windows, we have "nobody" as a mapping for NetBSD.

By default, under NetBSD, UDF is 2.01. But it's the same default for
Windows FORMAT command so Reinoud Zandijk's job is great!
-- 
        Thierry Laronde <tlaronde +AT+ polynum +dot+ com>
                     http://www.kergis.com/
                     http://www.arts-po.fr/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C


Home | Main Index | Thread Index | Old Index