You are not logged in.

#1 2012-09-22 09:17:27

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Mounting a partition as data storage into /home

I have never tried this so not sure how to do it

My second drive has

/dev/sdb1 / [20Gb set as root]
/dev/sdb2 /home [rest of drive]

I want to clear sdb2 and use it as data storage but mount it into my /home/<user> directory so its accessible for things like music, photo, backups.

Or would it be safer to load it into / say in /data and allow to be user writable?


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#2 2012-09-22 09:49:49

pablokal
Administrator
From: Nijmegen, Holland
Registered: 2010-10-12
Posts: 3,633
Website

Re: Mounting a partition as data storage into /home

I would add the partition to fstab or automount it via pmount ( put pmount /dev/sdb2 in autostart).
The location isn't important I think; the permissions are.


Getting your questions answered here at ArchBang Forums
Please! Always give hardware info, if there is a chance that 's relevant: #lspci -vnn
On Arch(bang) and Openbox: http://stillstup.blogspot.com/

Offline

#3 2012-09-22 11:58:56

mike4ca
Happy (Arch|Manjaro)[B,b]ang User
From: Iowa, USA
Registered: 2011-10-17
Posts: 435

Re: Mounting a partition as data storage into /home

I do that frequently.  It allows me to keep referencing the same data across multiple distros.  I will create a /myfiles directory and add it to fstab.  Within the actual partition I will have folders for Documents, Downloads, Photos, etc.  I create links from my home folder back to /myfiles/Documents, /myfiles/Downloads, etc.  Actually, I have a folder on the partition called links.  In which I keep all of my links and when I install a new distro, I just copy the links over to my home.  Like magic, all of my docs are there.


Free Software Foundation member 10865

Offline

#4 2012-09-23 00:07:19

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: Mounting a partition as data storage into /home

@mike4ca hoping to use 20gb root partition for i686 arch install and share my /home partition with it from first drive. Linking sounds like a very good idea, can you give me an example to get me going? Also how have you got /myfiles set up in fstab [to allow user to access it]


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#5 2012-09-23 04:43:06

ratcheer
Member
Registered: 2011-10-08
Posts: 114

Re: Mounting a partition as data storage into /home

That is a good idea, Mr Green. I have a btrfs filesystem that I use for data and mount it on all my systems, but I just mount it under root. Mounting it under /home makes a lot of sense.

Tim

Last edited by ratcheer (2012-09-23 04:43:34)

Offline

#6 2012-09-23 04:51:01

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: Mounting a partition as data storage into /home

Would like to mount it using fstab at boot, with user access. Figure on using it for local backup, and media stuff. I always backup once a month to an external drive just to be safe.


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#7 2012-09-23 19:43:13

mike4ca
Happy (Arch|Manjaro)[B,b]ang User
From: Iowa, USA
Registered: 2011-10-17
Posts: 435

Re: Mounting a partition as data storage into /home

Mr Green wrote:

@mike4ca hoping to use 20gb root partition for i686 arch install and share my /home partition with it from first drive. Linking sounds like a very good idea, can you give me an example to get me going? Also how have you got /myfiles set up in fstab [to allow user to access it]

I am a little confused.  It sounds like you have an install on sda.  Does it have a separate /home partition?  You want to install a 32 bit Arch(Bang?) on sdb1 and have it reference your home partition on the sda install?  Or do you just want each do you want each install's home directory to have folders that both point to sdb2 partition?  Please list out the partitions and clarify where you want the data. 

Assuming you want to use sdb2 as a shared location for data, what format were you thinking (ext?, ntfs?, other).  I have some ntfs examples back when I thought I wanted Windows to access it as well.  Then later when I had trouble with ownership (ntfs does not seem to care).  It is also useful if you want to talk between BSDs and Linux.  I avoid it now as I try to become patent free (becoming a bit of a software hippy).  I have one install with a NILFS2 shared partition (just playing around).  I can try an extX format if you wish.  Let me know.


Free Software Foundation member 10865

Offline

#8 2012-09-23 21:45:35

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: Mounting a partition as data storage into /home

My main everyday system is on sda [ / & /home ], sdb has a 20gb partition I want to install 32 bit on [need it for iso building] rest is storage. I want to share my /home partition with 32 install to save me the need to run two /home partitions. Have got my data drive mounted to:

/dev/sdb2 /home/mrgreen/data ext4 defaults 0 0

Then changed permissions on /data folder for user access..


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#9 2012-09-26 21:17:34

mike4ca
Happy (Arch|Manjaro)[B,b]ang User
From: Iowa, USA
Registered: 2011-10-17
Posts: 435

Re: Mounting a partition as data storage into /home

Sorry about not getting back to you sooner.  I was testing things out and was running into issues.  I learned more.  Here is what I did.  After formatting /dev/sda2 to ext4, I ran the following in the terminal.

$ sudo lxterminal 
# mkdir /files
# echo "/dev/sda2 /files ext4 rw,auto,users,exec 0 0" >> /etc/fstab
# mount -a
# chmod 777 /files
# exit
$ mkdir /files/Music
$ ln -s /files/Music Music

In the previous attempts, I had the chmod right after creating the /files directory.  But once I mounted the partition then the permissions would revert back to drwxr-xr-x.  Moving the chmod to after the mount keeps the permissions to drwxrwxrwx. 

Then in a CrunchBang install I ran

$ sudo terminator
# mkdir /files
# echo "/dev/sda2 /files ext4 rw,auto,users,exec 0 0" >> /etc/fstab
# mount -a
# exit
$ ln -s /files/Music Music

Notice that I did not have to issue chmod as the mount already assumed the permissions I had previously set.  I have full permission to add and manipulate files in both installs.  I even have different user names for the different installs.

I hope this helps.


Free Software Foundation member 10865

Offline

#10 2012-09-27 00:01:57

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: Mounting a partition as data storage into /home

In the end I loaded up partition to a directory /data. This could be handy for dropbox folder, for ssd drive I need to move /var/log to a spinning drive so might create a partition for /root folders that might wear down my ssd... This would be useful put into wiki smile


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

Board footer

Powered by FluxBB