LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-12-2014, 03:57 AM   #1
Monk Tea
Member
 
Registered: Apr 2014
Location: New Delhi
Distribution: Slackware
Posts: 39

Rep: Reputation: 2
how to create a single home from two different partitions on different drives?


Here is the relevant part of fdisk -l output :

/dev/sda3 has 900 gb for home. sda1 &sda2 are root and swap.

/dev/sdb3 shows extended and sdb5 shows Linux ext4 partition that I wanna merge together with sda3 into home.

How can I do it? I am not new to Slackware as I have used 13.37 for over an year. So, I would appreciate if anyone could suggest me a scheme for partition or anything else.

This is my first post too. So hi.
 
Old 09-12-2014, 04:35 AM   #2
Totoro-kun
Member
 
Registered: Nov 2010
Location: Kaunas, Lithuania
Distribution: Slackware
Posts: 234

Rep: Reputation: 125Reputation: 125
Hello and welcome!

I guess, if you want to merge 3 physical partitions into one, your best bet would be logical volume management of some kind (lvm comes to mind).

Or, you could get away with some clever mounting. For example, I have two partitions /dev/sda3 (on smaller but fast system disk) and /dev/sdb1 (on large second disk).

I have mounted /dev/sda3 as /home and /dev/sdb1 as /mnt/files

Code:
ls /mnt/files/
viso 24K
drwx------ 2 root      root   16K Spa  9  2012 lost+found
drwxr-xr-x 8 meisteris users 4,0K Spa 31  2012 meisteris
drwxr-xr-x 6 root      root  4,0K Grd 23  2013 saugojimui
There I have a directory, which holds some of my files:
Code:
ls /mnt/failai/meisteris/
viso 24K
drwxr-xr-x 13 meisteris users 4,0K Rgs 11 09:08 Downloads
drwxr-xr-x  8 meisteris users 4,0K Grd 28  2013 Music
drwxr-xr-x 28 meisteris users 4,0K Rgs 11 09:00 Pictures
drwxr-xr-x  9 meisteris users 4,0K Rgs 11 09:06 Videos
All I have to do is link those folders to my /home directory using mount -o bind. You can put following lines into /etc/fstab, but I've chosen to create file /etc/rc.d/rc.mounts and then execute it from /etc/rc.d/rc.local
Code:
cat /etc/rc.d/rc.mounts 
#!/bin/csh
mount -o bind /mnt/failai/meisteris/Downloads /home/meisteris/Downloads
mount -o bind /mnt/failai/meisteris/Music /home/meisteris/Music
mount -o bind /mnt/failai/meisteris/Pictures /home/meisteris/Pictures
mount -o bind /mnt/failai/meisteris/Videos /home/meisteris/Video
So if rc.mounts is executable, rc.local will execute it. You can control it with chmod +x or chmod -x
Code:
cat /etc/rc.d/rc.local
#!/bin/sh
#
# /etc/rc.d/rc.local:  Local system initialization script.
#
# Put any local startup commands in here.  Also, if you have
# anything that needs to be run at shutdown time you can
# make an /etc/rc.d/rc.local_shutdown script and put those
# commands in there.

if [ -x "/etc/rc.d/rc.mounts" ]; then
sh /etc/rc.d/rc.mounts
fi
This way if I put something into my /home/Downloads it goes straigt to /dev/sdb1 And when I remove /dev/sdb1 from my system, it still boots, functions and I still have my working /home. Altough moving files from one binded directory to another can be rather slow.

If you chose LVM route, then all these partitions would be merged into one, which would be mounted as /home. So you could work with your files in a simpler way, but this requires to think of a good backup strategy, because failed disk or partition would make life rather difficult.

Both options have their strengths and weaknesses, if you can tell which way better suits your case, maybe we can help further. For now I suggest to google a bit on LVM.

Last edited by Totoro-kun; 09-12-2014 at 04:46 AM.
 
1 members found this post helpful.
Old 09-12-2014, 07:34 AM   #3
Monk Tea
Member
 
