SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2012-02-11 11:17:12

CBizgreat!
#! Die Hard
Registered: 2011-07-27
Posts: 1,505

Automount shared partitions with Crunchbang ...

It is time for yet another babbling how to fellow Crunchers n gnu/nixers. For this how to you will need 1 crunchybangy gnu/nix OS n one keyboard ... Everybody got that ... ? .... Good, now we can proceed.  wink


They say sharing is caring and I somewhat believe that depending upon da circumstances. There may come a time when you want to share stuff between gnu/Linux and a window$ operating system you have on your PC. Of course window$ doesn't play well with others ... BUT fortunately #! and gnu/Linux does. If only to show M$ how craptastic their software is by comparison.

Let's say you have a ntfs partition on sda3 of your hard drive. You set it up with whichever partitioning tool you like, gparted, partedmagic, or even windows own disk utility and formatted it to be ntfs. Windows recognizes this as the D: drive and nicely marks your ext3, ext4 etc partitions as "unknown" ... a no wo/mans land into which window$ dare not venture. So we want to automount that partition, so we can share files between window$ and #! and read/write to it from either.

First we're going to set up a mount point for it. From what I understand you can make a mount point in either /media or /mnt. I'm going to use /media cuz it's just how I do it now ...



We open a terminal and type the following command. Feel da powa of the CLI !!! tongue

We make a directory ( mount pt for the sucker ) I'm calling mine Windows here ...

sudo mkdir /media/Windows

We now mount that puppy ...

sudo mount -t ntfs-3g /dev/sda3 /media/Windows

Then we unmount it ...

sudo umount /dev/sda3

We have our mount point setup. Let's add that ntfs partition to crunchbang ... By editing the /etc/fstab file.

In the new #! release we open a terminal and type ...

gksu geany /etc/fstab

In the older #! iso with ...

gksu gedit /etc/fstab

The fstab file opens and now we're gonna add the shared partition we want to automount to the sucker. We scrolldown to the bottom of the fstab file and in the line right under the last line in the file we add a comment like this thing> # Then tell ourselves what the heck this is all about like ...

# My new ntfs share on sda3 or whatever you want to put in the comment.
/dev/sda3 /media/Windows ntfs-3g quiet,defaults,umask=000     0    0

There ya have it, you've just added a ntfs formatted partition that will automount at boot. When you want to access that partition you can open thunar, go to file system and click on the /media folder and in it will be a folder Windows. There's your ntfs folks.


Notes about fstab weirdness. When you get to the end of the last new entry that you just added to fstab, here ...

/dev/sda3 /media/Windows ntfs-3g quiet,defaults,umask=000    0    0<-


Make sure you hit the enter ( return) button on your keyboard. If you don't it won't make your PC blow up or anything, but until you do when you boot up you'll see an aggravating warning about no final new line in /etc/fstab. Well ... that's what a final new line means. You have to hit Enter when you get to the end of the last line you added to fstab.



This is an all out babbling how to. I think fellow gnu/nix users deserve nothing less afterall ! big_smile Now let's cover doing the same with an ext3 or ext4 shared partition too. Steps are about the same, then we're gonna symlink these thingy's to make them easier to get to. Though am only going to cover an ext3, cuz that's what I've got and sure peeps won't have a problem figuring out what to change if they're using an ext4 partition instead ( hint: substitute ext4, where it says ext3 in the following) ... We do the same steps as above in terminal pretty much, w few differences. We're gonna say the ext3 partition is on sda5 ...

Im calling my ext3 shared partition Data here ..

sudo mkdir /media/Data
sudo mount -t ext3 /dev/sda5 /media/Data
sudo umount /dev/sda5

There we go, we setup our mount point in /media for it. Now we're gonna edit fstab again, alot like the ntfs and o course remembering the no final new line weirdness ... We add this to fstab.

# Linux share
/dev/sda5 /media/Data ext3  defaults,noatime    0    2

Save the fstab file o course ... done .. ALMOST, one thing remains to make that new ext3 automounted partition read/write by your user. With ntfs partitions someone can use the umask= gibberish in fstab to set permissions with gnu/nix file systems turns out to be a bit more complicated. So were going to take an extra couple secs in terminal to sort that out. To make that ext3 partition usable by reg users, we're going to chown the sucker ... change ownership of it. As otherwise it'll be owned by root user.

