LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   I Installed an external Hard drive using Gparted. I cannot move files to the external (https://www.linuxquestions.org/questions/linux-newbie-8/i-installed-an-external-hard-drive-using-gparted-i-cannot-move-files-to-the-external-4175539453/)

Liz99 04-12-2015 01:51 AM

I Installed an external Hard drive using Gparted. I cannot move files to the external
 
Hello.

I have checked the other threads and either I have missed my answer or did not understand that it was the answer. I apologise in advance if I am being a repeater:

The Problem: I am running 17 mint. I installed a toshiba external Hard Drive using Gparted- Fast and easy, BUT, somehow I installed the external as root, I cannot move files to the external because I am not root? Under permissions it states that the Owner Cannot Be Determined.
Any help would be great.

Have a great night, morning or afternoon!

syg00 04-12-2015 02:26 AM

From a terminal run the following display commands and post all the output
Code:

df -hT
sudo lsblk -f


fatmac 04-12-2015 08:13 AM

You could change the ownership of the external drive to your user, see man chown.

yancek 04-12-2015 08:57 AM

As a general rule in Linux, anything outside the /home/user directory will be owned by root so as indicated above, you need to either give your user(s) permissions to access the formatted filesystem on the partition(s) on the drive or change ownership to a different user. The other option is to obviously access as root and with Mint that would mean using 'sudo'.

joe_2000 04-12-2015 03:09 PM

To what filesystem did you format?

Some filesystems (e.g. fat32) do not fully support the Linux file permission system. You may have to mount them with additional flags to make them appear as owned by your user. Assuming your user has the default single-user user id of 1000, and your drive appears under sdb1 you can mount it to /media/my_drive with the following command:
Code:

mount -o uid=1000 /dev/sdb1 /media/my_drive
Note the mountpoint has to exist.

Liz99 04-19-2015 09:14 PM

External Drive Output
 
I apologize for not getting back to you. I appreciate your help- believe me- and did not mean to leave you hanging.

First the terminal output for command:df -hT
sudo lsblk -f

ls@ls-MXC061 ~ $ df -hT
Filesystem Type Size Used Avail Use Mounted on
/dev/sda1 ext4 90G 30G 55G 36 /
none tmpfs 4.0K 0 4.0K 0% /sys/fs/cgroup
udev devtmpfs 483M 12K 483M 1% /dev
tmpfs tmpfs 100M 1.3M 99M 2% /run
none tmpfs 5.0M 0 5.0M 0% /run/lock
none tmpfs 497M 76K 497M 1% /run/shm
none tmpfs 100M 40K 100M 1% /run/user
/dev/sdb1 ext4 459G 70M 435G 1% /media/ls/toshiba
ls@ls-MXC061 ~ $ sudo lsblk -f

Filesystem Type Size Used Avail Use% Mounted on
/dev/sda1 ext4 90G 30G 55G 36% /
none tmpfs 4.0K 0 4.0K 0% /sys/fs/cgroup
udev devtmpfs 483M 12K 483M 1% /dev
tmpfs tmpfs 100M 1.3M 99M 2% /run
none tmpfs 5.0M 0 5.0M 0% /run/lock
none tmpfs 497M 76K 497M 1% /run/shm
none tmpfs 100M 40K 100M 1% /run/user
/dev/sdb1 ext4 459G 70M 435G 1% /media/ls/toshiba
ls@ls-MXC061 ~ $ sudo lsblk -f
[sudo] password for ls:
NAME FSTYPE LABEL MOUNTPOINT
sda
sda1 ext4 /
sda2
sda5 swap [SWAP]
sr0
ls@ls-MXC061 ~ $


I read man chown. I was unsure of some of the instructions (sorry) ** Thank you for the link- what a great resource!!**

The file is located: /media/ls/toshiba

The mount point does not exist. When I mount the Toshiba there is a hidden file Lost and Found. I don't have permission to open it.

I tried Gparted.

2 partitions are currently active on device /dev/sda
A new partition table cannot be created when there are active partitions. Active partitions are those that are in use, such as a mounted file system, or enabled swap space.
Use Partition menu options, such as unmount or swapoff, to deactivate all partitions on this device before creating a new partition table. I did unmount the external before using Gparted. Given all the mistakes I have made I was afraid to try swap off or anything else and make it worse.

In gparted it shows:
/dev/sda2 extended
/dev/sda5 linux-swap


That is all the information that I can find at this point.

I hope this helps you to see where I went wrong. Again, sorry for the wait- I really do appreciate your help.

yancek 04-20-2015 08:20 AM

Anything under the /media directory such as "/media/ls/toshiba" would be owned by root so you either need to change the owner of the file(s) or change permissions. If 'toshiba' is a directory, you can ascertain the owner:group with this command:

Code:

ls -ld /media/ls/toshiba
You can change ownership with the following, replace Liz99 with your actual user name:

Code:

sudo chown -R Liz99 /media/ls/Toshiba

Liz99 04-20-2015 11:24 AM

External Drive Output and responses
 
3 Attachment(s)
Thank you all for such fast response!

I followed your instructions and these are the results:

ls@ls-MXC061 ~ $ su
Password:
ls-MXC061 ls # sudo chown -R ls /media/ls/Toshiba
chown: cannot access ‘/media/ls/Toshiba’: No such file or directory
ls-MXC061 ls # ls -ld /media/ls/toshiba
ls: cannot access /media/ls/toshiba: No such file or directory
ls-MXC061 ls #

This what it looks like when I open it in the terminal: ls@ls-MXC061 /media/ls/toshiba $

apt-get, and wget are the only commands I know. I am still reading up on wget. I apologise again for only knowing that I love mint but haven't taken the time to understand it more fully.

I know you are busy and donate your time to help us. I did look up the installation instructions on google. Usually I just enter my error or mistake into search and find past threads marked "resolved" and do the fix without having to ask. This time I couldn't find what I needed or understood, so again I apologise for taking your time.

To the question of where I mounted to: ls@ls-MXC061 ~ $ sudo bash
[sudo] password for ls:
ls-MXC061 ~ # mount -o uid=1000 /dev/sdb1 /media/my_drive
mount: mount point /media/my_drive does not exist
ls-MXC061 ~ #

I have attached screen shots of gparted for you to accurately see what I am trying to explain

Thank you for your help. It is truly appreciated!

robdogj 04-20-2015 12:21 PM

do you see the device when you run fdisk -l to verify where volume is located & what is the acutal filesystem?

suicidaleggroll 04-20-2015 12:23 PM

Please DO NOT mess with sda. All of your screen shots show output for sda, sda is NOT your external drive, it's your system drive. If you mess up sda, your system will not boot. sdb is your external drive.

The output from your commands is very odd. Earlier you showed that sdb1 was mounted at "/media/ls/toshiba":
Code:

$ df -hT
Filesystem Type Size Used Avail Use Mounted on
/dev/sda1 ext4 90G 30G 55G 36 /
none tmpfs 4.0K 0 4.0K 0 /sys/fs/cgroup
udev devtmpfs 483M 12K 483M 1% /dev
tmpfs tmpfs 100M 1.3M 99M 2% /run
none tmpfs 5.0M 0 5.0M 0% /run/lock
none tmpfs 497M 76K 497M 1% /run/shm
none tmpfs 100M 40K 100M 1% /run/user
/dev/sdb1 ext4 459G 70M 435G 1% /media/ls/toshiba

But now your system is saying that "/media/ls/toshiba" does not exist:
Code:

# ls -ld /media/ls/toshiba
ls: cannot access /media/ls/toshiba: No such file or directory

What changed? Is the external drive still plugged in? Is it mounted? If so, where?

Please re-run "df -hT"

Liz99 04-20-2015 01:29 PM

Hi:

fdisk -l shows ls@ls-MXC061 ~ $ fdisk -l
ls@ls-MXC061 ~ $

I unallocated sda5- did I do major damage?

ls@ls-MXC061 ~ $ df -hT
Filesystem Type Size Used Avail Use Mounted on
/dev/sda1 ext4 90G 37G 49G 44% /
none tmpfs 4.0K 0 4.0K 0% /sys/fs/cgroup
udev devtmpfs 483M 12K 483M 1% /dev
tmpfs tmpfs 100M 1.3M 99M 2% /run
none tmpfs 5.0M 0 5.0M 0% /run/lock
none tmpfs 497M 76K 497M 1% /run/shm
none tmpfs 100M 36K 100M 1% /run/user
ls@ls-MXC061 ~ $ sudo lsblk -f
[sudo] password for ls:
NAME FSTYPE LABEL MOUNTPOINT
sda
sda1 ext4 /
sda2
sdb
sdb1 ext4 toshiba
sr0
ls@ls-MXC061 ~ $


The only difference from then to now was unallocating sda5. I did not have the external hooked last night or now. Other than that I left it alone when I saw I changed the sda5. The media not showing a directory is the same as last night, I just didn't think to include it at the time. I am sorry, if I did more, I don't remember it. I knew this was way over my head and I don't like to tinker. The unallocation bit was a button hit twice by accident.

I wish I could tell you more. Thanks so much for helping. If I have messed things up too badly, I made a full back up prior to the installation, just in case, and can do a re-install.

Thanks again-

suicidaleggroll 04-20-2015 01:37 PM

sda5 was your swap partition. You no longer have a swap, which is not a good idea, and since you didn't remove it correctly your system might not boot anymore. I don't have experience with creating a swap partition on a system that is already set up and running (and configured to use a different swap partition), but I'm sure somebody else here has.

fdisk needs to be run as root, that's why there was no output.

Your external drive was clearly connected when you posted the earlier df output, as it shows up in the list, and an "ls" would not have failed with a "No such file or directory" error. It looks like it's attached now as well, since it shows up in your lsblk output, it just isn't mounted. Is the drive really not attached? If that's the case, the lsblk output doesn't make sense, and why are you trying to debug an external drive without it connected anyway?

yancek 04-20-2015 01:44 PM

In post 6 above you showed that sdb1, the partition on your external drive, had a mount point of:

Quote:

/media/ls/toshiba
You can't make any changes to it if it isn't plugged in as suggested above. If you have it plugged in, with the newer Ubuntus such as Mint, it should show under /media/ls (ls being your user name?) and the permissions will be root:root. I don't know why Ubuntu does this but that's the way it works. So plug it in and change owner:group.

Liz99 04-20-2015 03:36 PM

Hi,

I knew I had it plugged in. It is a little confusing for me. Yes, it is plugged in. Why would I not have it plugged in is a good question. I confused unmounted with unplugged. I installed it incorrectly, then I didn't know what to do with it.I should have paid more attention to the right terms- you don't read minds and can only go by what we give you. I also should have printed out what I changed when it went wrong and didn't. I really do apologise. My system boots up just fine. As suggested I will change ownership using root. I didn't realize it was a permission problem. I thought I made my external unable to be used with mint.

Thanks so much- I will change the permissions and report back. You really do help- an amazing amount- and you are appreciated.

yancek 04-20-2015 04:59 PM

In general terms, any time you create a new partition on a Linux system it will only be writeable by root or by using sudo with systems like Mint. You need to change the owner and or permissions to suit your needs. You will generally if not always see a lost+found directory in a newly created partition and it has it's purpose but you can research that later if you want.


All times are GMT -5. The time now is 03:04 PM.