Is there a way to use a FAT16 partition (Android on USB) for a bzr repository?

Asked by Hobson Lane on 2011-09-12

I can't seem to checkout/update/pull/merge onto a USB drive or Android device (FAT16 MS-DOS partition) in Ubuntu. I get

    bzr: ERROR: [Errno 1] Operation not permitted

And is there any way to get more --verbose details about an error?

Question information

Language:
English Edit question
Status:
Solved
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Solved by:
Hobson Lane
Solved:
2011-09-12
Last query:
2011-09-12
Last reply:
2011-09-12
Martin Pool (mbp) said : #1

Hi,

If you look in ~/.bzr.log or run with -Derror there should be more details.

This is <https://bugs.launchpad.net/bzr/+bug/190725>; I'll see if I can fix it now.

Martin Pool (mbp) said : #2

I can't reproduce this yet, so if you can add a traceback and other data to that bug, that would help.

John A Meinel (jameinel) said : #3

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 09/12/2011 03:41 AM, Hobson Lane wrote:
> New question #170851 on Bazaar:
> https://answers.launchpad.net/bzr/+question/170851
>
> I can't seem to checkout/update/pull/merge onto a USB drive or Android device (FAT16 MS-DOS partition) in Ubuntu. I get
>
> bzr: ERROR: [Errno 1] Operation not permitted
>
> And is there any way to get more --verbose details about an error?
>

If you run with "-Derror" it will also show you the traceback for where
it is getting the exception.

My guess is that it is failing to acquire an OS lock on a file. Which
would only happen if you also had a working tree on the drive (checkout).

If you created the checkout on your local machine only, and then just
used the USB drive as a repository storage (no working tree, see 'bzr
init-repo --no-trees'), I think it would work.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5t7dUACgkQJdeBCYSNAAPySACePAlf9J40NqsOBm5rbWh+R0l+
zyIAoKiHatyT+Z2xhtKOnmzucD+1K9Zg
=12Py
-----END PGP SIGNATURE-----

Hobson Lane (hobs) said : #4

/etc/dev/rules.d/71-android.rules
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="0c91", MODE="0666", OWNER="hobs"

It auto-mounts as

    Size: 7.42 GB
    Partition Type: W95 FAT32 (LBA)(0xc)
    Mount point: /media/83E2-0FEC
    Mount Point when Rebooted: None
    File System: vfat32

    dmesg

[48843.400067] usb 2-2: new high speed USB device using ehci_hcd and address 11
[48843.548543] scsi11 : usb-storage 2-2:1.0
[48844.550254] scsi 11:0:0:0: Direct-Access HTC Android Phone 0100 PQ: 0 ANSI: 2
[48844.550960] sd 11:0:0:0: Attached scsi generic sg2 type 0
[48844.560503] sd 11:0:0:0: [sdb] Attached SCSI removable disk
[49347.014039] sd 11:0:0:0: [sdb] 15564800 512-byte logical blocks: (7.96 GB/7.42 GiB)
[49347.015995] sd 11:0:0:0: [sdb] Assuming drive cache: write through
[49347.021976] sd 11:0:0:0: [sdb] Assuming drive cache: write through
[49347.025078] sdb: sdb1

    cd /media/83E2-0FEC
    mkdir notes
    cd notes
    bzr init-repo -Derror --no-tree --verbose

Created a standalone branch (format: 2a)

    bzr checkout -Derror ~/Notes/briefcase/notes
    bzr: ERROR: exceptions.OSError: [Errno 1] Operation not permitted

Problem seems to be with a symlink somewhere in my working copy or repo that has no equivalent on a FAT
No files are copied over, and here's the trace.

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 924, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 1124, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 689, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 711, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/builtins.py", line 1328, in run
    accelerator_tree, hardlink)
  File "/usr/lib/python2.7/dist-packages/bzrlib/branch.py", line 1452, in create_checkout
    hardlink=hardlink)
  File "/usr/lib/python2.7/dist-packages/bzrlib/bzrdir.py", line 1291, in create_workingtree
    accelerator_tree=accelerator_tree, hardlink=hardlink)
  File "/usr/lib/python2.7/dist-packages/bzrlib/workingtree_4.py", line 1471, in initialize
    delta_from_tree=delta_from_tree)
  File "/usr/lib/python2.7/dist-packages/bzrlib/transform.py", line 2414, in build_tree
    delta_from_tree)
  File "/usr/lib/python2.7/dist-packages/bzrlib/transform.py", line 2506, in _build_tree
    tree)
  File "/usr/lib/python2.7/dist-packages/bzrlib/transform.py", line 2664, in new_by_entry
    return tt.new_symlink(name, parent_id, target, entry.file_id)
  File "/usr/lib/python2.7/dist-packages/bzrlib/transform.py", line 793, in new_symlink
    self.create_symlink(target, trans_id)
  File "/usr/lib/python2.7/dist-packages/bzrlib/transform.py", line 1329, in create_symlink
    os.symlink(target, self._limbo_name(trans_id))
