Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux? |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
06-01-2019, 08:11 AM
|
#1
|
LQ Newbie
Registered: Sep 2010
Posts: 4
Rep:
|
Seagate 5TB External USB - EXT4 - Mounting Read-Only
Hello there,
I just purchased a Seagate 5TB External USB hard drive. Using gdisk, I made partitions and formatted them as EXT4 file system. The partitions auto-mount, but are read-only.
Earlier, the same partitions would mount with read-write. However, the earlier partitions were created using parted and I was seeing alignment errors while formatting with mkfs.ext4 and also while looking at details in fdisk.
So, I deleted the partitions and created them again using gdisk. No alignment issues now. But partitions are mounting read-only.
mkfs.ext4 /dev/sdb1
mke2fs 1.42.13 (17-May-2015)
/dev/sdb1 alignment is offset by 512 bytes.
This may result in very poor performance, (re)-partitioning suggested.
fdisk output
Device Start End Sectors Size Type
/dev/sdb1 65535 976733639 976668105 465.7G Linux filesystem
/dev/sdb2 976733640 1953532814 976799175 465.8G Linux filesystem
/dev/sdb3 1953532815 2930266454 976733640 465.8G Linux filesystem
/dev/sdb4 2930266455 3907000094 976733640 465.8G Linux filesystem
/dev/sdb5 3907000095 4883799269 976799175 465.8G Linux filesystem
/dev/sdb6 4883799270 5860532909 976733640 465.8G Linux filesystem
/dev/sdb7 5860532910 6837266549 976733640 465.8G Linux filesystem
/dev/sdb8 6837266550 7814000189 976733640 465.8G Linux filesystem
/dev/sdb9 7814000190 8790799364 976799175 465.8G Linux filesystem
/dev/sdb10 8790799365 9767533004 976733640 465.8G Linux filesystem
Partition 1 does not start on physical sector boundary.
Partition 3 does not start on physical sector boundary.
|
|
|
06-01-2019, 08:19 AM
|
#2
|
Member
Registered: May 2015
Location: Latvia
Distribution: Arch, Centos
Posts: 368
|
Probably nothing to do with how you format the drive but rather what is the ownership and permissions for the root folder of that drive
Post the output of ls -l /path/to/your/mountpoint/
|
|
1 members found this post helpful.
|
06-01-2019, 08:44 AM
|
#3
|
LQ Newbie
Registered: Sep 2010
Posts: 4
Original Poster
Rep:
|
xxx@xxx-laptop /media $ ls -lh
total 4.0K
drwxrwxrwx+ 12 root root 4.0K Jun 1 18:19 xxx
xxx@xxx-laptop /media $ ls -lh xxx/
total 40K
drwxr-xr-x 3 root root 4.0K Jun 1 11:54 0bfd2076-d34e-4b16-aa6a-8efd3e519402
drwxr-xr-x 3 root root 4.0K Jun 1 11:54 22c3076a-6109-49d2-8a94-4c82fb706f2c
drwxr-xr-x 3 root root 4.0K Jun 1 11:54 56670e2d-317e-46d7-93ec-0234237f8137
drwxr-xr-x 3 root root 4.0K Jun 1 11:54 69f8ac8c-1970-458e-8cab-a85ced3d7908
drwxr-xr-x 3 root root 4.0K Jun 1 11:53 7f9279aa-666d-4446-aa8b-8aefc43f0583
drwxr-xr-x 3 root root 4.0K Jun 1 11:53 924e7d6c-7e4f-4ef5-bab7-f3f89792974f
drwxr-xr-x 3 root root 4.0K Jun 1 11:53 9ad55055-d40e-4f37-8ef5-9d8ddc80cdd5
drwxr-xr-x 3 root root 4.0K Jun 1 12:41 9df7397c-ec18-4f77-9d2f-f833367f255d
drwxr-xr-x 3 root root 4.0K Jun 1 11:53 bf29f217-bcf8-4a71-aac1-fc549f2607f3
drwxr-xr-x 3 root root 4.0K Jun 1 11:53 d10d677f-3e19-4510-b532-4e2a85cc040a
xxx@xxx-laptop /media $
The partitions mount to /media/xxx/
I chmod /media/xxx/ giving 777 permissions thinking it would inherit to the folders underneath. However, the partitions that mount in this path, don't inherit the permission.
|
|
|
06-01-2019, 08:49 AM
|
#4
|
Member
Registered: May 2015
Location: Latvia
Distribution: Arch, Centos
Posts: 368
|
It seems all files belong to both root user and root group
I suppose your user is xxx, so you could try changing the ownership:
Code:
chown -R xxx:xxx /media/xxx
You'll need root permission to perform that action
|
|
2 members found this post helpful.
|
06-01-2019, 09:06 AM
|
#5
|
LQ Newbie
Registered: Sep 2010
Posts: 4
Original Poster
Rep:
|
Many thanks for your help and guidance, ugjka!
I can mount the partitions with read/write.
|
|
|
06-02-2019, 06:57 AM
|
#6
|
LQ Guru
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
|
Great to hear. If you want, you can mark the thread as "Solved" (see "Thread Tools" at the top of the thread).
|
|
|
06-03-2019, 12:11 AM
|
#7
|
Senior Member
Registered: Feb 2003
Distribution: debian
Posts: 4,137
|
$ mount
If it's actually read-only it'll show (ro,... ) to the side of where it was mounted. Otherwise it's a permissions issue as previously discovered. I didn't even know that you could change the root of an ext* partition. I always just created a sub-directory and chown'd that. But probably more of an effort to avoid lost+found in the usable path with the temptation to delete it. With a 2nd mount to bind the /mnt/ location with where I actually wanted it, like /home/username/.
# mount --rbind /mnt/p1/subdir /home/username
With systemd, you can boot with the / of your distro NOT specified in /etc/fstab. But it will mount read-only when that is the case. Which was my first thought when I read the thread title.
|
|
|
06-03-2019, 01:50 PM
|
#8
|
LQ Guru
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,788
|
I have this in my /etc/fstab for sdb1
Code:
/dev/sdb1 /mnt/hd auto noauto,relatime,diratime,user,exec,dev,suid,nofail 0 0
A lot of those options are for usb keys, but 'user' 'noauto' and suid (I think) help with user writes as long as it's ext2/3/4. I can mount sdb1 if it's ext or vfat (until recently anyhow) but not ntfs-3g. With a user option in sr0, I can mount that too as a luser. But if I let it mount automatically, root mounts it and my luser is locked out. If I don't have it mount automatically, and it's in fstab, a luser can mount it.
If I wasn't so half-assed, I'd go to uuids and have each disk mounted on it's own location. I'm in Slackware, where you do your own thing. If you have a distro that makes up your mind for you, this could be a lot messier.
|
|
|
06-03-2019, 08:12 PM
|
#9
|
Senior Member
Registered: Feb 2003
Distribution: debian
Posts: 4,137
|
My stab has UUID=... / ext4 defaults 1 0 and all that jazz. But I set my UUID to something simple to remember / type.
UUID=20190603-1000-1111-1111-111111111111
Where that's the YYYYMMDD that I created it and the HHMM, although I always put 00 for minutes. I don't normally do more than one install in a day, much less per hour. And mostly UUID because I boot from USB and /dev/??? is an unknown depending on how many other devices, hubs, and whatnots are in play. And the rest is what partition it's on.
|
|
|
All times are GMT -5. The time now is 06:12 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|