Open terminal and we're going to change ownership of that mount pt and everything in it so our reg user acct can use it as we please.

sudo chown -R yourusername /media/Data

Ok ... now done, you can read/write to that puppy as ya please. Adding that -R above means make it recursive, changing the ownership of all files/folders within that mount point.


Edit: People might also want to take a gander at this for the sake of completeness. Seemed a pretty good reference to the topic and your options ... Wiki link. Noatime is best for me in terms of performance me thinks. You however might want to use other options, as noatime is said not to get along well with certain email apps ... etc. I also choose to chown rather than add flags to fstab, this is also something you might do differently, if you so desire and that link explains things very well imo ...



Now we've just added a ntfs and an ext3 partition that will automount when we boot #! forevermore ! Yay ! However we still have a problem here. hmm If you're like me, then you too are lazy n prefer things to be easier. It kinda stinks having to go to these shares with thunar. What ooooo what can be done about this travesty of justice !?!?!?!?



Symbolic links ( aka: symlinks) 2 da rescue ! (Edit UPDATE: Can see below for how to easily add them to the sidebar in thunar too, for all of those using thunar as our file manager.)

We want to have access to these shared partitions from the /home/username don't we ? Of course ... so let's set up some symlinks to these partitions there. We pop open thunar and go to home directory, create a new directory ( folder ... whatever) called Shares ... You can o course call it chocolateicecream or whatever ya prefer. I called mine ... Shares

Inside this folder I create two more folders ... One called Data the other called Windows. Now for some symlinking ... Conjure up a terminal ...



4 the Windows share.

sudo ln -s /media/Windows /home/username/Shares/Windows


4 the Linux share.

sudo ln -s /media/Data /home/username/Shares/Data


And thank de friggin gawds we are done ... Now when we go to our home folder and open the Shares folder n open one or the other folders ... In this case Data and Windows, we'll have access to those shared partitions.  I know this works, as I'm doing it myself. As always, if anything has been missed or you have some good adds or suggests, please feel free to post up.



Whew ... this brings another babbling for nix newbs, by nix newb how to's to a close. (CB) n vll ! smile


Update: See this thread for adding share shortcuts to thunar. Complete with screenshot even ! Enjoy the nix people ! wink

