# Linux partitioning queries.Separate home partition



## shady_inc (Jan 9, 2008)

Ok..So after using Ubuntu so long, I have decided to make it my primary OS.So, I want to merge some more space into the Ubuntu partition.Can Gparted do the job.??
Also I would like to have a separate home partition and came across this this tutorial for the same.What should be the ideal size for a home partition.??In future Iif I install a new distro [I have a opensuse 10.3 dvd and I am itching to try it out. ], will ubuntu and opensuse access the same home partition without any issues.??

Reagards,
shady_inc


----------



## praka123 (Jan 9, 2008)

^u can share same /home for different distros.also,I will say a  separate /home is a must if u r gonna have lot of stuff which u randomly download(torrents?) and delete and again fills!.make sure ur /home is around 20GB if space is not a problem,else stick with a >6GB

gparted cannot merge freespace.it needs formatted partition.also u cannot be so sure of gparted merging partitions!
Best a Luck a!
*and,if at all ur gonna use gparted,always try the ubuntu/gparted livecd!dont use from installed ubuntu*


----------



## shady_inc (Jan 9, 2008)

praka123 said:


> ^u can share same /home for different distros.also,I will say a  separate /home is a must if u r gonna have lot of stuff which u randomly download(torrents?) and delete and again fills!.make sure ur /home is around 20GB if space is not a problem,else stick with a >6GB
> 
> gparted cannot merge freespace.it needs formatted partition.also u cannot be so sure of gparted merging partitions!
> Best a Luck a!
> *and,if at all ur gonna use gparted,always try the ubuntu/gparted livecd!dont use from installed ubuntu*


For home partition, I will stick with 7-8 gb.
By LiveCD, you mean installing Gparted in Ubuntu liveCD and not using Gparted LiveCD, right.??


----------



## praka123 (Jan 9, 2008)

