Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Linking your documents folder (and others) in Ubuntu to a Data Partition?

  • 03-01-2012 4:38pm
    #1
    Registered Users, Registered Users 2 Posts: 1,506 ✭✭✭


    Just wondering here if there is a way to do this? I remember trying to do it before but it wasn't as straight forward as changing the location of a folder in windows. At least I never found a proper answer apart from just putting a short cut to the folder in the other partition.

    Essentially what I would like to do is to use my data partition for both windows and Linux without having to manually move everything to the partition. I don't like saving data with the OS.

    Anyone know how this can be done?


«1

Comments

  • Moderators, Arts Moderators Posts: 35,731 Mod ✭✭✭✭pickarooney


    The partition will probably have to be in FAT32 for starters, or possibly NTFS. I'm not sure what you mean with the next bit - where is the data you want to share currently in relation to / and /home ?


  • Registered Users, Registered Users 2 Posts: 1,506 ✭✭✭shizz


    The partition will probably have to be in FAT32 for starters, or possibly NTFS. I'm not sure what you mean with the next bit - where is the data you want to share currently in relation to / and /home ?

    Well before I had an Ubuntu partition I had a partition for Windows OS and a partition to store all my data. I then relocated all my windows folders, i.e. My documents, my videos etc. to this partition. This is done by right clicking the folder and going to the location tab and writing in, for example D:\MyDocuments. Now when ever I save anything to my documents folder in windows it is saved in that partition. Its very handy and keeps all my data away from the OS partition, but the folders are still linked to the OS.
    OSI wrote: »
    You could create the folders on your data partition and use symbolic links to link the folders in your home directory to them.

    ie

    mv /home/username/Documents /mnt/Data/Documents
    ln -s /mnt/Data/Documents /home/username/Documents
    

    Windows 7 actually provides for something similar to sym links now too, so may be worth a look.

    I'm sorry I don't really understand what sym links are?


  • Registered Users, Registered Users 2 Posts: 14,048 ✭✭✭✭Johnboy1951


    Do you have the option to drag and drop the directory to another location, and then choose from options ...... one of which is 'link here'?

    It is what I use .... but don't use ubuntu .. so it may be different


  • Registered Users, Registered Users 2 Posts: 37,485 ✭✭✭✭Khannie


    symlinks or "symbolic links" are probably what you're looking for. In ubuntu lets say you have your NTFS data partition mounted at /home/shizz/data/ and you want to relocate /home/shizz/Documents to /home/shizz/data/Documents what you would do is this:

    Delete the /home/shizz/Documents folder (having backed up anything that's in it that you want to keep)
    create /home/shizz/data/Documents folder
    symlink /home/shizz/data/Documents to /home/shizz/Documents

    That way when you access /home/shizz/Documents, you're really accessing /home/shizz/data/Documents.

    The command you want to create the simlink is:

    ln -s <src> <destination>

    e.g. ln -s /home/shizz/data/Documents /home/shizz/Documents

    Symlinks are one of the things I love about linux. They just add so much flexibility.


  • Registered Users, Registered Users 2 Posts: 1,506 ✭✭✭shizz


    Khannie wrote: »
    symlinks or "symbolic links" are probably what you're looking for. In ubuntu lets say you have your NTFS data partition mounted at /home/shizz/data/ and you want to relocate /home/shizz/Documents to /home/shizz/data/Documents what you would do is this:

    Delete the /home/shizz/Documents folder (having backed up anything that's in it that you want to keep)
    create /home/shizz/data/Documents folder
    symlink /home/shizz/data/Documents to /home/shizz/Documents

    That way when you access /home/shizz/Documents, you're really accessing /home/shizz/data/Documents.

    The command you want to create the simlink is:

    ln -s <src> <destination>

    e.g. ln -s /home/shizz/data/Documents /home/shizz/Documents

    Symlinks are one of the things I love about linux. They just add so much flexibility.

    Nice. Thanks man. This seems like what I am looking for, but the way you have written /home/shizz/data/documents looks like to me that data is a folder within home? Maybe I'm just not familiar with directories in linux.

    Also would I put in the command after I have deleted the original home folder? Does this command now make the folder in the data partition my home folder or does it create a new home folder and just link it to there?

    Just trying to get my head around the code.

    Thanks again.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 37,485 ✭✭✭✭Khannie


    shizz wrote: »
    Nice. Thanks man. This seems like what I am looking for, but the way you have written /home/shizz/data/documents looks like to me that data is a folder within home? Maybe I'm just not familiar with directories in linux.

    Linux treats directories differently to windows. You need a slight mind shift, but only very slight. You mount partitions at a particular directory instead of their own drive. So lets say I have a partition on my hard drive that has all my movies in it and another partition that has all my music, well I would maybe mount them at:

    /home/khannie/music
    and
    /home/khannie/movies

    Then when I go into that directory, I can see the contents of the partition inside that directory. In Linux (or unix in general) you can mount all sorts of things this way. Remote file systems for example, or USB drives. In your case, I was saying you might mount your data partition at /home/shizz/data but actually you can put it wherever you like.

    To mount it you use the mount command, e.g.:

    mount <partition> <mount point>

    an example might be:

    mount /dev/sda1 /home/shizz/data

    (your data partition is listed as a device under /dev and should be /dev/sd<something> like /dev/sda1 or /dev/sdb1 or similar.
    shizz wrote: »
    Also would I put in the command after I have deleted the original home folder?

    In a terminal. This is similar to the command prompt in windows (or the start->run box). In ubuntu it's under applications->accessories->terminal. The more time you spend with linux, the more you'll use the terminal. Again it's a bit of a mindset shift. Try not to be freaked out by the terminal. :)

    edit: for whatever reason I read that as "where would I". Also, you don't delete the home folder. VERY IMPORTANT. Only the Documents subdirectory.
    shizz wrote: »
    Does this command now make the folder in the data partition my home folder or does it create a new home folder and just link it to there?

    It creates a link, which looks and behaves like a folder. If you remove the link though, it does not remove the folder that it links to.

    Hope that helps. Getting ready for your raspberry pi? ;)


  • Registered Users, Registered Users 2 Posts: 1,506 ✭✭✭shizz


    Khannie wrote: »
    Linux treats directories differently to windows. You need a slight mind shift, but only very slight. You mount partitions at a particular directory instead of their own drive. So lets say I have a partition on my hard drive that has all my movies in it and another partition that has all my music, well I would maybe mount them at:

    /home/khannie/music
    and
    /home/khannie/movies

    Then when I go into that directory, I can see the contents of the partition inside that directory. In Linux (or unix in general) you can mount all sorts of things this way. Remote file systems for example, or USB drives. In your case, I was saying you might mount your data partition at /home/shizz/data but actually you can put it wherever you like.

    To mount it you use the mount command, e.g.:

    mount <partition> <mount point>

    an example might be:

    mount /dev/sda1 /home/shizz/data

    (your data partition is listed as a device under /dev and should be /dev/sd<something> like /dev/sda1 or /dev/sdb1 or similar.



    In a terminal. This is similar to the command prompt in windows (or the start->run box). In ubuntu it's under applications->accessories->terminal. The more time you spend with linux, the more you'll use the terminal. Again it's a bit of a mindset shift. Try not to be freaked out by the terminal. :)

    edit: for whatever reason I read that as "where would I". Also, you don't delete the home folder. VERY IMPORTANT. Only the Documents subdirectory.



    It creates a link, which looks and behaves like a folder. If you remove the link though, it does not remove the folder that it links to.

    Hope that helps. Getting ready for your raspberry pi? ;)

    Thanks for putting all the effort into the post really appreciate it. Cleared a lot up.

    Just two more things, If I mount this drive is it still readable by my windows partition? I presume so but just checking.

    Also, the command you gave me to link the folder is just one line where as OSI gave me a command with two lines. Is the first command just to mount the drive? It looks that way to me.

    Thanks again.


  • Registered Users, Registered Users 2 Posts: 37,485 ✭✭✭✭Khannie


    I'm going to teach the man to fish with this one....

    in a terminal, run:

    man mv

    To quit out of it, hit q.

    Man is short for "manual" and really is your friend.


  • Registered Users, Registered Users 2 Posts: 1,506 ✭✭✭shizz


    Khannie wrote: »
    I'm going to teach the man to fish with this one....

    in a terminal, run:

    man mv

    To quit out of it, hit q.

    Man is short for "manual" and really is your friend.
    Thanks man. Ill write back here when I get it working. Might be a while though. thanks again.


  • Registered Users, Registered Users 2 Posts: 1,506 ✭✭✭shizz


    Quick question about mounting. When I log into Ubuntu my Partition is there and available to use. Ive named the Partition "DATA" so It turns up as that. So do I need to mount it? is it not already?

    Also if I was to mount it how do I know which sd it is?


  • Advertisement
  • Moderators, Arts Moderators Posts: 35,731 Mod ✭✭✭✭pickarooney


    I get the feeling everything is being overthought here...

    My understanding is that currently you have (at least) three partitions:
    1. Windows OS partition
    2. Linux OS partition
    3. Data partition common to both

    I'm assuming 3. is in NTFS and that your Ubuntu installation can at least read from the drive, possibly writing to it as well.

    So when you're in Windows 3. is mounted automatically as, say (D:) and when you're in Ubuntu the same drive is mounted as something like /media/windows with the disk label DATA. Assuming you can write to the drive you don't really need to do any of the above, just make sure that when you save any data files in Ubuntu that you save them in a folder on this partition. When using a GUI Save File dialog box the disk should be visible as "DATA" or something like "500GB Drive (/media/windows)".


  • Registered Users, Registered Users 2 Posts: 1,506 ✭✭✭shizz


    I get the feeling everything is being overthought here...

    My understanding is that currently you have (at least) three partitions:
    1. Windows OS partition
    2. Linux OS partition
    3. Data partition common to both

    I'm assuming 3. is in NTFS and that your Ubuntu installation can at least read from the drive, possibly writing to it as well.

    So when you're in Windows 3. is mounted automatically as, say (D:) and when you're in Ubuntu the same drive is mounted as something like /media/windows with the disk label DATA. Assuming you can write to the drive you don't really need to do any of the above, just make sure that when you save any data files in Ubuntu that you save them in a folder on this partition. When using a GUI Save File dialog box the disk should be visible as "DATA" or something like "500GB Drive (/media/windows)".

    Yeah this is exactly the situation and what I have been doing, but ideally I would like to link the home folders to this data partition so that if anything is automatically saved to there it goes to the Data without me having to maually do it. For example downloads.


  • Moderators, Arts Moderators Posts: 35,731 Mod ✭✭✭✭pickarooney


    Just set the default Downloads folder of your browser to be a folder on the data partition? Same with Openoffice and any other program you regularly save files from.
    You're not really 'locked in' to a My Documents folder the way you are in Windows by default.


  • Registered Users, Registered Users 2 Posts: 1,506 ✭✭✭shizz


    Just set the default Downloads folder of your browser to be a folder on the data partition? Same with Openoffice and any other program you regularly save files from.
    You're not really 'locked in' to a My Documents folder the way you are in Windows by default.

    Yes but then I have directories that come as standard set out for your documents, music, video etc. What I would like is for those to link straight to the corresponding folders in my data partition that has all my music, videos etc

    I don't think I was locked to anything in Windows though? It was far easier to accomplish this in windows.

    Anyway Im sure sym links is what Im looking for.


  • Registered Users, Registered Users 2 Posts: 14,048 ✭✭✭✭Johnboy1951


    I don't see the difficulty ....

    using a file manager (preferably Split View, or if not available then two instances) you can drag any Folder from /home to another partition and select 'move' here.

    when that is finished you can drag and drop the folder back to /home and select to 'link' here. Job done! ... as I understand your requirement.


  • Moderators, Arts Moderators Posts: 35,731 Mod ✭✭✭✭pickarooney


    shizz wrote: »
    Yes but then I have directories that come as standard set out for your documents, music, video etc.

    I don't really understand what you mean here or what program you're using that tries to put these files in folders you don't want them to go to. Can you give a couple of examples?


  • Registered Users, Registered Users 2 Posts: 1,506 ✭✭✭shizz


    I don't really understand what you mean here or what program you're using that tries to put these files in folders you don't want them to go to. Can you give a couple of examples?

    Well for example Im on Xubuntu. Now if you click on the folder icon on the dock it brings up a list of folders like Desktop, Documents, music, Videos etc. These folders come with the install ie I didnt make them. and then anything saved into them are saved on the operating systems partition. What I'd like to do is to be able to click on that Videos folder for example and be taken straight to where all my videos are on the data partition.

    It seems like the cleanest way of storing all my files, and brings down the amount of clicks id have to do.


  • Moderators, Arts Moderators Posts: 35,731 Mod ✭✭✭✭pickarooney


    Any chance of a screenshot? I use xubuntu but with cairo dock so I don't have the same default shortcuts. I'm kind of starting to understand what you're after now, I just use the OS in a different way.


  • Registered Users, Registered Users 2 Posts: 14,048 ✭✭✭✭Johnboy1951


    shizz wrote: »
    Well for example Im on Xubuntu. Now if you click on the folder icon on the dock it brings up a list of folders like Desktop, Documents, music, Videos etc. These folders come with the install ie I didnt make them. and then anything saved into them are saved on the operating systems partition. What I'd like to do is to be able to click on that Videos folder for example and be taken straight to where all my videos are on the data partition.

    It seems like the cleanest way of storing all my files, and brings down the amount of clicks id have to do.

    Then what I have described will do that, while still leaving a link to the new location under /home/<user-name>, so that you can access them through a file manager just as easily.

    As I said, I don't use Ubuntu/Gnome, but I doubt very much if it is very different to all other Linux flavours in this respect.


  • Registered Users, Registered Users 2 Posts: 1,506 ✭✭✭shizz


    Any chance of a screenshot? I use xubuntu but with cairo dock so I don't have the same default shortcuts. I'm kind of starting to understand what you're after now, I just use the OS in a different way.

    screenshotmenuu.png

    Uploaded with ImageShack.us

    As you can see here I've clicked the folder icon on the dock and brought up the default folders. If I was to click into any of these I would like it to go straight to the relative folder that I choose in my Data partition.

    screenshotmenu2.png

    Uploaded with ImageShack.us

    And as you can see on this one, I am in the file browser and the default folders are present on the left, with the folders from my data partition on show. You can see the Music folder in my data partition there. Ideally I would like that folder to open when I click the default music folder on the left.

    Then what I have described will do that, while still leaving a link to the new location under /home/<user-name>, so that you can access them through a file manager just as easily.

    As I said, I don't use Ubuntu/Gnome, but I doubt very much if it is very different to all other Linux flavours in this respect.

    Yeah I tried what you said about dragging and dropping. If I try to drag the folder on the left over on to the folder I wish to link it to, it does nothing. Just slides back to its original position.

    I hope this clears it up but I am going to try the sym links thing now to see if it works.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 1,506 ✭✭✭shizz


    Ok so ive tried the ln -s command in so may different ways trying to get the directory right, but it hasn't worked.

    It was reccommended to use ln -s /home/colin/DATA/Documents /home/colin/Documents

    Its created some link in the documents folder but nothing has happened. So I thought I got the directory wrong as DATA is in media under file systems not home. But this didn't work either. Or do I have to undo what I did before?


  • Registered Users, Registered Users 2 Posts: 14,048 ✭✭✭✭Johnboy1951


    Yeah I tried what you said about dragging and dropping. If I try to drag the folder on the left over on to the folder I wish to link it to, it does nothing. Just slides back to its original position.

    I hope this clears it up but I am going to try the sym links thing now to see if it works.

    If you open two instances of the file manager (or split view if available), with one pane showing /home/<user-name> and the other pane showing the destination location.

    Presumably the destination is a partition mounted maybe in /media or other .... so the second location might be
    /media/DATA .... depending on mount point.

    You then drag the folder from the main pane (not the left) over to the other, and select to move. You can drag it back and select to link.

    BTW ...... you can delete any of those folders in /home/<user-name> if you wish.
    For instance delete the Music folder (if there is nothing in it you need).
    You can then create a folder called Music on any other partition, and link that back by dragging and dropping it as described.
    There is nothing particularly sacred about the folders that are there by default. ;)

    regards.


  • Registered Users, Registered Users 2 Posts: 1,506 ✭✭✭shizz


    If you open two instances of the file manager (or split view if available), with one pane showing /home/<user-name> and the other pane showing the destination location.

    Presumably the destination is a partition mounted maybe in /media or other .... so the second location might be
    /media/DATA .... depending on mount point.

    You then drag the folder from the main pane (not the left) over to the other, and select to move. You can drag it back and select to link.

    BTW ...... you can delete any of those folders in /home/<user-name> if you wish.
    For instance delete the Music folder (if there is nothing in it you need).
    You can then create a folder called Music on any other partition, and link that back by dragging and dropping it as described.
    There is nothing particularly sacred about the folders that are there by default. ;)

    regards.

    Ahhh thanks man. I think youv'e explained why my ln -s wasn't working. I never deleted the previous folder.

    Yeah I guess that's just the windows head on me thinking they are. IIRC you can't replace the default folders on windows, Or if you do they loose the icons on them. I like icons :) haha

    Thanks again man I'll give it a try soon.


  • Registered Users, Registered Users 2 Posts: 1,506 ✭✭✭shizz


    Ok so simply deleting the documents folder and then throwing my data partition documents folder worked but it doesn't show up on the list of folders when the folder icon on the dock is clicked


  • Registered Users, Registered Users 2 Posts: 1,506 ✭✭✭shizz


    Ok so I was having problems with my Windows partition so had to Reinstall everything today and I decided to go for Ubuntu 11.10. The sym links worked and everything is as I want it to be.

    I really learnt a lot about the terminal with this.

    Thanks Everyone :) Delighted.


  • Registered Users, Registered Users 2 Posts: 1,506 ✭✭✭shizz


    Ok so after more or less a day with the sym links thing I have noticed that when I turn on the computer the folders aren't automatically linked. Like if I click on the folder it says such a folder doesn't exist. But if I then go to the Data partition and enter the folder I'm trying to enter, a few seconds later they get linked up again. Is there anyway around this?


  • Moderators, Technology & Internet Moderators Posts: 1,336 Mod ✭✭✭✭croo


    I would guess what's happening is, the "Data" partition is not being mounted by default. When you click on it via Nautilus (i.e. the file browser), it automatically mounts it for you and then the links appear to work.

    What partitions are loaded automatically when the system starts up is defined in a file /etc/fstab (fstab= File System Table).

    There might be some GUI tools to help define the fstab file but I just edit it manually. Usually you can just copy a previous entry, the important pieces of information are what is to be mounted & where to mount it. "What" is usually defined in ubuntu by the UUID of the disk partition which I find using gparted - select a partition and right click to select information. In other distros the df -h command displays uuid info but not in ubuntu (or if it does I don't know the command switch to use).


  • Registered Users, Registered Users 2 Posts: 14,048 ✭✭✭✭Johnboy1951


    blkid

    should show the UUID as well as other info.


  • Closed Accounts Posts: 3,654 ✭✭✭shadowninty


    fstab needs to be edited to mount the partition at boot
    terminal wrote:
    sudo gedit /etc/fstab
    Be careful doing this, don't mess up your / partition. If you do, I know you can edit fstab from the File Manager in Parted Magic.

    I'll throw up the command I put in fstab when I get to my laptop.

    Ok, here it is, obviously change it the the relevant partition (/dev/sd[hard drive][partition]), and the desired mount point.
    /dev/sda7 /media/.data ext4 dev,suid,exec 0 2


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 1,506 ✭✭✭shizz


    fstab needs to be edited to mount the partition at boot


    Be careful doing this, don't mess up your / partition. If you do, I know you can edit fstab from the File Manager in Parted Magic.

    I'll throw up the command I put in fstab when I get to my laptop.

    Ok, here it is, obviously change it the the relevant partition (/dev/sd[hard drive][partition]), and the desired mount point.

    /dev/sda7 /media/.data ext4 dev,suid,exec 0 2

    I was wondering if you could explain this command a bit more. My data partition is NTFS not ext4. and what does the end part mean?

    Also is it as simple as just putting this command straight in nothing else?


  • Closed Accounts Posts: 3,654 ✭✭✭shadowninty


    shizz wrote: »
    /dev/sda7 /media/.data ext4 dev,suid,exec 0 2

    I was wondering if you could explain this command a bit more. My data partition is NTFS not ext4. and what does the end part mean?

    Also is it as simple as just putting this command straight in nothing else?
    Sorry, should've mentioned that you'd need to change the ext4 to NTFS :o
    I'm not too sure myself, the pass I think is to do with the order of partition checking, not sure about dump, but those are the settings I robbed from somewhere else :p


  • Registered Users, Registered Users 2 Posts: 1,506 ✭✭✭shizz


    Sorry, should've mentioned that you'd need to change the ext4 to NTFS :o
    I'm not too sure myself, the pass I think is to do with the order of partition checking, not sure about dump, but those are the settings I robbed from somewhere else :p

    Ah no worries.

    So should this do for me? /dev/sda5 /media/DATA NTFS dev,suid,exec 0 2

    And you just simply paste it into that file? Do I not have to put in the UUID?


  • Closed Accounts Posts: 3,654 ✭✭✭shadowninty


    shizz wrote: »
    Ah no worries.

    So should this do for me? /dev/sda5 /media/DATA NTFS dev,suid,exec 0 2

    And you just simply paste it into that file? Do I not have to put in the UUID?

    You can use /dev/sdXY, OR UUID. Its up to you!
    Just paste it in after opening it with the command I have :)


  • Registered Users, Registered Users 2 Posts: 1,506 ✭✭✭shizz


    You can use /dev/sdXY, OR UUID. Its up to you!
    Just paste it in after opening it with the command I have :)

    Ill use ur command now and see how it goes but just wondering if I was to use the UUID is that all I would have to put in?


  • Registered Users, Registered Users 2 Posts: 1,506 ✭✭✭shizz


    Ok so I just simply pasted that command in to fstab and restarted the computer. Upon restart I got an error message saying that a serious error occured in mounting it. I chose to ignore but the error came again so I chose to skip mounting. I couldn't open DATA so I deleted my entry in fstab and when I clicked on DATA it mounted and I can access the Drive.

    Any ideas?


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 14,048 ✭✭✭✭Johnboy1951


    Supply some factual information which might help us know what is done .....

    quote the error message exactly

    copy/paste the actual fstab line you used

    confirm that /media/DATA directory exists

    post the output of the fdisk -l command and also the output of blkid command


  • Registered Users, Registered Users 2 Posts: 1,506 ✭✭✭shizz


    Supply some factual information which might help us know what is done .....

    quote the error message exactly

    copy/paste the actual fstab line you used

    confirm that /media/DATA directory exists

    post the output of the fdisk -l command and also the output of blkid command

    I Will try it later and quote the exact message but yes the /media/DATA directory does exist. At least that is where Ubuntu mounts DATA when I access it.

    The line I entered into fstab is exactly like this, straight copy and paste, /dev/sda5 /media/DATA NTFS dev,suid,exec 0 2

    Youll have to help me with what you are askin at the end, Im not that familiar with it.


  • Registered Users, Registered Users 2 Posts: 14,048 ✭✭✭✭Johnboy1951


    shizz wrote: »
    I Will try it later and quote the exact message but yes the /media/DATA directory does exist. At least that is where Ubuntu mounts DATA when I access it.

    When mounting as you describe the DATA directory may be created 'on the fly' and deleted again when the partition is unmounted.

    That situation is no good for fstab entries ...... the directory must be there for the mount to occur.
    The line I entered into fstab is exactly like this, straight copy and paste, /dev/sda5 /media/DATA NTFS dev,suid,exec 0 2

    /dev/sda5 /media/DATA ntfs defaults 0 0

    I don't have any NTFS partitions here, so am not at all sure of the syntax, but I suspect the lower case lettering might be needed.

    Try the above in fstab in place of any other entry for /dev/sda5

    You can then try mounting the partition from the command line, as ROOT.
    If it mounts successfully, then the entry can be edited to give the correct permissions for its use.

    So open a terminal and gain root privileges ..... not sure how in Ubuntu as it uses some weird implementation of sudo ........ maybe sudo su or something like that?

    Entering the command
    mount
    should give you a list of everything that is presently mounted. Then enter
    mount /dev/sda5 /media/DATA

    If this goes OK issuing the mount command again should show the partition mounted. If it does not then please post back an exact copy/paste of the command and response.

    After that it is a matter of editing the fstab entry to get the correct permissions for you to read and write to the partition and its contents.
    Youll have to help me with what you are askin at the end, Im not that familiar with it.

    OK ...... as mentioned above .... it is a matter of launching a terminal, gaining root privileges, and entering the commands listed, and then reporting back the output from those commands.

    The commands in the previous post were

    blkid

    and

    fdisk -l (NOTE: that is a lower case L for List)

    I hope that helps a bit.


  • Registered Users, Registered Users 2 Posts: 1,506 ✭✭✭shizz


    When mounting as you describe the DATA directory may be created 'on the fly' and deleted again when the partition is unmounted.

    That situation is no good for fstab entries ...... the directory must be there for the mount to occur.



    /dev/sda5 /media/DATA ntfs defaults 0 0

    I don't have any NTFS partitions here, so am not at all sure of the syntax, but I suspect the lower case lettering might be needed.

    Try the above in fstab in place of any other entry for /dev/sda5

    You can then try mounting the partition from the command line, as ROOT.
    If it mounts successfully, then the entry can be edited to give the correct permissions for its use.

    So open a terminal and gain root privileges ..... not sure how in Ubuntu as it uses some weird implementation of sudo ........ maybe sudo su or something like that?

    Entering the command
    mount
    should give you a list of everything that is presently mounted. Then enter
    mount /dev/sda5 /media/DATA

    If this goes OK issuing the mount command again should show the partition mounted. If it does not then please post back an exact copy/paste of the command and response.

    After that it is a matter of editing the fstab entry to get the correct permissions for you to read and write to the partition and its contents.



    OK ...... as mentioned above .... it is a matter of launching a terminal, gaining root privileges, and entering the commands listed, and then reporting back the output from those commands.

    The commands in the previous post were

    blkid

    and

    fdisk -l (NOTE: that is a lower case L for List)

    I hope that helps a bit.

    I havent done the bottom commands yet but I edited the fstab with your code but havent restarted to see if it works as I tried the mount command in root and i get this back
    root@colin-N53SV:/home/colin# mount /dev/sda5 /media/DATA
    fuse: failed to access mountpoint /media/DATA: No such file or directory

    What does this mean? The media folder is there but obviously DATA isn't mounted there but I thought that that was what this command was for?


  • Registered Users, Registered Users 2 Posts: 1,506 ✭✭✭shizz


    I also just noticed that I know can't access the DATA partition.

    It seems to only prevent me from mounting it when i put that code into the fstab


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 14,048 ✭✭✭✭Johnboy1951


    I havent done the bottom commands yet but I edited the fstab with your code but havent restarted to see if it works as I tried the mount command in root and i get this back
    Quote:
    root@colin-N53SV:/home/colin# mount /dev/sda5 /media/DATA
    fuse: failed to access mountpoint /media/DATA: No such file or directory
    What does this mean? The media folder is there but obviously DATA isn't mounted there but I thought that that was what this command was for?

    It means the DATA directory does not exist ....... which is what I had asked previously.

    The directory MUST exist if the fstab entry is to work.
    I also just noticed that I know can't access the DATA partition.

    It seems to only prevent me from mounting it when i put that code into the fstab

    If you have an entry in fstab then that takes precedence which is why you cannot mount it by clicking on it.

    Create the DATA directory in /media first then try the mount commands again.


  • Registered Users, Registered Users 2 Posts: 1,506 ✭✭✭shizz


    It means the DATA directory does not exist ....... which is what I had asked previously.

    The directory MUST exist if the fstab entry is to work.



    If you have an entry in fstab then that takes precedence which is why you cannot mount it by clicking on it.

    Create the DATA directory in /media first then try the mount commands again.

    Ah ok sorry Im starting to understand it now.

    Ill try now.


  • Registered Users, Registered Users 2 Posts: 1,506 ✭✭✭shizz


    I Think it is working now. I created the directory, edited fstab and mounted the drive using root. Im going to restart the computer now and see if the drive is mounted.


  • Registered Users, Registered Users 2 Posts: 1,506 ✭✭✭shizz


    EUREKA it works haha. Thanks so much to everyone that helped me. I've learnt a lot about using the terminal and Linux in general.

    Although, maybe it's just because Im new to Linux and its a different way of doing things but this task was an awful lot easier to do in windows. Im not saying I prefer windows but it's tasks like this that might prevent people from the switch over.

    What do you think?


  • Closed Accounts Posts: 3,654 ✭✭✭shadowninty


    I'm just a casual user myself (hence my incredibly basic advice), tbh though I find this easier to do on Linux, because there were simple instructions when I Googled it. Windows just seems to mount *everything* at boot, which is silly.
    Mind you, I can see how you feel that way!
    I generally avoid the Terminal like the plague, GUIs are what I use for everything if possible. The terminal is much more functional in Linux OS's then Windows, primarily because most apps have a separate GUI which operates the program, thus it can be accessed from the Terminal too. Its also brilliant being able to copy commands off the internet.


  • Registered Users, Registered Users 2 Posts: 1,506 ✭✭✭shizz


    I'm just a casual user myself (hence my incredibly basic advice), tbh though I find this easier to do on Linux, because there were simple instructions when I Googled it. Windows just seems to mount *everything* at boot, which is silly.
    Mind you, I can see how you feel that way!
    I generally avoid the Terminal like the plague, GUIs are what I use for everything if possible. The terminal is much more functional in Linux OS's then Windows, primarily because most apps have a separate GUI which operates the program, thus it can be accessed from the Terminal too. Its also brilliant being able to copy commands off the internet.

    Why would it be considered silly to mount everything at boot?

    I enjoy using the terminal for the likes of copying stuff, making directories and generally any of the stuff we did in here. Although sometimes I don't like using it because I can't visualise whats going on so I feel like I dunno whats happening to the system.

    But I think its a very good tool to learn.


  • Closed Accounts Posts: 3,654 ✭✭✭shadowninty


    shizz wrote: »
    Why would it be considered silly to mount everything at boot?

    I enjoy using the terminal for the likes of copying stuff, making directories and generally any of the stuff we did in here. Although sometimes I don't like using it because I can't visualise whats going on so I feel like I dunno whats happening to the system.

    But I think its a very good tool to learn.

    It takes time to mount things, and exposes partitions to problems, and you cant unmount them then usually. Great that you like it!


  • Registered Users, Registered Users 2 Posts: 1,506 ✭✭✭shizz


    It takes time to mount things, and exposes partitions to problems, and you cant unmount them then usually. Great that you like it!

    Ah yeah I spose, I never thought of it like that. I guess when all you use is windows feels like thats the way it should be done haha.

    The positive thing about this way though was that I was in full control (and full blame haha).


  • Registered Users, Registered Users 2 Posts: 14,048 ✭✭✭✭Johnboy1951


    shizz wrote: »
    EUREKA it works haha. Thanks so much to everyone that helped me. I've learnt a lot about using the terminal and Linux in general.

    Although, maybe it's just because Im new to Linux and its a different way of doing things but this task was an awful lot easier to do in windows. Im not saying I prefer windows but it's tasks like this that might prevent people from the switch over.

    What do you think?


    I would never use a terminal to do what you did.
    I would use the GUI provided by my distro to do it.

    I don't know what GUI apps you have on your distro, so the only way to be sure is to provide terminal commands which should be universal.

    Neither do I mount my data, storage, music etc partitions through fstab.
    In fact the only entries in fstab here are those pertaining to the OS -- /, /home & swap -- as well as one LAN share. All 14 other partitions get mounted outside of fstab. Some I have automounted on boot up ..... for things like directory links from /home, while others I mount only as needed.

    Linux provides options ...... sometimes a bewildering number of them for new users. That is its power .... and its drawback for new users.

    When you wish to change the way you use things, the options will be there.

    Glad things are now working for you ;)


  • Registered Users, Registered Users 2 Posts: 1,506 ✭✭✭shizz


    I would never use a terminal to do what you did.
    I would use the GUI provided by my distro to do it.

    I don't know what GUI apps you have on your distro, so the only way to be sure is to provide terminal commands which should be universal.

    Neither do I mount my data, storage, music etc partitions through fstab.
    In fact the only entries in fstab here are those pertaining to the OS -- /, /home & swap -- as well as one LAN share. All 14 other partitions get mounted outside of fstab. Some I have automounted on boot up ..... for things like directory links from /home, while others I mount only as needed.

    Linux provides options ...... sometimes a bewildering number of them for new users. That is its power .... and its drawback for new users.

    When you wish to change the way you use things, the options will be there.

    Glad things are now working for you ;)

    Im sure there was another way to do what I did but it honestly wasn't obvious to me how to do it. If there was a GUI version I'd love some one to show me where abouts I can do it.

    Also you say you don't have any entries in fstab yet you mentioned that you have some partitions that automount on start up? I thought fstab was something that does this, as in there shouldn't be another way?


  • Advertisement
Advertisement