LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-13-2017, 04:36 PM   #1
overwhelmednewbie
LQ Newbie
 
Registered: Sep 2017
Posts: 18

Rep: Reputation: Disabled
no write after reformat to ext4, Linux Xubuntu


Greetings all,

This is my first post here and I’m glad to be aboard. I use Xubuntu 16.04 with an I5 processor, ssd and a Lenovo ThinkCenter M91P punch box-it flies!!

I do need help with formatting an ext4 drive though. I’ve just about given up.

I recently was given a 300GB drive, and I’d like to use it as a portable USB drive with no OS onboard.

I removed my primary SSD from my system, booted with a live DVD, and proceeded to wipe the drive by overwriting miscellaneous data. I then formatted it as an ext4 partition using gparted. After the format, I can’t write write to it however, it appears to be owned by root/root. There are so many articles regarding how to overcome this problem, but I’m not quite able to understand them because the articles are to technical for my level of expertise.

I believe I need to use the chown command to change the ownership of the drive. I have removed my primary drive again (temporally) and have booted from the Live DVD. I started gparted and found my drive was mounted in /dev/sda1. I then issued the following command:

sudo chown -R paulaul /dev/sda1

It didn’t work and it objected to the paulaul name. Since I was running from the live DVD, I didn’t expect it to reject the name ‘Paul’, but that is exactly what it did.

Any suggestions??
 
Old 09-13-2017, 04:45 PM   #2
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Welcome to LQ!
There are many ways to skin this cat. Actually, Ubuntu should mount USB devices automatically when you plug them in and user should have access by default. It does not work for you?
 
Old 09-13-2017, 05:28 PM   #3
overwhelmednewbie
LQ Newbie
 
Registered: Sep 2017
Posts: 18

Original Poster
Rep: Reputation: Disabled
TY Emerson,

The drive does mount itself. But I can't drop and drag to store a file on it.

I could make a video to show what really happens, but I suspect the video would be to large to store here.

If I format the drive in any other format, there is no problem. Any EXTx formatted drive won't allow files to be written to the drive. Heres a screen capture showing the permissions.
Attached Thumbnails
Click image for larger version

Name:	test.png
Views:	18
Size:	31.6 KB
ID:	25856  
 
Old 09-13-2017, 05:43 PM   #4
overwhelmednewbie
LQ Newbie
 
Registered: Sep 2017
Posts: 18

Original Poster
Rep: Reputation: Disabled
I think it is a bug in gparted, but it is a long standing issue. The first time I tried linux (in 2011), I remember the same problem. I gave up and walked away from linux in 2011, because of this issue. And, I can't believe it hasn't been fixed. This is not a complaint or a gripe-as I understand linux is provided 'as is'. But it sure would be nice to correct the issue, many users have the same issue.

I believe I figured out a work around....I simply install an OS on the drive and the default permissions for the drive allow copying riles to the root directory, or to the home directory. If there was a small linux version, I would install it and simply use that OS to allow writes to the drive.
 
Old 09-13-2017, 05:52 PM   #5
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
That's overkill for sure. You could add this drive to your /etc/fstab and set the mount options there, including the mount point. It probably makes sense to use filesystem UUID instead of device node there.
 
Old 09-13-2017, 05:58 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
The permission is on the mountpoint (/run/media/<blah>/<blah>/...) not the device node (/dev/sda1). Don't try messing with device nodes - even when they are partitions rather than physical devices; /dev/sda is the device node for the disk itself.
From your real system, plug the drive in and run this, and post the output.
Code:
df -hT
sudo lsblk -f
mount | grep -i /dev/sd

Last edited by syg00; 09-13-2017 at 06:00 PM. Reason: add mount
 
Old 09-13-2017, 07:58 PM   #7
overwhelmednewbie
LQ Newbie
 
Registered: Sep 2017
Posts: 18

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by syg00 View Post
The permission is on the mountpoint (/run/media/<blah>/<blah>/...) not the device node (/dev/sda1). Don't try messing with device nodes - even when they are partitions rather than physical devices; /dev/sda is the device node for the disk itself.
From your real system, plug the drive in and run this, and post the output.
Code:
df -hT
sudo lsblk -f
mount | grep -i /dev/sd

Heres the output:

Code:
pita@pita:~$ df -hT
Filesystem                   Type      Size  Used Avail Use% Mounted on
udev                         devtmpfs  2.9G     0  2.9G   0% /dev
tmpfs                        tmpfs     580M  8.5M  571M   2% /run
/dev/mapper/xubuntu--vg-root ext4      112G  104G  1.4G  99% /
tmpfs                        tmpfs     2.9G   44M  2.8G   2% /dev/shm
tmpfs                        tmpfs     5.0M  4.0K  5.0M   1% /run/lock
tmpfs                        tmpfs     2.9G     0  2.9G   0% /sys/fs/cgroup
/dev/sda1                    ext2      472M  366M   83M  82% /boot
tmpfs                        tmpfs     580M   40K  580M   1% /run/user/1000
/home/pita/.Private          ecryptfs  112G  104G  1.4G  99% /home/pita
pita@pita:~$ 



pita@pita:~$ sudo lsblk -f
[sudo] password for pita: 
NAME               FSTYPE  LABEL UUID                                   MOUNTPOINT
sda                                                                     
├─sda1             ext2          e3ffe357-49b5-475a-8cd0-2c93d45df6e2   /boot
├─sda2                                                                  
└─sda5             crypto_       6c7618bf-cbbc-4442-aa91-ec18101fe9f0   
  └─sda5_crypt     LVM2_me       Zl8tz7-6ZoS-ZruN-FCTP-3kcy-3gO1-FXM08x 
    ├─xubuntu--vg-root
    │              ext4          94e2db52-1728-45ee-b669-d4bdf90271b0   /
    └─xubuntu--vg-swap_1
                   swap          779de47c-8061-410c-832c-ef6b170bd9c0   
      └─cryptswap1 swap          9a3f9b12-a1f3-48e7-b652-dd5ca41d948e   [SWAP]
sdb                                                                     
└─sdb1             ntfs          6C782FE91CCA8C56                       
sr0                                                                     



pita@pita:~$ mount | grep -i /dev/sd
/dev/sda1 on /boot type ext2 (rw,relatime,block_validity,barrier,user_xattr,acl)
pita@pita:~$

At the moment I ran the suggested code, the usb portable drive was formatted in NTFS.....which appears to be fully functional. And that my primary drive is encrypted.

TY
 
Old 09-13-2017, 09:32 PM   #8
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
You probably need to create another folder under / on the ext# filesystem. By default only root:root has the / permissions.

# mount /dev/sdA# /mnt
# mkdir /mnt/MyNonRootStuff
# chown user:user /mnt/MyNonRootStuff

then you should be able to drag stuff to /mnt/MyNonRootStuff/, but NOT to /mnt/ (unless you are root). It's a unix permissions thing, not really specific to linux.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cant write to new ext4 partition - no idea why louierev07 Linux - Newbie 4 07-27-2016 04:29 PM
[SOLVED] Use external usb hard drive with NTFS-3G or reformat to Journalised FS: ext4 Pedro Blom Linux - Hardware 4 02-04-2016 02:46 AM
[SOLVED] Need to reformat ext3 to ext4 chicagocoyote Linux - General 13 07-16-2012 10:11 AM
[SOLVED] Write permission to every user in ext4 (fstab) the98 Linux - General 10 09-14-2010 09:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration