You are not logged in.
Been trying to mount my external HD but it's not playing ball. Firstly, I can't work out what my setup is naming it in /dev, partly because I'm getting inconsistent readings of available space on my internal HD.
If I run
df
when the external HD isn't plugged in, I get the following output:
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 7662396 2662828 4615216 37% /
/dev 1024816 0 1024816 0% /dev
run 1027740 204 1027536 1% /run
/dev/sda3 7662396 2662828 4615216 37% /
shm 1027740 0 1027740 0% /dev/shm
tmpfs 1027740 8 1027732 1% /tmp
/dev/sda1 99590 17903 76468 19% /boot
/dev/sda4 152576072 2634200 142302968 2% /home
I figured that if I plug it in and run the command again, something new should pop up and I can thus figure out what's where. However, the above reading doesn't even make sense.
Firstly, there's sda1, 2 & 3. I only have two partitions on my hard drive (one for /, one for /home). I also have a swap. Yet reading the available spaces, there's four different places (going on size); 1027740, 99590, 152576072 & 7662396.
My internal hard drive is only about 160 gig.
If I open thunar and view the properties for /, I get the following:
Size: 106764 items, totalling 128.0 TB
Free Space: 4.4 GB
From memory, the partition allocation for / was 10 gig, so the free space reading is presumably correct, but the 128 TB reading is bizarre. My external hard drive is 1TB, so it can't be that it's adding together / & the ex. HDD to get that estimate (if it is, it's worse at maths than I am); plus it gives the same estimate regardless of whether or not the ex. HDD is attached to my PC.
If I run:
lsusb
with my external HDD attached, it registers just fine (OK, it gets the size wrong, but it's better than nothing)
Bus 001 Device 004: ID 1058:1021 Western Digital Technologies, Inc. Elements 2TB
Anyone got any ideas about what's going wrong and how I can amend things?
(this is the first time I've had a Arch setup -previously ran Crunchbang- so I acknowledge that I may just have missed something I should have installed/configured)
Insights much appreciated :-)
'All we ever were, just zeroes and ones'
Offline
Try dmesg which prints out a long list of messages, but better yet do fdisk -l, it will list immediately your disks that are available.
I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.
Offline
Try dmesg which prints out a long list of messages, but better yet do fdisk -l, it will list immediately your disks that are available.
dmesg gave out more information than Terminator would display in one go, so I only got the last however-many-lines of the output (which was still a hell of a lot, and I have no idea what to look for -I can copy-pasta it to here if that would be helpful?).
fdisk -l didn't return anything at all.
'All we ever were, just zeroes and ones'
Offline
fdisk -l needs root permissions.
Also, run df -h to get human-readable numbers. It only displays mounted partitions.
In dmesg output you will be looking for something like
7650.572586] usb 1-1: new high-speed USB device number 2 using ehci_hcd
[ 7650.734792] usbcore: registered new interface driver uas
[ 7650.741631] Initializing USB Mass Storage driver...
[ 7650.741769] scsi8 : usb-storage 1-1:1.0
[ 7650.741864] usbcore: registered new interface driver usb-storage
[ 7650.741866] USB Mass Storage support registered.
[ 7651.743075] scsi 8:0:0:0: Direct-Access CHIPSBNK v3.3.9.8 5.00 PQ: 0 ANSI: 2
[ 7651.743963] sd 8:0:0:0: [sdd] 4096000 512-byte logical blocks: (2.09 GB/1.95 GiB)
[ 7651.744428] sd 8:0:0:0: [sdd] Write Protect is off
[ 7651.744432] sd 8:0:0:0: [sdd] Mode Sense: 0b 00 00 08
[ 7651.744937] sd 8:0:0:0: [sdd] No Caching mode page present
[ 7651.744941] sd 8:0:0:0: [sdd] Assuming drive cache: write through
[ 7651.747435] sd 8:0:0:0: [sdd] No Caching mode page present
[ 7651.747439] sd 8:0:0:0: [sdd] Assuming drive cache: write through
[ 7651.748064] sdd: sdd1
[ 7651.751050] sd 8:0:0:0: [sdd] No Caching mode page present
[ 7651.751053] sd 8:0:0:0: [sdd] Assuming drive cache: write through
[ 7651.751056] sd 8:0:0:0: [sdd] Attached SCSI removable disk
That's after plugging in a usb thumb drive. You can pipe dmesg to less, but it's generally going to be the last string of entries in the output.
Last edited by alphaniner (2012-03-27 21:04:44)
But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline
fdisk -l needs root permissions.
Also, run df -h to get human-readable numbers. It only displays mounted partitions.
Oh OKies; thanks for the replies btw.
fdisk -l yields the following:
Disk /dev/sda: 164.7 GB, 164696555520 bytes
255 heads, 63 sectors/track, 20023 cylinders, total 321672960 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00014fa2
Device Boot Start End Blocks Id System
/dev/sda1 * 63 208844 104391 83 Linux
/dev/sda2 208845 738989 265072+ 82 Linux swap / Solaris
/dev/sda3 738990 16113194 7687102+ 83 Linux
/dev/sda4 16113195 321669494 152778150 83 Linux
Disk /dev/sdb: 1000.2 GB, 1000202043392 bytes
255 heads, 63 sectors/track, 121600 cylinders, total 1953519616 sectors
Units = sectors of 1 * 512 = 512 bytes
(N.B. External HDD is attached to the PC)
df -h gives:
Filesystem Size Used Avail Use% Mounted on
rootfs 7.4G 2.6G 4.5G 37% /
/dev 1001M 0 1001M 0% /dev
run 1004M 216K 1004M 1% /run
/dev/sda3 7.4G 2.6G 4.5G 37% /
shm 1004M 0 1004M 0% /dev/shm
tmpfs 1004M 84K 1004M 1% /tmp
/dev/sda1 98M 18M 75M 19% /boot
/dev/sda4 146G 2.5G 136G 2% /home
'All we ever were, just zeroes and ones'
Offline
/dev/sdb is the external drive (1000.2 GB) and it appears to have no partitions. Like I said df won't show anything about it because it can only deal with mounted partitions.
Last edited by alphaniner (2012-03-27 21:08:07)
But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline
/dev/sdb is the external drive (1000.2 GB) and it appears to have no partitions. Like I said df won't show anything about it because it can only deal with mounted partitions.
OK, I have progress! ^ ^
I've been following this article to get it to mount:
http://www.jarrodgoddard.com/linux-web- … e-in-linux
It's successfully mounted to the specified folder (I called it /mnt/elements). Only problem is that only root can access it. I haven't done the automount bit yet because I assume if I simply followed those instructions it'd just automount it for root access only. Anyway to make it available (read/write) to my non-root account; and make it automount when I start my (non-root) session?
I have thunar as my file manager, and have volume management disabled (mostly because it didn't seem to work). If I could get it to play nice, that would be awesome.
'All we ever were, just zeroes and ones'
Offline
I'm assuming you created a partition using fdisk or something similar as alphaniner hinted. If you created an ext* partition, you can set the permissions with chmod/chown like any other folder. If you created an ntfs partition, look here. For automounting, look at Fstab, or if you prefer, Autofs.
“Knowledge comes by eyes always open and working hands; and there is no knowledge that is not power.”
~ Ralph Waldo Emerson
Offline
I don't use any volume management or automounting (fstab notwithstanding) so I can't help you with that. If you created a Linux fs, you just chown it as bluTaz pointed out: mount the partition then chown the mount point. If you have already copied stuff it gets a bit complicated. You could chown -R but that would catch the lost+found folder, which should remain in root's ownership.
But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline
You could chown -R but that would catch the lost+found folder, which should remain in root's ownership.
this should work, never had any problems with it
chown -R username /mountpoint
chown -R username /mountpoint/lost+found/
if you want to be extra careful, this shouldn't touch that directory at all
find /mountpoint -not -iwholename /mountpoint/lost+found* -exec chown username '{}' \;
Running arch is like raising a puppy - if you spend a bit of time with it each day and do just a bit of training you'll end up with the most loyal partner you could want; if you lock it in a room and don't check on if for several days, it'll tear apart your stuff and poop everywhere.
Offline
I just intended to make the OP aware of the situation. There are numerous ways to address it, no doubt. I'm curious though, do you not take group ownership? I would do
chown <username>:<primary_group> ...
or
chown <username>\: ...
The latter is a shortcut I inadvertently came across (tab completion) back in my Ubuntu days. I can't find it documented anywhere but it seems to work... Caveat emptor.
Last edited by alphaniner (2012-03-28 18:30:30)
But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline
alphaniner wrote:/dev/sdb is the external drive (1000.2 GB) and it appears to have no partitions. Like I said df won't show anything about it because it can only deal with mounted partitions.
OK, I have progress! ^ ^
I've been following this article to get it to mount:
http://www.jarrodgoddard.com/linux-web- … e-in-linuxIt's successfully mounted to the specified folder (I called it /mnt/elements). Only problem is that only root can access it. I haven't done the automount bit yet because I assume if I simply followed those instructions it'd just automount it for root access only. Anyway to make it available (read/write) to my non-root account; and make it automount when I start my (non-root) session?
I have thunar as my file manager, and have volume management disabled (mostly because it didn't seem to work). If I could get it to play nice, that would be awesome.
I suggest this:
blkid -o list
use umask option for permissions.
mount it like this:
mount -o umask=111 /dev/sdb1 /mnt/elements
and if you want to edit fstab for future mounts, add this line to /etc/fstab:
/dev/sdb1 /mnt/elements [FileSystemType] auto,defaults,user,relatime,nofail,umask=111
change [FileSystemType] with what the blkid says.
also to be on the safe side you can replace the /dev/sdb1 to UUID. which also the blkid says.
UUID=somerandomthings /mnt/elements [FileSystemType] auto,defaults,user,relatime,nofail,umask=111
complete noob here. these are what I picked up from the wiki articles. sorry if I'm wrong.
Regards
Last edited by Masoud.N (2012-03-29 09:44:50)
Offline
The umask option is not valid for any 'linux native' fs. Only [v]fat, ntfs, and a few more exotic ones.
But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline
I just intended to make the OP aware of the situation. There are numerous ways to address it, no doubt. I'm curious though, do you not take group ownership? I would do
chown <username>:<primary_group> ...
or
chown <username>\: ...
The latter is a shortcut I inadvertently came across (tab completion) back in my Ubuntu days. I can't find it documented anywhere but it seems to work... Caveat emptor.
Sorry, didn't mean to nitpick Just addressing a problem you brought to attention. Yes, group ownership should be changed as well, and as with everything, there are several ways to safely do it
Running arch is like raising a puppy - if you spend a bit of time with it each day and do just a bit of training you'll end up with the most loyal partner you could want; if you lock it in a room and don't check on if for several days, it'll tear apart your stuff and poop everywhere.
Offline
[Ignore]
Last edited by Throne777 (2012-03-31 12:18:25)
'All we ever were, just zeroes and ones'
Offline
alphaniner wrote:You could chown -R but that would catch the lost+found folder, which should remain in root's ownership.
this should work, never had any problems with it
chown -R username /mountpoint chown -R username /mountpoint/lost+found/
if you want to be extra careful, this shouldn't touch that directory at all
find /mountpoint -not -iwholename /mountpoint/lost+found* -exec chown username '{}' \;
Tried doing 'chown' and it's sort of worked. By sort of I mean that I have access to all folders, but all the files remain roots (and won't let me use them). When I try changing the access permissions for the files it says the operation isn't supported :s
Thanks again for all the replies :-)
EDIT:
Incidentally, I've followed all the things of note on auto-mounting in the thunar article (https://wiki.archlinux.org/index.php/Thunar) and thunar still doesn't auto-mount (or have Trash as a shortcut).
Only noticable difference is that i have dbus running as a daemon in /etc/rc.conf, so haven't included it in the ~/.xinit.rc; is it worth taking dbus out of /etc/rc.conf and putting it in ~/.xinit.rc instead?
Last edited by Throne777 (2012-03-31 12:40:59)
'All we ever were, just zeroes and ones'
Offline
@Throne: you can mount it like this;
sudo mount -o rw,uid=your-uid,gid=your-gid /dev/whatever /mnt/elements
or better, you could install pmount. it lets you mount external drives without being root.
pmount /dev/whatever
Although in both cases, you'll have to unmount it as root.
Last edited by debdj (2012-03-31 13:05:19)
Offline
@Throne: you can mount it like this;
sudo mount -o rw,uid=your-uid,gid=your-gid /dev/whatever /mnt/elements
or better, you could install pmount. it lets you mount external drives without being root.
pmount /dev/whatever
Although in both cases, you'll have to unmount it as root.
Ohhh, pmount worked a treat ^ ^
Any way to get it mount it automatically when I log in?
'All we ever were, just zeroes and ones'
Offline
Ohhh, pmount worked a treat ^ ^
Any way to get it mount it automatically when I log in?
mm..I guess you can put it in your ~/.xinitrc file
but put the line before the DE/WM invocation line.
so, if you use say, use lxde and have a line like
exec ck-launch-session dbus-launch startlxde
in your .xinitrc,
put the 'pmount device' line before that.
Edit. if u want to put it in ~/.bashrc, you'll have to start a bash terminal at least once after you log in to get it mounted.
Last edited by debdj (2012-03-31 13:32:49)
Offline
Ohhh, pmount worked a treat ^ ^
Any way to get it mount it automatically when I log in?mm..I guess you can put it in your ~/.xinitrc file
but put the line before the DE/WM invocation line.so, if you use say, use lxde and have a line like
exec ck-launch-session dbus-launch startlxde
in your .xinitrc,
put the 'pmount device' line before that.Edit. if u want to put it in ~/.bashrc, you'll have to start a bash terminal at least once after you log in to get it mounted.
Hmm, pmount isn't working as well as I thought.
It won't let me transfer files from my hard drive to the external; says it isn't permitted. If I open thunar as root and try to change the groups read/write permissions it says the operation isn't supported (though I myself have read/write access apparently :s).
Edit: Typo
Last edited by Throne777 (2012-03-31 15:33:05)
'All we ever were, just zeroes and ones'
Offline
I just created an fstab entry to mount a newly created external drive partition within my users $HOME.
First, I created a directory for the mount point:
$ pwd
/home/casey
$ mkdir newdir
$ ls -ld newdir
drwxr-xr-x 2 casey users 4096 Mar 31 11:45 newdir/
Then I added a line to fstab:
UUID=c0243e5b-9010-4477-b46d-c9bc3cee39b7 /home/casey/newdir ext4 defaults,nofail,users,noatime,noexec 0 2
Two mount options are important. 'nofail' allows me to boot when the external drive isn't connected. 'users' allows my user, casey, to umount the disk and that proper permissions are used. I then rebooted twice to check that everything works correctly with or without the device connected.
$ ls -ld newdir
drwxr-xr-x 3 casey users 4096 Mar 31 11:25 newdir
$ touch newdir/tmp_file
$ ls -l newdir/
total 16
drwx------ 2 root root 16384 Mar 31 11:05 lost+found
-rw-r--r-- 1 casey users 0 Mar 31 11:25 tmp_file
Last edited by thisoldman (2012-03-31 16:21:08)
Offline
I just created an fstab entry to mount a newly created external drive partition within my users $HOME.
First, I created a directory for the mount point:
$ pwd /home/casey $ md newdir $ ls -ld newdir drwxr-xr-x 2 casey users 4096 Mar 31 11:45 newdir/
Then I added a line to fstab:
UUID=c0243e5b-9010-4477-b46d-c9bc3cee39b7 /home/casey/newdir ext4 defaults,nofail,users,noatime,noexec 0 2
Two mount options are important. 'nofail' allows me to boot when the external drive isn't connected. 'users' allows my user, casey, to umount the disk and that proper permissions are used. I then rebooted twice to check that everything works correctly with or without the device connected.
$ ls -ld newdir drwxr-xr-x 3 casey users 4096 Mar 31 11:25 newdir $ touch newdir/tmp_file $ ls -l newdir/ total 16 drwx------ 2 root root 16384 Mar 31 11:05 lost+found -rw-r--r-- 1 casey users 0 Mar 31 11:25 tmp_file
OK, I followed about half of that :-s
Is 'md' the same as 'mkdir'?
What does the -ld specify? (i.e. what is the significance of "drwx------ 24 throne777 users 4096" -what I get)
How do I find out the UUID of my external hard drive?
'All we ever were, just zeroes and ones'
Offline
debdj wrote:Ohhh, pmount worked a treat ^ ^
Any way to get it mount it automatically when I log in?mm..I guess you can put it in your ~/.xinitrc file
but put the line before the DE/WM invocation line.so, if you use say, use lxde and have a line like
exec ck-launch-session dbus-launch startlxde
in your .xinitrc,
put the 'pmount device' line before that.Edit. if u want to put it in ~/.bashrc, you'll have to start a bash terminal at least once after you log in to get it mounted.
Hmm, pmount isn't working as well as I thought.
It won't let me transfer files from my hard drive to the external; says it isn't permitted. If I open thunar as root and try to change the groups read/write permissions it says the operation isn't supported (though I myself have read/write access apparently :s).Edit: Typo
pmount is just a wrapper, it calls the standard mount program to actually do the work, without the need to have an entry in fstab. Let's first make sure that you can mount and use the drive with the standard old-fashioned mount. When we get that to work, switching should be just a matter of using correct pmount options or doing some minor tweaks.
From what you linked, I assume you are using ext filesystem, which should make things a lot easier. If you're using something else, you need to let us know.
First things first, lets start from the beginning. Umount the drive and set permissions on the empty directory you're mounting it into back to root (or just remove it and recreate it as root). This is not essential, just doing that so we know the current state of things.
Second, mount the drive with simple mount /dev/sdx /mnt/mountpoint Obviously you need to change the device and mountpoint to whatever's appropriate. This *should* work. Logged in as root, try to create a directory inside, and for example copy something into this new directory, to make 100% sure that the drive is correctly mounted. If you get past this point and everything works, then this all is most likely just a case of botched permissions. You can't write into it as a user yet, but we now know that it can be correctly mounted.
Third, find out your user uid, and your primary group gid. Simply type 'id' into terminal logged in as regular user you want to mount the drive with, if it's the only user you created shortly after system installation, then most likely your uid will be 1000 and gid of users group will be 100. Now umount the drive, and re-mount it with running as root mount -o uid=1000,gid=100 /dev/sdx /mnt/mountpoint Again, change everything as appropriate. You now should be able to write new files and directories onto your drive as your normal user. You still may not be able to edit files already stored in if permissions were set wrong, but that can be changed, as we discussed before.
If this all works, then you can use your drive without any problems, and one line in your fstab will mean that you can mount the drive as user without even needing pmount. Please verify everything works first, if it does we can help you with that as well if you need it. And sorry if I'm being too thorough, just trying to avoid any mistakes
edit: to avoid any confusion, this is more or less a test. When mounting ext partitions you shouldn't have to set things like uid, gid or umask. Those options are primarily meant for filesystems which don't use this kind of permission setting, like vfat or ntfs. But it should move us a little bit further.
Last edited by meph (2012-03-31 16:45:25)
Running arch is like raising a puppy - if you spend a bit of time with it each day and do just a bit of training you'll end up with the most loyal partner you could want; if you lock it in a room and don't check on if for several days, it'll tear apart your stuff and poop everywhere.
Offline
How do I find out the UUID of my external hard drive?
sudo blkid
Running arch is like raising a puppy - if you spend a bit of time with it each day and do just a bit of training you'll end up with the most loyal partner you could want; if you lock it in a room and don't check on if for several days, it'll tear apart your stuff and poop everywhere.
Offline
meph is correct to take this back to basics. And he's faster at replies than I am.
OK, I followed about half of that :-s
Is 'md' the same as 'mkdir'?
What does the -ld specify? (i.e. what is the significance of "drwx------ 24 throne777 users 4096" -what I get)
How do I find out the UUID of my external hard drive?
Sorry about the 'md'. It's an alias for 'mkdir', I've corrected my error above. I have some aliases set up because I occasionally slip into DOS.
'ls -ld' is the same as 'ls -l -d'. I use the options to control the output of 'ls'. Enter 'ls --help' to see what these and other options do. A tutorial with examples is at http://www.thegeekstuff.com/2009/07/lin … /#more-550
One of the many ways to find a partition's UUID is the command 'blkid'. Works fine here without 'sudo'.
Last edited by thisoldman (2012-03-31 17:11:11)
Offline