OSError: [Errno 1] Operation not permitted

Hobson Lane (hobs) said : #5

Thanks for the suggestions. Sorry if my question isn't posed properly.

Hobson Lane (hobs) said : #6

Thanks jmeinel and mbp. Solved.

There was a symlink in my desktop repo tree causing the grief. Removed it and all is well.

You may eventually want bzr to handle symlinks better (warn but not error), but I seem to recall reading in the docs somewhere that that may not be in the cards.

You're right, jmeinel, a --no-tree init followed by a pull (instead of a checkout) does work, even when the desktop repo has a symlink. Unfortunately, it doesn't provide the working copy that I'd like to have to be able to edit on my FAT device for merging back with the desktop repo/working copy. And doing a second checkout within elsewhere on the FAT from the --no-tree repo on the FAT I still get the Errno1 with a similar traceback pointing to a symlink creation problem.

So I started a new repo and only put a text file in it (to ensure no symlinks), and **voila, no error**.

Just for completeness the .bzr.log requested earlier is below.

    tail -n 100 ~/.bzr.log

Mon 2011-09-12 20:39:23 +0800
0.052 bazaar version: 2.3.4
0.052 bzr arguments: [u'init', u'--no-tree', u'-Derror', u'--verbose']
0.079 looking for plugins in /home/hobs/.bazaar/plugins
0.080 looking for plugins in /usr/lib/python2.7/dist-packages/bzrlib/plugins
0.173 encoding stdout as sys.stdout encoding 'UTF-8'
0.221 creating repository in file:///media/83E2-0FEC/notes/.bzr/.
0.241 creating branch <bzrlib.branch.BzrBranchFormat7 object at 0x8cc1f8c> in file:///media/83E2-0FEC/notes/
0.279 Transferred: 0kB (0.0kB/s r:0kB w:0kB)
0.279 return code 0

Mon 2011-09-12 20:40:10 +0800
0.053 bazaar version: 2.3.4
0.053 bzr arguments: [u'checkout', u'-Derror', u'/home/hobs/Notes/briefcase/notes']
0.080 looking for plugins in /home/hobs/.bazaar/plugins
0.080 looking for plugins in /usr/lib/python2.7/dist-packages/bzrlib/plugins
0.172 encoding stdout as sys.stdout encoding 'UTF-8'
0.194 opening working tree '/home/hobs/Notes/briefcase/notes'
0.209 opening working tree '/home/hobs/Notes/briefcase/notes'
0.223 creating repository in file:///media/83E2-0FEC/notes/notes/.bzr/.
0.270 creating branch <bzrlib.branch.BzrBranchFormat7 object at 0xb6f23e0c> in file:///media/83E2-0FEC/notes/notes/
0.322 Using fetch logic to copy between CHKInventoryRepository('file:///home/hobs/Notes/briefcase/notes/.bzr/repository/')(RepositoryFormat2a()) and CHKInventoryRepository('file:///media/83E2-0FEC/notes/notes/.bzr/repository/')(RepositoryFormat2a())
0.323 fetch up to rev {<email address hidden>}
0.469 trying to create missing lock '/media/83E2-0FEC/notes/notes/.bzr/checkout/dirstate'
0.474 opening working tree '/media/83E2-0FEC/notes/notes'
0.508 Transferred: 0kB (0.0kB/s r:0kB w:0kB)
0.515 Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 924, in exception_to_return_code
    return the_callable(*args, **kwargs)
 ...
  File "/usr/lib/python2.7/dist-packages/bzrlib/transform.py", line 1329, in create_symlink
    os.symlink(target, self._limbo_name(trans_id))
OSError: [Errno 1] Operation not permitted

0.515 return code 3