You are not logged in.
Hello everyone, thanks for reading
I recently decided to reformat my computer's storage drive to btrfs since I've migrated away from Windows. I used rsync to back everything up to an external hard drive, wiped the HDD using (from memory here, apologies if the command isn't quite right)
dd if=/dev/null of=/dev/sda bs=5M count= 100
After that I was able to write over the volume and make it btrfs
I commented out the lines in /etc/fstab relating to the drive to stop it automounting, and rebooted, everything seems to work fine until I try to mount it.
I can manually mount the drive. However, when I do, it only allows me to make changes to the drive as root. My standard user account has no access.
In addition, if I modify the /etc/fstab entry for btrfs (using defaults as the options), the system boots to emergency maintenance mode.
That's where I'm lost, I have no idea if it's a permissions error or if I'm missing something obvious, but I'm almost at the point of formatting as ext4 and calling it a day, just want to see if anybody has anything that might work.
Any help is greatly appreciated.
Last edited by ispy (2015-07-05 19:43:16)
Offline
Can you post your /etc/fstab?
Is the drive a separate one or another partition of the same boot+root partition?
Offline
The drive is a 2tb HDD, my system boots off a 120gb SSD. So the HDD isn't necessary for boot, it's just a data drive.
$ cat /etc/fstab
#
# /etc/fstab: static file system information
#
# <file system> <dir> <type> <options> <dump> <pass>
# /dev/sdb2
UUID=cadde24d-73c7-4de1-8c51-293dfa5faeda / ext4 rw,relatime,data=ordered 0 1
# /dev/sdb1
UUID=744ef065-e9e6-426f-9e0b-b03664a5b04d /boot ext4 rw,relatime,data=ordered 0 2
# /dev/sdb4
UUID=ce6bccb2-9f36-47a7-8fc4-d738736d65f4 /home ext4 rw,relatime,data=ordered 0 2
# /dev/sdb3
UUID=88730967-5f66-4c65-b0fd-47585bfc20c9 none swap defaults 0 0
# <file system> <dir> <type> <options> <dump> <pass>
# /dev/sda /media/hdd1 btrfs defaults 0 0
# LABEL=/backup /media/backupdrive ext4 defaults 1 2
Offline
$ cat /etc/fstab
#
# /etc/fstab: static file system information
#
# <file system> <dir> <type> <options> <dump> <pass>
# /dev/sdb2
UUID=cadde24d-73c7-4de1-8c51-293dfa5faeda / ext4 rw,relatime,data=ordered 0 1
# /dev/sdb1
UUID=744ef065-e9e6-426f-9e0b-b03664a5b04d /boot ext4 rw,relatime,data=ordered 0 2
# /dev/sdb4
UUID=ce6bccb2-9f36-47a7-8fc4-d738736d65f4 /home ext4 rw,relatime,data=ordered 0 2
# /dev/sdb3
UUID=88730967-5f66-4c65-b0fd-47585bfc20c9 none swap defaults 0 0
# Root Btrfs device
#UUID=700dce1d-3535-4173-9aa2-711495597a7a /media/hdd btrfs rw,relatime,compress=lzo,space_cache,autodefrag 0
# Default btrfs subvolume
#UUID_SUB=88d096f0-3e8f-479a-81dd-61a7ab3dc0e1 /media/hdd1 btrfs rw,relatime,compress=lzo,space_cache,autodefrag 0
# BACKUP DRIVE
# LABEL=/backup /media/backupdrive ext4 defaults 1 2
I updated my fstab to include both the btrfs root volume and the subvolume (found using sudo blkid)
I also ran chown 755 on the mount points /media/hdd and /media/hdd1, no change. I'm able to create files and directories as root but not as standard user.
EDIT: much of the changes came from reading this thread, but I'm still not able to reboot cleanly with the entries in my fstab uncommented.
Last edited by ispy (2015-06-29 18:58:17)
Offline
To mount my external partitions with write permissions I had to give write permissions to the wheel group, with 'chwon root:wheel mountpoint'.
Offline
Got a chance to tinker with it today.
Wasn't sure if the drive needs to be mounted when I chown?
I tried it unmounted and mounted, same problem either way.
Creating directories gives me this as a standard user:
$ mkdir -p test2
mkdir: cannot create directory ‘test2’: Permission denied
When I try to open a text file in vim as a standard user I can't write to the drive, vim gives me this error.
"test2.txt"
"test2.txt" E212: Can't open file for writing
Press ENTER or type command to continue
The chown commands complete with no errors but I can't write to the drive unless I sudo
Offline
I think I solved it.
I ended up running
chmod -R 777 /media/hdd
and that fixed it.
The second entry in my fstab (for the subvolume) was causing the no boot problem. It wasn't being recognized, but i commented its entry out and the problem went away. The primary btrfs device automounts fine and I can use it now!
Thank you for your help!
Offline