You are not logged in.

#1 2019-05-01 17:33:55

Hoid
Member
Registered: 2019-05-01
Posts: 19

[SOLVED] Empty drive mounting as read only

I know this has been posted about before but I can't seem to find the answer I need. Basically I wiped my second hard drive (there wasn't anything important on it) and made it an ext4 filesystem then mounted it in /run/media/username and it was read only. I tried remounting it in /home and it's still read only. the output of fsck /dev/sda reads

fsck from util-linux 2.33.2
e2fsck 1.45.0 (6-Mar-2019)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/sda

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
or
    e2fsck -b 32768 <device>

The drive was working fine 3 days ago before I switched from Ubuntu to Arch, any help would be appreciated as this drive is like 70% of my storage

Last edited by Hoid (2019-05-02 14:34:03)


ctrl+c ctrl+v
The two most important shortcuts for any programmer

Offline

#2 2019-05-01 19:56:18

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,423

Re: [SOLVED] Empty drive mounting as read only

Welcome to the boards Hoid

If it is empty, what prevents you from recreating the file system? What command did you use to create the filesystem? Did you try to create the filesystem on the entire drive as opposed to a partition? Outputs of

sudo fdisk -l
mount
lsblk -f

might help to get a better picture. Post these (and your original output) in [ code ] [ /code ] tags. FWIW with regards to "read only" since ext4 is a permissions aware filesystem, if you intend to write to it with your user you'd likely have to chown it to your user first.

Last edited by V1del (2019-05-01 19:56:29)

Offline

#3 2019-05-01 22:42:53

Hoid
Member
Registered: 2019-05-01
Posts: 19

Re: [SOLVED] Empty drive mounting as read only

fsck from util-linux 2.33.2
e2fsck 1.45.0 (6-Mar-2019)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/sda

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
or
    e2fsck -b 32768 <device>
[stormfather@roshar ~]$ sudo fdisk -l
Disk /dev/nvme0n1: 238.5 GiB, 256060514304 bytes, 500118192 sectors
Disk model: SAMSUNG MZVLW256HEHP-000H1              
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 3F95F60B-34B6-4FC1-88B6-45A843A70A66

Device           Start       End   Sectors  Size Type
/dev/nvme0n1p1    2048   1050623   1048576  512M EFI System
/dev/nvme0n1p2 1050624   9439231   8388608    4G Linux swap
/dev/nvme0n1p3 9439232 500118158 490678927  234G Linux filesystem


Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: HGST HTS721010A9
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: A7C32D3E-6D57-4BB9-957F-A537484E50A1

Device     Start        End    Sectors   Size Type
/dev/sda1   2048 1953525134 1953523087 931.5G Linux filesystem


Disk /dev/sdb: 115.3 GiB, 123815854080 bytes, 241827840 sectors
Disk model:                 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x87006825

Device     Boot Start       End   Sectors   Size Id Type
/dev/sdb1        2048 241827839 241825792 115.3G  b W95 FAT32
 

[stormfather@roshar ~]$ mount 
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
dev on /dev type devtmpfs (rw,nosuid,relatime,size=8161468k,nr_inodes=2040367,mode=755)
run on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
/dev/nvme0n1p3 on / type ext4 (rw,relatime)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=45,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=16275)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
/dev/nvme0n1p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=1633788k,mode=700,uid=1000,gid=985)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=985)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)


[stormfather@roshar ~]$ lsblk -f
NAME        FSTYPE LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINT
sda                                                                          
`-sda1      ext4         5d2f90d7-50d9-41a4-a8fa-f176b9193d15                
sdb                                                                          
`-sdb1      vfat         A454-4026                                           
nvme0n1                                                                      
|-nvme0n1p1 vfat         3396-B360                               454M    11% /boot
|-nvme0n1p2 swap         a1d1062c-1de5-4c62-b975-d2cb4f4482b3                [SWAP]
`-nvme0n1p3 ext4         f17375ef-9e98-4c29-b9f4-f5124a7ccabf  158.2G    26% /
[stormfather@roshar ~]$ 

there's the outputs of all of that. And thanks for the welcome
EDIT: I should add that I have reformatted the drive twice already, and re-partitioned it aswell

Last edited by Hoid (2019-05-01 22:43:46)


ctrl+c ctrl+v
The two most important shortcuts for any programmer

Offline

#4 2019-05-02 00:35:07

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,423

Re: [SOLVED] Empty drive mounting as read only

If your filesystem is actually on the partition, then fsck /dev/sda is the wrong command and you should try fsck /dev/sda1 instead. Your drive is not mounted in any of these outputs which decreases their usefulness.

Mount the drive and repost those. How do you determine that it is read only? Does the line in mount actually mount as ro, or you can you simply not write as your normal user? If the latter that is normal, you'd have to chown the intended mountpoint

Offline

#5 2019-05-02 01:46:40

mmdamin
Member
From: Iran
Registered: 2019-02-19
Posts: 205
Website

Re: [SOLVED] Empty drive mounting as read only

as you said you mount it on /run/media/... you are using a file manager/udisks. try mount it by hand and see can you 'touch /mnt/file' or not.

# mount -o rw /dev/sda1 /mnt
# touch /mnt/file

Offline

#6 2019-05-02 14:33:27

Hoid
Member
Registered: 2019-05-01
Posts: 19

Re: [SOLVED] Empty drive mounting as read only

Solved!
Just had to chown it, just a noob mistake. Thanks for the help


ctrl+c ctrl+v
The two most important shortcuts for any programmer

Offline

Board footer

Powered by FluxBB