[Update ... yet again ... Using UUID's is a newer/approved way to do this ... /dev/sdax still works no doubt. However in the spirit of updating babble ... See this link. The UUID thang came along a couple months after I'd posted this babble how to. wink

Last edited by CBizgreat! (2013-06-28 06:30:36)


Some common cbiz abbreviations. This will save me time and yet @ same time tell folks what the babble is supposed to mean.

Vll ! = ( Viva la gnu/Linux !)    Vl#!! = ( Viva la #! !)    Last but not least, UD ... OD ! = ( Use Debian ... or die !) tongue

Offline

Help fund CrunchBang, donate to the project!

#2 2012-02-11 11:28:12

rhowaldt
#!*$%:)
Registered: 2011-03-09
Posts: 4,396

Re: Automount shared partitions with Crunchbang ...

nice how-to! i think the babbling-to-instructions-ratio is just right on this one. you're quite getting the hang of this smile

Offline

#3 2012-02-11 14:22:03

CBizgreat!
#! Die Hard
Registered: 2011-07-27
Posts: 1,505

Re: Automount shared partitions with Crunchbang ...

As usual lol rhowaldt, thanks for da smile n compliments. Is encouraging to know this horribly longggggg babbling how to meets with the rhowaldt seal of babbling approval too. wink Hope helps some folks get more enjoyment or save some time, headache, borkage ... blahblahblah.


smile


Some common cbiz abbreviations. This will save me time and yet @ same time tell folks what the babble is supposed to mean.

Vll ! = ( Viva la gnu/Linux !)    Vl#!! = ( Viva la #! !)    Last but not least, UD ... OD ! = ( Use Debian ... or die !) tongue

Offline

#4 2012-02-11 18:04:29

CBizgreat!
#! Die Hard
Registered: 2011-07-27
Posts: 1,505

Re: Automount shared partitions with Crunchbang ...

Summin was bugging me about that ext3 fstab entry above. Namely that fsck wasn't set, so corrected to be correcto. fsck will n should be run on mounted nixish type file systems every 30 mounts I think and there you have it. So this also brought up another question ... Where do people stand on the issue of noatime ? To use or not to use to boosto perfomanco ?


Alrighty ... outie yet again, vll ! wink

Last edited by CBizgreat! (2012-02-11 18:05:33)


Some common cbiz abbreviations. This will save me time and yet @ same time tell folks what the babble is supposed to mean.

Vll ! = ( Viva la gnu/Linux !)    Vl#!! = ( Viva la #! !)    Last but not least, UD ... OD ! = ( Use Debian ... or die !) tongue

Offline

#5 2012-02-11 18:32:19

Unia
#! Octo-portal-pussy
From: The Netherlands
Registered: 2010-07-17
Posts: 4,019

Re: Automount shared partitions with Crunchbang ...

Hey! This should've been posted some days ago! I just did all this to symlink my /home directories to those on my Windows partition. (here's some more info, should it be needed: https://wiki.archlinux.org/index.php/NTFS-3G and https://wiki.archlinux.org/index.php/Fstab)

However, whenever I used the

ln -s /path/to/windows/dir ~/dir

I didn't get a symlinking directory, but some sort of file. In the end I installed Thunar and used its "link to Desktop"option to create foldersymlinks.

Could someone explain me what I did wrong?


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Github

I am a #! forum moderator. Feel free to send me a PM with any question you have!

Offline

#6 2012-02-11 18:58:25

rhowaldt
#!*$%:)
Registered: 2011-03-09
Posts: 4,396

Re: Automount shared partitions with Crunchbang ...

^ i think that's just what a symlink is. just a file linked to somewhere. or do you mean when you look in Windows you see a file? hmmm... tell us more smile

Offline

#7 2012-02-11 19:15:49

Unia
#! Octo-portal-pussy
From: The Netherlands
Registered: 2010-07-17
Posts: 4,019

Re: Automount shared partitions with Crunchbang ...

Before I reinstalled Arch, I did the exact same thing and got a folder in Linux which was a symlink to a folder in Windows. (so when I opened the folder in Linux, all the contents were there)

One day ago I reinstalled and tried to do the same, but now I got a file in Linux that was a symlink to a folder in Windows.

Here's a pic to show, look at the Muziek folder and Music file (not music.txt):
tY3JrOA


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Github

I am a #! forum moderator. Feel free to send me a PM with any question you have!

Offline

#8 2012-02-11 19:55:17

rhowaldt
#!*$%:)
Registered: 2011-03-09
Posts: 4,396

Re: Automount shared partitions with Crunchbang ...

hmmmm... so that music-file you have there is still a link to your Windows-directory? since in Linux everything is a file etc...
looked at 'man ln' but could only see the option for hardlinking directories, instead of symlinking them. so not sure about that. well, i have no idea. unless you figure this one out, what i'd do is just change the icon big_smile

Offline

#9 2012-02-11 20:18:59

Unia
#! Octo-portal-pussy
From: The Netherlands
Registered: 2010-07-17
Posts: 4,019

Re: Automount shared partitions with Crunchbang ...

rhowaldt wrote:

hmmmm... so that music-file you have there is still a link to your Windows-directory? since in Linux everything is a file etc...
looked at 'man ln' but could only see the option for hardlinking directories, instead of symlinking them. so not sure about that. well, i have no idea. unless you figure this one out, what i'd do is just change the icon big_smile

I solved this by, as I said, installing Thunar and using its 'link to Desktop' feature. However, I still don't get why it worked before and now didn't


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Github

I am a #! forum moderator. Feel free to send me a PM with any question you have!

Offline

#10 2012-02-11 21:01:57

rhowaldt
#!*$%:)
Registered: 2011-03-09
Posts: 4,396

Re: Automount shared partitions with Crunchbang ...

hmmm, that's the annoying thing with these features: what goes on behind the scenes? well, at least it is fixed..

Offline

#11 2012-02-11 21:24:09

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,163
Website

Re: Automount shared partitions with Crunchbang ...

@CBizgreat! - Well done on this How To! 

Added it to Quick Reference


VSIDO | Words That Build Or Destroy

We do not run from challenges, they become new innovations within VSIDO!

Offline

#12 2012-02-12 04:09:44

CBizgreat!
#! Die Hard
Registered: 2011-07-27
Posts: 1,505

Re: Automount shared partitions with Crunchbang ...

Thanks VastOne ...

Glad Unia sorted it, only 1/2 got the symlink thing meself. Try to play it safe, which is why I setup new folders to symlink to, instead of trying to symlink more than one thing to the same file path. Wasn't sure what would result if setting up a symlink to the exact same path for more than 1 thingy. DIdn't want to cause some weird file system meltdown or whatever ... So went with better safe than etc. With a directory probably nothing and yep, the symlinks in the affected folders don't show up as folders, they appear to just be links, but work as expected.


smile

Last edited by CBizgreat! (2012-02-12 04:11:04)


Some common cbiz abbreviations. This will save me time and yet @ same time tell folks what the babble is supposed to mean.

Vll ! = ( Viva la gnu/Linux !)    Vl#!! = ( Viva la #! !)    Last but not least, UD ... OD ! = ( Use Debian ... or die !) tongue

Offline

#13 2012-02-13 20:03:38

CBizgreat!
#! Die Hard
Registered: 2011-07-27
Posts: 1,505

Re: Automount shared partitions with Crunchbang ...

Ok did a final draft edit on this sucker missed summin important, it's now correct as can be. I missed the friggin chown step. Went to write to some files on my ext3 share today ... Opened no prob, go to save ... Nope, nope, nope, no permission fella, not so fast. DARN IT !!! Wth !?!?? So google to the rescue, until I figured it out and now you folks also know da trick.

I'd tested the ntfs with read/write but had neglected to test the ext3 beyond opening some files to check if I had access. Good ole chown and now can fully read/write n execute on the partition.



vll !

Last edited by CBizgreat! (2012-02-13 20:16:10)


Some common cbiz abbreviations. This will save me time and yet @ same time tell folks what the babble is supposed to mean.

Vll ! = ( Viva la gnu/Linux !)    Vl#!! = ( Viva la #! !)    Last but not least, UD ... OD ! = ( Use Debian ... or die !) tongue

Offline

#14 2012-02-24 08:00:04

cJones
#! Junkie
From: Oregon
Registered: 2012-02-21
Posts: 447

Re: Automount shared partitions with Crunchbang ...

This is, I think, exactly what Im looking for...Ive manually been running the following in terminal at start/need:

sudo mount /dev/sda4 -t ntfs /media/sda4

So here are my questions. Why are you putting ntfs-3g instead of just ntfs? Also, what does this exactly mean: quiet,defaults,umask=000,r 00<? I am willing to copy and paste all of that into my fstab file but would like to learn along the way.


d(o_O)b

Offline

#15 2012-02-25 05:11:18

CBizgreat!
#! Die Hard
Registered: 2011-07-27
Posts: 1,505

Re: Automount shared partitions with Crunchbang ...

Do not cut/paste that line as is into your fstab file. Read this link, it explains what each option in the line of an fstab entry means, better than I could. That line you posted above was talking about hitting the Enter/Return button on your keyboard when you get to the end of the last line you add to fstab. Or as described above, when you boot you'll keep getting a warning about no final new line in /etc/fstab. The < was trying to illustrate for people what I meant by get to the end of the last line you add in a new entry. < ( That is the end of the last line in this paragraph or would be if I weren't trying to show what the < was indicating to people.)