^either ubuntu cd(ur install cd) to boot into live environment;make sure none of ur hdd partitions are mounted in livecd session(*sudo umount /media/**) or use gparted livecd(is available) the same way!.


----------



## shady_inc (Jan 9, 2008)

praka123 said:


> ^either ubuntu cd(ur install cd) to boot into live environment;make sure none of ur hdd partitions are mounted in livecd session(*sudo umount /media/**) or use gparted livecd(is available) the same way!.


Ok..Thanks.Will do the partitioning job tomorrow and post back the results.
Cheers.!!
shady_inc.


----------



## NucleusKore (Jan 9, 2008)

Check this post to enable multimedia without adding repositories. You can add the repositories later to make any updates if required.


----------



## shady_inc (Jan 10, 2008)

I created the new home partition of 5 gb successfully.I even added a line in 
/etc/fstab to automount it.But I can't see the new partition under  computer:///.This is what I get on doing sudo fdisk -l 

```
poisonblack@poisonblack-desktop:~$ sudo fdisk -l

Disk /dev/sda: 40.0 GB, 40016019456 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x37233722

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1714    13767673+   7  HPFS/NTFS
/dev/sda2            2372        4864    20025022+   f  W95 Ext'd (LBA)
/dev/sda3            1715        2371     5277352+  83  Linux
/dev/sda5            2433        4211    14289817+   7  HPFS/NTFS
/dev/sda6            2372        2432      489919+  82  Linux swap / Solaris
/dev/sda7            4212        4864     5245191   83  Linux

Partition table entries are not in disk order
poisonblack@poisonblack-desktop:~$
```
These are the contents of /etc/fstab

```
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
# /dev/sda3
UUID=79d490c0-3c66-458e-818c-23c02fcd7d70 /               ext3    defaults,errors=remount-ro 0       1
# /dev/sda1
UUID=86F420E8F420DBE5 /media/sda1     ntfs    defaults,umask=007,gid=46 0       1
# /dev/sda5
UUID=D0E06424E0641350 /media/sda5     ntfs    defaults,umask=007,gid=46 0       1
# /dev/sda6
UUID=2c783cbb-544e-4e07-be8e-8b4e056d066b none            swap    sw              0       0
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto,exec 0       0
[COLOR="Red"]/dev/sda7 /home ext3 nodev,nosuid 0 2[/COLOR]
```
Red line is added by me.


----------



## infra_red_dude (Jan 10, 2008)

You won't see it in computer:///. To access that partition goto /home; since you've mounted it as home. Make sure it shows free space pertaining to 5GB one. Did you move your files from prev. /home to sda7 and then mounted sda7 as home?


----------



## shady_inc (Jan 10, 2008)

infra_red_dude said:


> You won't see it in computer:///. To access that partition goto /home; since you've mounted it as home. Make sure it shows free space pertaining to 5GB one. Did you move your files from prev. /home to sda7 and then mounted sda7 as home?


Oh...ok.So the partition will still be visible as Home folder.Yes, It does have ~5 gb free space.Thanks.
And yeah, I first moved over files from /home to new partition before mounting it.
One more thing.My partitions are listed as sda1,sda3 etc. while the link I gave in first post has partitions listed as hda1,hda3 etc.Why this difference of *s* and *h*.??


----------



## ray|raven (Jan 10, 2008)

sda means you have a SATA harddisk, while hda means you have an IDE harddisk.

Regards,
ray


----------



## praka123 (Jan 10, 2008)

@shady:ur partn order had changed as from the fdisk -l o/p.for fixing that(if interested) just run below sequences when max mounts are umounted.
sudo fdisk /dev/sda ;then press "x" enter;enter "f";enter "w" and enter "q" to quit  run a sudo partprobe for a immediate change if possible


----------



## infra_red_dude (Jan 10, 2008)

To be precise the *s* in sda is not SATA but for SCSI. All SATA drives are mounted under SCSI emulation, while the *h* in hda refers to PATA drives.


----------



## shady_inc (Jan 10, 2008)

praka123 said:


> @shady:ur partn order had changed as from the fdisk -l o/p.for fixing that(if interested) just run below sequences when max mounts are umounted.
> sudo fdisk /dev/sda ;then press "x" enter;enter "f";enter "w" and enter "q" to quit  run a sudo partprobe for a immediate change if possible


Just followed the instructions.But I think I messed up somewhere. Now I get an Error 17 right when the Grub is loading.So, I am using LiveCD atm.Any solution to this error.??
Contents of fdisk -l

```
ubuntu@ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 40.0 GB, 40016019456 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x37233722

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1714    13767673+   7  HPFS/NTFS
/dev/sda2            1715        2371     5277352+  83  Linux
/dev/sda3            2372        4864    20025022+   f  W95 Ext'd (LBA)
/dev/sda5            2372        2432      489919+  82  Linux swap / Solaris
/dev/sda6            2433        4211    14289817+   7  HPFS/NTFS
/dev/sda7            4212        4864     5245191   83  Linux
```
Contents of /boot/grub/menu.lst.Only part I thought was important.

```
## ## End Default Options ##

title        Ubuntu 7.10, kernel 2.6.22-14-generic
root        (hd0,2)
kernel        /boot/vmlinuz-2.6.22-14-generic root=UUID=79d490c0-3c66-458e-818c-23c02fcd7d70 ro quiet splash locale=en_US
initrd        /boot/initrd.img-2.6.22-14-generic
quiet

title        Ubuntu 7.10, kernel 2.6.22-14-generic (recovery mode)
root        (hd0,2)
kernel        /boot/vmlinuz-2.6.22-14-generic root=UUID=79d490c0-3c66-458e-818c-23c02fcd7d70 ro single
initrd        /boot/initrd.img-2.6.22-14-generic

title        Ubuntu 7.10, memtest86+
root        (hd0,2)
kernel        /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title        Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title        Windows NT/2000/XP (loader)
root        (hd0,0)
savedefault
makeactive
chainloader    +1
```

Just checked Gparted and it's showing entire partition as unallocated.;( .


----------



## infra_red_dude (Jan 10, 2008)

The Fdisk from the livecd indicates that there is linux installed. However to confirm that its not an empty partition just run: df -h command or use the Disk free space utiltiy. It shouldn't be fully empty. 

After ensuring that edit your <linux part>/boot/grub/menu.lst

Now change all the lines with "root (hd0,2)" to "root (hd0,1)". This should set things rite


----------



## praka123 (Jan 10, 2008)

@shady:i am sorry  .what those commands did was fixing the partition order!nothing happened;just that partition numbering may got fixed.the problem is most prolly due to the uuid menace.
inorder to restore the grub,try below commands from ubuntu livecd session:
1.mount ur / partition(/dev/sda2) in /mnt directory and edit /boot/grub/menu.lst as below for fix.
in detail,
open terminal in livecd,then run:

```
sudo mount /dev/sda2 /mnt
```
now press ALT+F2 to get run dialog and run :

```
gksudo gedit /mnt/boot/grub/menu.lst
```
and edit *title        Ubuntu 7.10, kernel 2.6.22-14-generic* as below and save and exit:

```
title        Ubuntu 7.10, kernel 2.6.22-14-generic
root        (hd0,1)
kernel        /boot/vmlinuz-2.6.22-14-generic [B]root=/dev/sda2[/B] ro quiet splash locale=en_US
initrd        /boot/initrd.img-2.6.22-14-generic
quiet
```
now,if grub is totally missing in ur boot,u need to run below commands from livecd terminal. 
guessing ubuntu hdd /dev/sda3 is mounted on /mnt,

```
sudo chroot /mnt /bin/bash
```
now run:

```
grub-install /dev/sda
```
thats it!.again reboot and try:
also,when in a ubuntu session from harddisk,u can run "vol_id"  or "blkid" commands to find the corresponding UUID's of /dev/sda3 and edit the /boot/grub/menu.lst .


----------



## infra_red_dude (Jan 10, 2008)

If I am correct the uuids won't change even if the partition number changes; changes only if the partition is restructured. Anyways, try these things shady; I'm sure everything'll be fine


----------



## Flake (Jan 10, 2008)

infra_red_dude said:


> To be precise the *s* in sda is not SATA but for SCSI. All SATA drives are mounted under SCSI emulation, while the *h* in hda refers to PATA drives.


Hi !

This is not true any more. Latest kernels ( 2.6.22 onwards ) have updated IDE drivers. These drivers assign *s*dx name to all types of HDs. There isn't any *h*dx now.


----------



## praka123 (Jan 10, 2008)

^still old pata drivers are on use dude!yeah,the change was from 2.6.19 onwards to be precise.
@shady:report back


----------



## shady_inc (Jan 10, 2008)

I followed that procedure of changing (hd0,2) to (hd0,1) [and in the process also learnt that (hd0,0)=sda1, (hd2,3)=sdc4 ..... GR8.], but it didn't solve the problem.Now trying praka123's solution.
@ praka123: No need to be sorry for it mate.Atleast the partition table has been fixed now.


----------



## infra_red_dude (Jan 10, 2008)

@shady
Don't worry you'll soon haf your system back 

@ghost
Yes, the s in sda is still for SCSI. PATA drives are assigned sda1, sdax coz even they are loaded thru the SCSI emulation driver by certain kernels. As a matter of fact my laptop uses a seagate ide pata hdd and I use Ubuntu GG with 2.6.22 kernel and the partitions are still mounted as hda1/hda2 etc. by default for me. So if the kernel module mounts the disk in SCSI emulation whether its SATA or PATA it will be named as sda otherwise its hda.


----------



## Flake (Jan 10, 2008)

praka123 said:


> ^still old pata drivers are on use dude!yeah,the change was from 2.6.19 onwards to be precise.


Hi !

Old Driver?? Could you post any link friend? Latest kernels are using new drivers that why *h*dx are *s*dx now.


----------



## praka123 (Jan 10, 2008)

^I know in the aspect that the old pata drivers from andrew morton which is still used in pata hdd's(afaik and i have a sata only!) and most of the ide cd/dvd drives!i know that new drivers are there which will make ur pata device having  /dev/scd0 or /dev/sr0 {libata} instead of /dev/hda;still old pata drivers are which is working fine for my dvd writer 

the source is my own custom kernel dosth ;correct me if am wrong.
edit: source 
*kernelnewbies.org/Linux_2_6_19#head-cdcbaa9c1b476decdc064e0a75d23d1328b1ddce


----------



## shady_inc (Jan 10, 2008)

@ praka123: I followed all the steps in your post.Rebooted once after editing menu.lst file.But the error was still there.So, I got back to liveCD terminal and mounted sda2 [you had mentioned sda3 in your post, but I guess that was typo,right.??] in /mnt directory.Now, on doing the final step i.e.:

```
grub-install /dev/sda
```
I get following:

```
ubuntu@ubuntu:~$ sudo mount /dev/sda2 /mnt
ubuntu@ubuntu:~$ sudo chroot /mnt /bin/bash
root@ubuntu:/# grub-install /dev/sda
[COLOR=RED]/dev/sda: Not found or not a block device.[/COLOR]
```


----------



## praka123 (Jan 10, 2008)

again i was confused 

OK.unmount as "sudo umount /mnt" and then run in terminal "sudo grub-install /dev/sda" and reply back.


----------



## shady_inc (Jan 10, 2008)

praka123 said:


> OK.unmount as "sudo umount /mnt" and then run in terminal "sudo grub-install /dev/sda" and reply back.


No, I still get:

```
Could not find device for /boot: Not found or not a block device.
```


----------



## praka123 (Jan 10, 2008)

^shady:check ur /mnt  directory for (/dev/sda2) ur ubuntu hdd install be there already(use nautilus file manager for viewing)!also,check the hdd ubuntu /boot directory for all files intact like vmlinuz-xx,initrd.img etc.

and BTW,/dev/sda7 is ur /home partn?.


----------



## shady_inc (Jan 10, 2008)

praka123 said:


> ^shady:check ur /mnt  directory for (/dev/sda2) ur ubuntu hdd install be there already(use nautilus file manager for viewing)!also,check the hdd ubuntu /boot directory for all files intact like vmlinuz-xx,initrd.img etc.
> 
> and BTW,/dev/sda7 is ur /home partn?.


Yup, I can access all my ubuntu HDD files in /mnt folder.The /boot directory contains:
*img90.imageshack.us/img90/6602/screenshotbootfilebrowset7.png [60 kb image]
And, yes sda7 is my new home partition.

EDIT: I need to go offline now.Will check back the problem status and for some help here tomorrow.Thanks for all the help till now.


----------



## Flake (Jan 10, 2008)

I would suggest you to boot up from SuperGRUB CD and select '_Fix Linux Boot Loader (GRUB)_' option. It will detect conf files of GRUB and re-install it. 
In case, it doesn't work, we will have to look somewhere else.

BTW, how did you copy files of _/home_ folder to new partition? Did you retain permissions? I mean, did you use _-a_ option with _cp_ command?


----------



## praka123 (Jan 10, 2008)

^u meant *img90.imageshack.us/my.php?image=screenshotbootfilebrowset7.png

now in the livecd session,in mounted ubuntu partition, *edit ur /etc/fstab as follows to add ur / and /boot:*

```
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
[B]# /dev/sda2
/dev/sda2 /               ext3    defaults,errors=remount-ro 0       1
proc            /proc           proc    defaults        0       0

# /dev/sda1
UUID=86F420E8F420DBE5 /media/sda1     ntfs    defaults,umask=007,gid=46 0       1
# /dev/sda5
UUID=D0E06424E0641350 /media/sda5     ntfs    defaults,umask=007,gid=46 0       1
# /dev/sda6
UUID=2c783cbb-544e-4e07-be8e-8b4e056d066b none            swap    sw              0       0
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto,exec 0       0
[COLOR=Red]/dev/sda7 /home ext3 nodev,nosuid 0 2[/COLOR]
```

OK.I think it is time for to set grub natively!
unmount ur hdd ubuntu partition as above(sudo umount /dev/sda2)
in livecd,open a terminal,run 

```
sudo su -
```
and in *"#"* prompt,
*run "grub" to get  "grub>" prompt*
then in grub>,
do :

```
root (hd0,1)
```
then;

```
setup (hd0)
```

try and reply asap dude!

*EDITED fstab!*


----------



## shady_inc (Jan 11, 2008)

^^Hey, that worked.Thanks a Lot to everyone.!! .Now I can proceed with the OpenSUSe [or any other distro] installation.Woohoo.!!


----------



## praka123 (Jan 11, 2008)

Pheww!thank Jesus! solved!


----------

