Title: Another Ubuntu Question Post by: HardcoreSuperstar on October 10, 2015, 02:22:19 PM Hi!
It's me again :D Let me explain what is my new question for you Linux experts. I installed Ubuntu 15.04 on an external hard disk, using the free tool called "LiLi" . Then I booted my Linux distro changing the BIOS settings. The main problem with these kinds of installation is persistence. As a standard, FAT32 allows a maximum persistence of 4GB, but it could be easily changed launching the "gparted" application. And this is exactly what I did: I launched gparted and set HD persistence to 1TB. So this is what I get now: https://i.imgur.com/70fmYee.png?1 Anyway, now I wonder how to install Bitcoin Core ( and any other programs ) on sdb1. How can I do this? Title: Re: Another Ubuntu Question Post by: achow101 on October 10, 2015, 03:29:48 PM When you install, if their is an installation wizard, set the installation directory to a folder in sdb1. If it is just binaries you downloaded, just copy them to a folder on sdb1 and run the program from there. If you are installing with an apt-get command, I don't think it is possible to change the installation directory.
For bitcoin core specifically, just copy all of the binaries to a folder in sdb1 and run the program from there. If you want to also have the data for bitcoin core on sdb1, then use Code: -datadir=<path to datadir> You should also change the PATH environment variable to include the folders where you put the installed programs at so that you can run them from anywhere. Title: Re: Another Ubuntu Question Post by: HardcoreSuperstar on October 10, 2015, 04:18:14 PM When you install, if their is an installation wizard, set the installation directory to a folder in sdb1. If it is just binaries you downloaded, just copy them to a folder on sdb1 and run the program from there. If I try to change the installation directory, I see the following error message: Cannot obtain a lock on data directory /cdrom. Bitcoin Core is probably already running. No such file or directory. For bitcoin core specifically, just copy all of the binaries to a folder in sdb1 and run the program from there. If I try to copy the binaries to a folder in /cdrom I get the following message: The folder “bin” cannot be copied because you do not have permissions to create it in the destination. Title: Re: Another Ubuntu Question Post by: achow101 on October 10, 2015, 04:23:53 PM When you install, if their is an installation wizard, set the installation directory to a folder in sdb1. If it is just binaries you downloaded, just copy them to a folder on sdb1 and run the program from there. If I try to change the installation directory, I see the following error message: Cannot obtain a lock on data directory /cdrom. Bitcoin Core is probably already running. No such file or directory. For bitcoin core specifically, just copy all of the binaries to a folder in sdb1 and run the program from there. If I try to copy the binaries to a folder in /cdrom I get the following message: The folder “bin” cannot be copied because you do not have permissions to create it in the destination. Then check your permissions. Make sure that you have permission to copy things to /cdrom. Make sure that you have permissions to even move the bin folder. Title: Re: Another Ubuntu Question Post by: Bitmix.in on October 10, 2015, 07:39:36 PM Cannot obtain a lock on data directory /cdrom That's most likely to be because of permissions as well. I will extend knightdk answer: In order to change permissons run as root, replacing myuser:mygroup to your installation details: Code: # chown myuser:mygroup /cdrom If you'd like to know what's your user's primary group, normally it will be the same name as your username, but you can check this by running as regular user: Code: ~ id or as root: Code: # id myuser ~ means run as user (do not type it into the command) # means run as root (do not type it, it will result in a comment and not returning any value) The lines below are the result of executing the commands Title: Re: Another Ubuntu Question Post by: HardcoreSuperstar on October 10, 2015, 07:42:24 PM first shut down bitcoin core. Then check your permissions. Make sure that you have permission to copy things to /cdrom. Make sure that you have permissions to even move the bin folder. I don't have permissions to copy things to /cdrom, to move folders or even to create a new folder in /cdrom. I just don't know why... Title: Re: Another Ubuntu Question Post by: HardcoreSuperstar on October 10, 2015, 07:43:47 PM If you'd like to know what's your user's primary group, normally it will be the same name as your username, but you can check this by running as regular user: Code: ~ id or as root: Code: # id myuser I get a syntax error with this code. Title: Re: Another Ubuntu Question Post by: achow101 on October 10, 2015, 07:52:04 PM If you'd like to know what's your user's primary group, normally it will be the same name as your username, but you can check this by running as regular user: Code: ~ id or as root: Code: # id myuser I get a syntax error with this code. Code: id Title: Re: Another Ubuntu Question Post by: Bitmix.in on October 10, 2015, 08:00:20 PM If you'd like to know what's your user's primary group, normally it will be the same name as your username, but you can check this by running as regular user: Code: ~ id or as root: Code: # id myuser I get a syntax error with this code. Sorry. ~ means running as regular user. # means running as root Title: Re: Another Ubuntu Question Post by: HardcoreSuperstar on October 10, 2015, 08:00:43 PM If you'd like to know what's your user's primary group, normally it will be the same name as your username, but you can check this by running as regular user: Code: ~ id or as root: Code: # id myuser I get a syntax error with this code. Code: id I've just tried to change ownership of /cdrom, but I get this: Code: root@ubuntu:/home/ubuntu# chown 999:999 /cdrom Title: Re: Another Ubuntu Question Post by: Bitmix.in on October 10, 2015, 08:03:35 PM Code: root@ubuntu:/home/ubuntu# chown 999:999 /cdrom I forgot about this. It's not a directory, but instead it is a mount point. Please, post your /etc/fstab file contents in here (as root: cat /etc/fstab) and I (or other user) will tell you what to modify in order to set user and group for the mountpoint. In mount point /cdrom you should add the options uid=999,gid=999 (the user and group id returned by the ID command I posted earlier). Then unmount (as root: umount /dev/sdb1) and re-mount (as root: mount /dev/sdb1). Luckily this will work as expected, if I'm not wrong. Title: Re: Another Ubuntu Question Post by: HardcoreSuperstar on October 10, 2015, 08:14:26 PM I forgot about this. It's not a directory, but instead it is a mount point. Please, post your /etc/fstab file contents in here and I (or other user) will tell you what to modify in order to set user and group for the mountpoint. In options you should add uid=999,gid=999 (the user and group id returned by the ID command I posted earlier). Then unmount (as root: umount /dev/sdb1) and remount (as root: mount /dev/sdb1). Luckily this will work as expected, if I'm not wrong. This is etc/fstab content: overlay / overlay rw 0 0 tmpfs /tmp tmpfs nosuid,nodev 0 0 Title: Re: Another Ubuntu Question Post by: Bitmix.in on October 10, 2015, 08:21:21 PM Post result of mount command.
Code: mount Title: Re: Another Ubuntu Question Post by: HardcoreSuperstar on October 10, 2015, 08:23:33 PM Post result of mount command. Code: mount Code: sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime) Title: Re: Another Ubuntu Question Post by: Bitmix.in on October 10, 2015, 08:28:40 PM I'd do this:
Code: umount /dev/sdb1 Then as a regular user run: Code: echo "Testing Permissions" > /cdrom/permissions.txt If it does not complain about permissions, delete the file: rm /cdrom/permissions.txt and then try starting bitcoin-qt. Title: Re: Another Ubuntu Question Post by: HardcoreSuperstar on October 10, 2015, 08:40:54 PM I'd do this: Code: umount /dev/sdb1 This is what I get running these commands: Code: root@ubuntu:/home/ubuntu# umount /dev/sdb1 I also run "System Monitor" application and it shows that no process is using the device. Title: Re: Another Ubuntu Question Post by: achow101 on October 10, 2015, 08:46:02 PM This is what I get running these commands: Make sure that you close everything that could possible have it open (e.g. gparted)Code: root@ubuntu:/home/ubuntu# umount /dev/sdb1 I also run "System Monitor" application and it shows that no process is using the device. Title: Re: Another Ubuntu Question Post by: HardcoreSuperstar on October 10, 2015, 08:52:50 PM Make sure that you close everything that could possible have it open (e.g. gparted) I have only the browser and the terminal opened. Title: Re: Another Ubuntu Question Post by: Bitmix.in on October 10, 2015, 09:03:10 PM Some terminal is in the /cdrom directory?
Post the result of: lsof | grep /cdrom This will get possible processes which are using that directory. Do not run the previous echo command more than once, or it will duplicate the lines written in the fstab. nano /etc/fstab - then remove the lines if duplicated. CTRL+X answer yes, and press enter (will save as fstab the default file). By the way, I'm curious. That is a bootable live Ubuntu image, right? You will have to repeat the echo >> fstab command after each reboot, as it will not save the changes made to the root filesystem (/). Just to add something: this is why I prefer using EXT file systems when working in Linux. I can set permissions and owners to specific files/directories instead of the whole mount point. Title: Re: Another Ubuntu Question Post by: HardcoreSuperstar on October 11, 2015, 07:03:11 AM I'd do this: Code: umount /dev/sdb1 Then as a regular user run: Code: echo "Testing Permissions" > /cdrom/permissions.txt If it does not complain about permissions, delete the file: rm /cdrom/permissions.txt and then try starting bitcoin-qt. I restarted the system and now it works, but I still haven't got permissions in /cdrom mount point. I get this: Code: ubuntu@ubuntu:~$ echo "Testing Permissions" > /cdrom/permissions.txt Title: Re: Another Ubuntu Question Post by: Bitmix.in on October 11, 2015, 07:41:14 AM What is working now?
After rebooting, did you run this again? Code: umount /dev/sdb1 Post result of running as root: Code: mount Title: Re: Another Ubuntu Question Post by: HardcoreSuperstar on October 11, 2015, 08:11:28 AM What is working now? After rebooting, did you run this again? Code: umount /dev/sdb1 Post result of running as root: Code: mount This is what I get: Code:
Title: Re: Another Ubuntu Question Post by: HardcoreSuperstar on October 11, 2015, 08:39:27 AM If I go in /cdrom >>> Properties this is what I get:
https://i.imgur.com/t3uRWwG.jpg?1 I search on google how to change permissions and ownership of a mount point, but the usual answer, to use chown command as a root doesn't work >:( Title: Re: Another Ubuntu Question Post by: HardcoreSuperstar on October 11, 2015, 09:15:55 AM I found this guide: http://www.tuxradar.com/answers/669 (http://www.tuxradar.com/answers/669)
Yet I didn't understand it very well... :-\ Title: Re: Another Ubuntu Question Post by: Bitmix.in on October 11, 2015, 10:35:32 AM The /cdrom mount point is still mount as root.
After the ls -al /cdrom command you can see root being owner of the mountpoint. And after mount, the mount table will show /dev/sdb1 mounted without the specific uid and gid options. Code: /dev/sdb1 on /cdrom type vfat (rw,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro) Code: /dev/sdb1 on /cdrom type vfat (rw,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro,uid=999,gid=999) Run as root: Code: mount -o remount,rw,uid=999,gid=999 /dev/sdb1 /cdrom Post the result of command (run as a regular user): id When I wrote <myuser>, I meant replacing <myuser> with your username, without <>. I could even help you in a more direct and interactive manner, if you wish, through some remote support application like Teamviewer. PM me in order to start a remote support session. I search on google how to change permissions and ownership of a mount point, but the usual answer, to use chown command as a root doesn't work >:( If I'm correct, FAT32 mount points does not support changing permissions to specific files/directories, but instead, rwx (read,write,execute) permissions, and user/group owner needs to be set up at the moment of mounting the file system, through the mount options: (owners) uid, gid; (permissions) umask, fmask and dmask. On the other hand, an EXT4 file system will allow you chowing/chmoding specific files/directories or the whole mount point directly. In EXT4, there is not an option to set up uid and gid options, as this is more specific to other file systems, such as FAT32 and NTFS if I'm not confused. Title: Re: Another Ubuntu Question Post by: achow101 on October 11, 2015, 02:47:48 PM Are you sure it isn't just that the /cdrom mount point is only for root? How about changing the mount point to somewhere you know that you have access? Try making a folder in your home directory and mount the partition there.
Title: Re: Another Ubuntu Question Post by: HardcoreSuperstar on October 11, 2015, 08:12:05 PM Post the result of command (run as a regular user): id This is what I get: Code: uid=999(ubuntu) gid=999(ubuntu) groups=999(ubuntu),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),115(lpadmin),131(sambashare) Title: Re: Another Ubuntu Question Post by: Bitmix.in on October 11, 2015, 09:33:34 PM Did you try:
Code: mount -o remount,rw,uid=999,gid=999 /dev/sdb1 /cdrom If that command is successful, post ls -al command result and try to create a file in /cdrom as a regular user: echo testing > /cdrom/permissions-test.txt Title: Re: Another Ubuntu Question Post by: tspacepilot on October 13, 2015, 07:54:53 AM Did you try: Code: mount -o remount,rw,uid=999,gid=999 /dev/sdb1 /cdrom If that command is successful, post ls -al command result and try to create a file in /cdrom as a regular user: echo testing > /cdrom/permissions-test.txt Could also do chmod and chown on the relevant files in /cdrom once it's mounted rw, it looks like there's a potential permissions issue here too unless his user is in a group that allows media access. Also, this isn't important, but it's a little ugly to be mounting /cdrom as rw, doesn't that substring 'rom' stand out a little too loudly? I tend to mount these things in /media/usb or just /mnt, myself. :) Title: Re: Another Ubuntu Question Post by: Bitmix.in on October 13, 2015, 03:27:35 PM Could also do chmod and chown on the relevant files in /cdrom once it's mounted rw, it looks like there's a potential permissions issue here too unless his user is in a group that allows media access. Also, this isn't important, but it's a little ugly to be mounting /cdrom as rw, doesn't that substring 'rom' stand out a little too loudly? I tend to mount these things in /media/usb or just /mnt, myself. :) I agree. /cdrom is not a good mount point. About chmod/chown, I think that it's not possible to edit permissions because it's a FAT32 filesystem which does not allow specific file/directory permissions, but it will need to be mount with a specific UID and GID as owner for the filesystem. An EXT4 filesystem will allow this. This step has been already tried previously. I'm waiting for the author of the thread to tell the result, but I did not have an answer since Friday. Title: Re: Another Ubuntu Question Post by: tspacepilot on October 13, 2015, 07:30:42 PM Could also do chmod and chown on the relevant files in /cdrom once it's mounted rw, it looks like there's a potential permissions issue here too unless his user is in a group that allows media access. Also, this isn't important, but it's a little ugly to be mounting /cdrom as rw, doesn't that substring 'rom' stand out a little too loudly? I tend to mount these things in /media/usb or just /mnt, myself. :) I agree. /cdrom is not a good mount point. About chmod/chown, I think that it's not possible to edit permissions because it's a FAT32 filesystem which does not allow specific file/directory permissions, but it will need to be mount with a specific UID and GID as owner for the filesystem. An EXT4 filesystem will allow this. This step has been already tried previously. I'm waiting for the author of the thread to tell the result, but I did not have an answer since Friday. Right, good point about the filesystem. Also FAT32 isn't going to allow for files larger than 4GB. That shouldn't be a problem for blockchain files, but it's worth keeping in mind. Title: Re: Another Ubuntu Question Post by: HardcoreSuperstar on October 14, 2015, 07:47:28 AM Did you try: Code: mount -o remount,rw,uid=999,gid=999 /dev/sdb1 /cdrom If that command is successful, post ls -al command result and try to create a file in /cdrom as a regular user: echo testing > /cdrom/permissions-test.txt No, this command is unsuccessful. I have to add I recently switched from Ubuntu to Linux Mint 17.2. Anyway I still haven't solved this issue. Title: Re: Another Ubuntu Question Post by: tspacepilot on October 14, 2015, 04:51:17 PM Did you try: Code: mount -o remount,rw,uid=999,gid=999 /dev/sdb1 /cdrom If that command is successful, post ls -al command result and try to create a file in /cdrom as a regular user: echo testing > /cdrom/permissions-test.txt No, this command is unsuccessful. I have to add I recently switched from Ubuntu to Linux Mint 17.2. Anyway I still haven't solved this issue. I haven't used Linux Mint, but I understand that it's still downstream of debian. In any case, certainly things like mounting drives and reading/writing from them is going to be the same. On topic, you said the command was unsuccessful, can you cut-n-paste the exact response from the shell? Title: Re: Another Ubuntu Question Post by: HardcoreSuperstar on October 14, 2015, 05:28:04 PM Did you try: Code: mount -o remount,rw,uid=999,gid=999 /dev/sdb1 /cdrom If that command is successful, post ls -al command result and try to create a file in /cdrom as a regular user: echo testing > /cdrom/permissions-test.txt No, this command is unsuccessful. I have to add I recently switched from Ubuntu to Linux Mint 17.2. Anyway I still haven't solved this issue. I haven't used Linux Mint, but I understand that it's still downstream of debian. In any case, certainly things like mounting drives and reading/writing from them is going to be the same. On topic, you said the command was unsuccessful, can you cut-n-paste the exact response from the shell? I get nothing at all. Code: mint@mint ~ $ sudo su Title: Re: Another Ubuntu Question Post by: tspacepilot on October 14, 2015, 05:43:45 PM Did you try: Code: mount -o remount,rw,uid=999,gid=999 /dev/sdb1 /cdrom If that command is successful, post ls -al command result and try to create a file in /cdrom as a regular user: echo testing > /cdrom/permissions-test.txt No, this command is unsuccessful. I have to add I recently switched from Ubuntu to Linux Mint 17.2. Anyway I still haven't solved this issue. I haven't used Linux Mint, but I understand that it's still downstream of debian. In any case, certainly things like mounting drives and reading/writing from them is going to be the same. On topic, you said the command was unsuccessful, can you cut-n-paste the exact response from the shell? I get nothing at all. Code: mint@mint ~ $ sudo su That actually means success :) You should be about to rerun "mount" without any arguments to see that /dev/sdb1 is mounted on /cdrom rw. Cheers! EDIT: for your own education, in general UNIX command return 0 upon success. The return code from the last command is stored in your shell as $?. If you say "echo $?" you can see the return code of the previous command. Title: Re: Another Ubuntu Question Post by: HardcoreSuperstar on October 14, 2015, 07:55:04 PM Did you try: Code: mount -o remount,rw,uid=999,gid=999 /dev/sdb1 /cdrom If that command is successful, post ls -al command result and try to create a file in /cdrom as a regular user: echo testing > /cdrom/permissions-test.txt No, this command is unsuccessful. I have to add I recently switched from Ubuntu to Linux Mint 17.2. Anyway I still haven't solved this issue. I haven't used Linux Mint, but I understand that it's still downstream of debian. In any case, certainly things like mounting drives and reading/writing from them is going to be the same. On topic, you said the command was unsuccessful, can you cut-n-paste the exact response from the shell? I get nothing at all. Code: mint@mint ~ $ sudo su That actually means success :) You should be about to rerun "mount" without any arguments to see that /dev/sdb1 is mounted on /cdrom rw. Cheers! EDIT: for your own education, in general UNIX command return 0 upon success. The return code from the last command is stored in your shell as $?. If you say "echo $?" you can see the return code of the previous command. Yes, /dev/sdb1 is mounted on /cdrom. Now how can we proceed in order to change ownership? Title: Re: Another Ubuntu Question Post by: tspacepilot on October 14, 2015, 11:17:44 PM Yes, /dev/sdb1 is mounted on /cdrom. Now how can we proceed in order to change ownership? Above, Bitmix.in says that FAT32 doesn't support per file/directory group and ownership. The idea of that mount command was to mount with uid 999 as owner and group. I assumed this was because the account you want to use is uid 999. Have you tried writing a file to it? Code: $ touch /cdrom/t Title: Re: Another Ubuntu Question Post by: HardcoreSuperstar on October 15, 2015, 08:15:21 AM Code: $ touch /cdrom/t I get this: Code: touch: cannot touch ‘/cdrom/t’: Permission denied Title: Re: Another Ubuntu Question Post by: Bitmix.in on October 15, 2015, 08:31:11 AM I get this: Code: touch: cannot touch ‘/cdrom/t’: Permission denied You have changed to Linux Mint. As root: Code: id mint Get the uid=? and gid=? values from the previous command and replace it in the next command. As root, post the results here: Code: mount I guess you have rebooted the machine and the external hard disk was not remount correctly before running touch, or maybe, your UID is not 999 now, getting forbidden permissions error. The more things you post details about, the better for me and other users to solve your problem. Title: Re: Another Ubuntu Question Post by: HardcoreSuperstar on October 15, 2015, 09:15:19 AM I get this: Code: touch: cannot touch ‘/cdrom/t’: Permission denied You have changed to Linux Mint. As root: Code: id mint Get the uid=? and gid=? values from the previous command and replace it in the next command. As root, post the results here: Code: mount I guess you have rebooted the machine and the external hard disk was not remount correctly before running touch, or maybe, your UID is not 999 now, getting forbidden permissions error. The more things you post details about, the better for me and other users to solve your problem. Uid and gid values are the same as before: 999. Anyway I think I'm gonna switch back to windows. Linux is just too complicated for me! Yet I would like to thank you very much, bitmix.in. You have been very kind trying to help me. If you write down your address I will send you a tip, anyway :) Title: Re: Another Ubuntu Question Post by: Bitmix.in on October 15, 2015, 10:20:29 AM Anyway I think I'm gonna switch back to windows. Linux is just too complicated for me! I understand you. I'm sure this problem is not too difficult to solve. In an interactive session where I could run commands, it would have been faster. If you have enough time, I would suggest taking some Linux course on your own. Yet I would like to thank you very much, bitmix.in. You have been very kind trying to help me. If you write down your address I will send you a tip, anyway :) I'm sending you a PM in 2~5 minutes. Title: Re: Another Ubuntu Question Post by: HardcoreSuperstar on October 15, 2015, 10:29:05 AM Anyway I think I'm gonna switch back to windows. Linux is just too complicated for me! I understand you. I'm sure this problem is not too difficult to solve. In an interactive session where I could run commands, it would have been faster. If you have enough time, I would suggest taking some Linux course on your own. I think I am going to install some LInux distro on hard disk, when I will buy a second computer. Maybe installing it on an external USB device requires too many steps to work in a proper way... Title: Re: Another Ubuntu Question Post by: Bitmix.in on October 15, 2015, 11:38:21 AM I think I am going to install some LInux distro on hard disk, when I will buy a second computer. That's a good choice. Title: Re: Another Ubuntu Question Post by: tspacepilot on October 15, 2015, 06:14:49 PM Anyway I think I'm gonna switch back to windows. Linux is just too complicated for me! Sad to hear it. FWIW, I find windows impossible to use. I guess it's what you're used to. As you know Linux is a clone of UNIX, which was envisioned as a multi-user time-sharing operating system from the start (way back in the late 70s). Windows only got multisuer functionality in like windows 95, I think. Anyway, if you have multiple users you need a good system of permissions and ownership. It seems to me that your difficulties are in part from the fact that you're trying to use a FAT32 partition. Why not use ext files system? Anyway, good luck to you. If you want to keep debugging there are plenty of people here who are willing to try to help. Best, TSP |