smile

PS, Here's another link discussing fstab entries and the options.

Last edited by CBizgreat! (2012-02-25 07:01:04)


Some common cbiz abbreviations. This will save me time and yet @ same time tell folks what the babble is supposed to mean.

Vll ! = ( Viva la gnu/Linux !)    Vl#!! = ( Viva la #! !)    Last but not least, UD ... OD ! = ( Use Debian ... or die !) tongue

Offline

#16 2012-02-25 07:58:41

cJones
#! Junkie
From: Oregon
Registered: 2012-02-21
Posts: 447

Re: Automount shared partitions with Crunchbang ...

CBizgreat! wrote:

PS, Here's another link discussing fstab entries and the options.

Thank you so much for that! It was becoming a pain having to remount after every reboot just to save  a doc or listen to a song.


d(o_O)b

Offline

#17 2012-02-25 08:05:29

CBizgreat!
#! Die Hard
Registered: 2011-07-27
Posts: 1,505

Re: Automount shared partitions with Crunchbang ...

Definitely welcome,

Sharing stuff I've learned and tried myself feels good. Makes all the time spent screwing around with PC's seem like less of a waste. So glad if it helped ya figure summin out. wink



vll ! Folks ...


Some common cbiz abbreviations. This will save me time and yet @ same time tell folks what the babble is supposed to mean.