Registered: Apr 2014
Location: New Delhi
Distribution: Slackware
Posts: 39

Original Poster
Rep: Reputation: 2
Thanks, the lvm method looks promising but it seems to require a lot of configuring. So, for now I have decided to just make sdb5 a ntfs partition and use it in my windows system. I will get comfortable with the lvm setup and try later on. Thanks for the reply.
 
Old 09-12-2014, 10:24 AM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 11,041

Rep: Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619
Quote:
/dev/sdb3 shows extended and sdb5 shows Linux ext4 partition that I wanna merge together with sda3 into home.
If you look at the output, based on the information you posted, you would see that sda3 and sda5 are the same size. sda3 is an Extended partition which cannot hold data, sda5 is the first logical partition inside sda3. Run fdisk and look at the columns under Start and End for sda3 and sda5. Should be identical or nearly identical if the info you posted above was accurate.

Quote:
So, for now I have decided to just make sdb5 a ntfs partition and use it in my windows system.
Again, if you do that you will have formatted your /home partition and that's the end of it. If you had posted the actual contents of the /etc/fstab file we would know for sure but you didn't so this is based on what you said above. Also posting the actual output of the fdisk command would have been better. You might read a little about drives/partitions and formatting in Linux.
 
Old 09-13-2014, 04:31 AM   #5
moisespedro
Senior Member
 
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223

Rep: Reputation: 195Reputation: 195
I got the same impression yancek got. Before going any further post your /etc/fstab and fdisk/cfdisk output.
 
Old 09-13-2014, 06:51 AM   #6
Monk Tea
Member
 
Registered: Apr 2014
Location: New Delhi
Distribution: Slackware
Posts: 39

Original Poster
Rep: Reputation: 2
Sorry for not posting the actual output bcoz I'm running internet from my phone, as I'm having every sorts of problems configuring my wifi network in slackware 14.1. I was busy with another thread I started regarding wifi setup.

The sdb3 is an extended partition and sdb5 is the first logical drive inside it, and yea both are of same size, my Linux installation is in sda drive, with my sda3 mounted as home, and the sdb5( inside sdb3) is an unallocated space right now and I wanted to merge it under /home. And there is currently no data in the home, and I've already backed up data so if I have to reinstall its no problem. I'm aware I cant give the same mount point for two different partitions. So I think I will go to lvm, but I'm really stuck with wireless setup. It just doesn't work anyway. And so wasn't aware of the posts.
 
Old 09-13-2014, 06:49 PM   #7
psionl0
Member
 
Registered: Jan 2011
Distribution: slackware_64 14.1
Posts: 722
Blog Entries: 2

Rep: Reputation: 125Reputation: 125
It's easy if you subdivide your /home directory. For example, before you mount anything to that point run (for example)
Code:
mkdir /home/user1
mkdir /home/music
Then you can mount your drives separately.
Code:
mount /dev/sda3 /home/user1
mount /dev/sdb5 /home/music
BTW You don't mount extended partitions.
 
Old 09-14-2014, 08:56 AM   #8
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 11,041

Rep: Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619
Quote:
and the sdb5( inside sdb3) is an unallocated space right now
sda5 is a partition which you indicate you have formatted as ext4 so by definition, it is not unallocated space. Unallocated or free space is any space on a drive which has not been formatted and is not on any partition. From your posts, you currently have a separate /home partition on sda5. I'm not sure what you are trying to do, shrink the /home partition so you can create others?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Zero single partitions (not whole drives)? kikinovak Slackware 4 08-15-2012 08:42 AM
Partitions and home folder appears in two partitions Brycegmartin SUSE / openSUSE 1 03-24-2009 11:13 AM
Question on creating more partitions than default ones, i.e. /home,/root partitions casmac SUSE / openSUSE 1 12-20-2006 06:02 PM
how do I add partitions to drives that have Logical Volume (LVM) partitions? The MJ Linux - Software 5 08-17-2006 07:15 PM
Create software RAID partitions first, then create filesystem partitions on top of th stefanlasiewski Linux - Software 1 04-28-2004 05:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration