dg1727 | 19 Aug 2012 21:51
Favicon

How to get Btrfs on 2nd partition of USB HDD to automount as read/write

Hello, 

The question below is based on 
https://lists.ubuntu.com/archives/xubuntu-users/2012-
August/004509.html

Thanks in advance for any help with the following question, 
including pointing me to some other info resource if needed.  

I have a user with an Xubuntu 12.04.1 laptop, 32-bit.  He needs to 
use a USB hard disk drive which has 2 partitions:  the 1st 
partition is NTFS and the 2nd partition is Btrfs.  

When he plugs in the hard drive, both partitions auto-mount OK, 
except that the Btrfs partition automounts read-only.  That is, the 
permissions of the directories in /dev are drwx------ for the NTFS 
and dr-xr-xr-x for the Btrfs.  

How can the OS be set up so that the Btrfs will automount 
read/write?  

The "dmesg" command shows the following on plug-in of the drive:  

[ 7253.520087] usb 2-4: new high-speed USB device number 11 using 
ehci_hcd
[ 7253.656344] scsi11 : usb-storage 2-4:1.0
[ 7256.651677] scsi 11:0:0:0: Direct-Access     TOSHIBA  External 
USB 3.0 0001 PQ: 0 ANSI: 6
[ 7256.654722] sd 11:0:0:0: Attached scsi generic sg2 type 0
[ 7256.656970] sd 11:0:0:0: [sdb] 1465149168 512-byte logical 
(Continue reading)

C Anthony Risinger | 19 Aug 2012 22:05
Gravatar

Re: How to get Btrfs on 2nd partition of USB HDD to automount as read/write

On Sun, Aug 19, 2012 at 2:51 PM, dg1727 <dg1727 <at> hushmail.com> wrote:
>
> permissions of the directories in /dev are drwx------ for the NTFS
> and dr-xr-xr-x for the Btrfs.
>
> How can the OS be set up so that the Btrfs will automount
> read/write?

try:

chmod u+w /path/to/btrfs/mount

... for whatever reason mkfs.btrfs created new subvolumes (but not
snapshots!) with 555 perms, which essentially says "writable to nobody
at all" ... IIRC, this was changed within the last year or so.

--

-- 

C Anthony
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

David Sterba | 21 Aug 2012 17:36
Picon

Re: How to get Btrfs on 2nd partition of USB HDD to automount as read/write

On Sun, Aug 19, 2012 at 03:05:11PM -0500, C Anthony Risinger wrote:
> On Sun, Aug 19, 2012 at 2:51 PM, dg1727 <dg1727 <at> hushmail.com> wrote:
> > permissions of the directories in /dev are drwx------ for the NTFS
> > and dr-xr-xr-x for the Btrfs.
> >
> > How can the OS be set up so that the Btrfs will automount
> > read/write?
> 
> try:
> 
> chmod u+w /path/to/btrfs/mount
> 
> ... for whatever reason mkfs.btrfs created new subvolumes (but not
> snapshots!) with 555 perms, which essentially says "writable to nobody
> at all" ... IIRC, this was changed within the last year or so.

The issue with subvols pemr 0700 was indeed fixed, on the kernel side.

The problem with missing 'w' (ie mode 555) on a freshly mkfs'ed image is
still present and it's the user-space tools (mkfs) proble. Patch has
been sent some time ago

http://www.spinics.net/lists/linux-btrfs/msg17909.html

The workaround is to chmod as you suggested and is permanent once done.

david
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo <at> vger.kernel.org
(Continue reading)

Hugo Mills | 19 Aug 2012 22:10
Picon
Favicon

Re: How to get Btrfs on 2nd partition of USB HDD to automount as read/write

On Sun, Aug 19, 2012 at 03:51:47PM -0400, dg1727 wrote:
> Hello, 
> 
> The question below is based on 
> https://lists.ubuntu.com/archives/xubuntu-users/2012-
> August/004509.html
> 
> Thanks in advance for any help with the following question, 
> including pointing me to some other info resource if needed.  
> 
> I have a user with an Xubuntu 12.04.1 laptop, 32-bit.  He needs to 
> use a USB hard disk drive which has 2 partitions:  the 1st 
> partition is NTFS and the 2nd partition is Btrfs.  
> 
> When he plugs in the hard drive, both partitions auto-mount OK, 
> except that the Btrfs partition automounts read-only.  That is, the 
> permissions of the directories in /dev are drwx------ for the NTFS 
> and dr-xr-xr-x for the Btrfs.  
> 
> How can the OS be set up so that the Btrfs will automount 
> read/write?  

   As Anthony points out, this is a property of the filesystem, not
the OS or the mount options. Just use chmod.

   (It's only filesystems like FAT, which have no concept of
permissions, which have mount options to set permissions)

   Hugo.

(Continue reading)

dg1727 | 21 Aug 2012 21:28
Favicon

Re: How to get Btrfs on 2nd partition of USB HDD to automount as read/write

On Tue, 21 Aug 2012 11:36:32 -0400 David Sterba <dave <at> jikos.cz> 
wrote:
>On Sun, Aug 19, 2012 at 03:05:11PM -0500, C Anthony Risinger 
>wrote:
>> On Sun, Aug 19, 2012 at 2:51 PM, dg1727 <dg1727 <at> hushmail.com> 
>> wrote:
>> > permissions of the directories in /dev are drwx------ for the 
>> > NTFS and dr-xr-xr-x for the Btrfs.
>> >
>> > How can the OS be set up so that the Btrfs will automount
>> > read/write?
>> 
>> try:
>> 
>> chmod u+w /path/to/btrfs/mount
>> 
>> ... for whatever reason mkfs.btrfs created new subvolumes (but 
>> not snapshots!) with 555 perms, which essentially says "writable 
>> to nobody at all" ... IIRC, this was changed within the last 
>> year or so.
>
>The issue with subvols pemr 0700 was indeed fixed, on the kernel 
>side.
>
>The problem with missing 'w' (ie mode 555) on a freshly mkfs'ed 
>image is still present and it's the user-space tools (mkfs) 
>proble. Patch has been sent some time ago
>
>http://www.spinics.net/lists/linux-btrfs/msg17909.html
>
(Continue reading)

David Sterba | 22 Aug 2012 16:40
Picon

Re: How to get Btrfs on 2nd partition of USB HDD to automount as read/write

On Tue, Aug 21, 2012 at 03:28:22PM -0400, dg1727 wrote:
> Thanks a lot for these answers.  As an exercise, how would I track 
> that patch so I can tell when it has been released?  Pointing me to 
> a webpage that covers this would be fine.  

You can easily check that the patch appears in the main progs repo at

http://git.kernel.org/?p=linux/kernel/git/mason/btrfs-progs.git;a=summary

or you can clone the repo and check the git log directly.

david
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Gmane