Vll ! = ( Viva la gnu/Linux !)    Vl#!! = ( Viva la #! !)    Last but not least, UD ... OD ! = ( Use Debian ... or die !) tongue

Offline

#18 2012-02-25 08:10:59

cJones
#! Junkie
From: Oregon
Registered: 2012-02-21
Posts: 447

Re: Automount shared partitions with Crunchbang ...

CBizgreat! wrote:

Sharing stuff I've learned and tried myself feels good. Makes all the time spent screwing around with PC's seem like less of a waste.

Haha I know exactly how you feel! But yeah it was very much appreciated.


d(o_O)b

Offline

#19 2012-02-27 03:17:45

Kevin S
Member
Registered: 2011-03-22
Posts: 30

Re: Automount shared partitions with Crunchbang ...

I followed these instructions to access the files from my Linux Mint Debian Edition partition, and I have one possible addition to them. If the partition isn't mounted when you set up the new folder in /media, the files won't show up until after you've mounted it at least once. After that first manual mount, the files will show up in your folder after booting and logging in. However, if you don't mount the partition manually, your new folder will remain empty no matter how many times you reboot.

Offline

#20 2012-07-15 20:11:22

KrunchTime
#! Die Hard
From: not where I belong
Registered: 2012-03-02
Posts: 2,144

Re: Automount shared partitions with Crunchbang ...

@CBizgreat!

Thanks so much for this tip.  I setup a dual-boot environment for Windows 7 and CrunchBang Statler this weekend, and thanks to your tip, both are happily sharing data.

Offline

#21 2012-07-15 20:16:48

safetycopy
urban legend
From: The Chatsubo
Registered: 2010-04-03
Posts: 1,311

Re: Automount shared partitions with Crunchbang ...

Nice how-to! I've been using disk-manager to do this, but I like the idea of not having to install something when the same effect can be achieved with a bit of know-how smile


i wonder if i missed the warning
Skinny Puppy, Love in Vein

Offline

#22 2012-07-15 20:24:56

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,163
Website

Re: Automount shared partitions with Crunchbang ...

^ I use disk-manager also..  I like the one and done nature of it.


VSIDO | Words That Build Or Destroy

We do not run from challenges, they become new innovations within VSIDO!

Offline

#23 2012-07-16 07:12:11

CBizgreat!
#! Die Hard
Registered: 2011-07-27
Posts: 1,505

Re: Automount shared partitions with Crunchbang ...

Excellente ... Glad people are getting good use out of the info ... vll! ladies/gents. smile


Some common cbiz abbreviations. This will save me time and yet @ same time tell folks what the babble is supposed to mean.

Vll ! = ( Viva la gnu/Linux !)    Vl#!! = ( Viva la #! !)    Last but not least, UD ... OD ! = ( Use Debian ... or die !) tongue

Offline

#24 2012-07-26 04:45:14

KrunchTime
#! Die Hard
From: not where I belong
Registered: 2012-03-02
Posts: 2,144

Re: Automount shared partitions with Crunchbang ...

CBizgreat! wrote:

PS, Here's another link discussing fstab entries and the options.

I'm sharing a Rainlendar calendar with both Windows 7 and CrunchBang 10.  I'm not able to create new tasks or events under CrunchBang.  After some investigation, I've discovered that all of my shared NTFS partitions mounted via Fstab are owned by user and group "root".  I'm wondering if this might be causing the issue with my shared Rainlendar calendar under CrunchBang.

I checked out the Fstab link from the Ubuntu Wiki that CBizgreat! provided.  From there, I found another old link in the Ubuntu forums dealing with Fstab in even more detail; http://ubuntuforums.org/showthread.php?t=283131.  According to this link, you can create a mount point owned by the user.  I'm thinking that if I mounted my shared NTFS partitions under my name instead of root, my issues with the shared Rainlendar calendar might be resolved.  However, I'm not sure what issues, if any, mounting as user versus root might cause.  Thoughts anyone?

Last edited by KrunchTime (2012-07-26 04:46:19)

Offline

Help fund CrunchBang, donate to the project!

#25 2012-07-28 14:32:30

usernombre
New Member
Registered: 2012-07-28
Posts: 6

Re: Automount shared partitions with Crunchbang ...

Thanks you very much!
finally smile thanks.

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo