Partitions Revisited

I recently upgraded an HD from 80GB → 250GB. Formerly a partitoned Windows XP-only environment (75GB ntfs-C, 4.7GB FAT32-D), the new drive partitioned to:

/dev/sda2 14.68 GB (Windows XPD”)
/dev/sda1 90.00 GB (Windows XPC”)
/dev/sda3 128.2 GB (Extended, containing:
/dev/sda5 2.0 GB (Linux “swap”)
/dev/sda6 20.0 GB (Linux “/”)
/dev/sda7 106.2 GB (Linux “/home”) )

After openSUSE 11.2 (KDE) was installed, I realized that the “sda7” partition was somewhat ;):wink: abundant (only 276 MB used!!! ).

Is it possible to resize (downsize) the “sda7” without completely reinstalling 11.2 ? If it can be downsized, is there some magic tome as to how to proceed following “Partitioner” ?

A second, somewhat related, question: can I delete and reallocate a larger “swap” partition ? (The PC in question is getting a RAM boost to 2GB, and I seem to recall that the “swap” should be 2X total memory.

It is possible to downsize /home, but I would not suggest that, since you’re just starting.

If I were you, I’d leave it like this. /home/YOURUSERNAME is the place where you store your precious data and your configuration files. So, as soon as you start creating docs, putting your pix in the folders it will start to grow. Let’s simply say that the “/” partition is for your system, /home/YOURUSERNAME is for you.

Yes you can. But don’ forget to edit /etc/fstab accordingly before rebooting. However:

  • 2 GB should be enough
  • You can also use several swap partitions

Is it possible to resize (downsize) the “sda7” without completely reinstalling 11.2 ? If it can be downsized, is there some magic tome as to how to proceed following “Partitioner” ?

If you need more space you can downsize the partition using Yast’s Partitioner or Gparted which can be installed with Yast’s software module.

I prefer Gparted to Yast’s partitioner because it’s IMHO much more versatile and it’s easy to use because of its excellent GUI.

You can’t shrink the home partition while it is mounted; i.e. while you are logged in as yourself. You would have to either (a) download a live CD that has Gparted on it, like the makers live CD or Ubuntu or Knoppix --or-- log in as root and unmount the /home partition then shrink the home partition then log out straight away.

They say that logging in as root is a bad idea. I disagree with that, think the opinions a bit OTT (IMHO). I do advise new users generally to avoid it but when logging in as root to use caution, get in, do the job, get out.

And if you do downsize home, I recommend that first you backup any important data to a safe place.

If you need more space you can downsize the partition using Yast’s Partitioner or Gparted which can be installed with Yast’s software module.

I was entertaining a “shared” partition (Linux <–> Windows). I can access Windows (both NTFS and FAT32, hard and flash drives) from openSUSE Linux. However, I am at a loss on how to directly access Linuxext4” partitions from Windows. Ergo, a shared “FAT32” partition, similar to a “fixed” jump/flash drive, or, if feeling somewhat adventurous, a shared “NTFS” partition.

I prefer Gparted to Yast’s partitioner because it’s IMHO much more versatile and it’s easy to use because of its excellent GUI.

I have GParted on a UBUNTU Live CD (a copy is on an old desktop), and I agree: GParted is friendlier to use!:slight_smile:

You can’t shrink the home partition while it is mounted;

I assumed as much, and would not attempt such. I had thought to boot the LiveCD and work from that.

I have backed up all of my data (i.e.: that which I cannot reinstall from the openSUSE DVD.). I just wished to make certain that I could trim the 106 GB down to, say, 80-90 GB. Such a size is greater than currently used under Windows.

BTW, the existing Windows “D” partition contains the Windows installation and recovery material. I will, most likely, shrink that partition. However, I am not entertaining any sharing of same.

You can’t access ext4 from windows, forget it for a few years.

That’s a good plan, the shared NTFS partition. Don’t worry about using NTFS, it’s very well well handled in Linux. I’d shrink the partition using Ubuntu. Then I’d boot into windows and create the NTFS partition using windows partitioner, I don’t quite trust Gparted to make an NTFS partition equal to the revised version of ntfs that windows vista and window7 generate.

You can mount the partition, let’s say it’s sda8 for example, by creating a directory e.g. “shared” in your home at /home/yourname/shared and then put this line into fstab:

/dev/sda8    /home/yourname/shared   ntfs-3g    uid=yourname,gid=users,umask=0022    0 0

They’ll look and behave just like Linux files (permissions).

FFI on NTFS: HowTo Mount NTFS Filesystem Partition Read Write Access in openSUSE

That’s a good plan, the shared NTFS partition. Don’t worry about using NTFS, it’s very well well handled in Linux. I’d shrink the partition using Ubuntu. Then I’d boot into windows

The “GPartedUbuntu utility functioned as written … almost. After re-sizing the large “ext4” partition, and all appearing well, the subsequent re-boot failed, with something akin to “No boot device”. Now that the PC was unbootable from the hard drive, and realizing this might be an epic experience, I returned first to the Ubuntu LiveCD. “GParted” confirmed all was as it should be, though I was slowly becoming apprehensive on recovery.

The next step was to boot from the openSUSE 11.2 installation DVD, and attempt to “Repair Installed System”. This went well, except for noting that partition “sda7” (the “shrinkee”) was corrupt. The boot loader was recovered, sans any Windows entries. All attempts to recover same, as outlined here (“GRUB Boot Multiboot openSUSE Windows (2000, XP, Vista) using the Grub bootloader.”) proved fruitless.

As yet undaunted, and referring to copious notes, I edited the boot loader, adding the “Windows” entry (other, /dev/sda1), and Windows was recovered, intacto. openSUSE Linux looked a bit off, and was repaired. Unfortunately, “Windows” and “openSUSE” were in possesion of two (2) different partition layouts.

Windows perceived the full (pre-shrinking) “sda7”, with no unallocated space to create the NTFS partition. openSUSE partitions were correct in size and location, but perceived the missing 30GB as extended unknown.

Resolution came by returning to the UbuntuLiveCD” (the cause mortis of this tome), and installing Ubuntu 9.10. All installed OK (sigh!), the bootloader had all the correct partitions and entries, but it appeared ugly. (BTW: removing Ubuntu reverted to the post openSUSE-recovery state).

You can mount the partition, let’s say it’s sda8 for example, by creating a directory e.g. “shared” in your home at /home/yourname/shared and then put this line into fstab:

Not quite possible, as “sda8” is Ubuntu.

They’ll look and behave just like Linux files (permissions).

They certainly do, as they are Linux! :wink:

Now, the 64,000 euro question: How to I use YAST’s boot loader (or the install DVD) or ??? to rebuild the GRUB ? I do not mind having another Ubuntu system, but the boot loader needs some improvements. The 30GB of “Karmic Koala” is facing downsizing for my shared NTFS partition, though I would like a smoother process.

PS: Having backups of everything (Windows on a full separate HD) allowed this otherwise harrowing experience to actually be a rewarding learning experience.

The new partitioning is hard to follow. Can you boot to openSUSE and run these commands and post back here:

sudo /sbin/fdisk -l

and point out which partitions in the list house what operating systems

sudo cat /boot/grub/menu.lst

that will make your 64000 Q easier, because there are some pitfalls in meshing the new Ubuntu and openSUSE (+ windows) that are not a problem provided you don’t step into them.

The new partitioning is hard to follow. Can you boot to openSUSE and run these commands and post back here:

  1. Code:
sudo /sbin/fdisk -l

      and point out which partitions in the list house what operating systems

RESULT:

linux-np9z:~ # sudo /sbin/fdisk -l

Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x6260518e

Device Boot Start End Blocks Id System
/dev/sda1 1917 13665 94373842+ 7 HPFS/NTFS
/dev/sda2 1 1916 15390238+ c W95 FAT32 (LBA)
/dev/sda3 * 13666 30401 134431920 f W95 Ext’d (LBA)
/dev/sda5 13666 13927 2104483+ 82 Linux swap / Solaris
/dev/sda6 13928 16538 20972826 83 Linux
/dev/sda7 16539 26482 79875148+ 83 Linux
/dev/sda8 26483 30234 30137908+ 83 Linux
/dev/sda9 30235 30401 1341396 82 Linux swap / Solaris

Partition table entries are not in disk order

sda1 & sda2 are Windows/XP “C” and “D” respectively
sda3 is the entire “Extended”
sda5 (swap) sda6 (“/”) and sda7 (“/home”) are openSUSE
sda8 & sda9 are Ubuntu

N.B.> All three systems are functioning

Code:

sudo cat /boot/grub/menu.lst

RESULTS:

linux-np9z:~ # sudo cat /boot/grub/menu.lst

Modified by YaST2. Last modification on Mon Mar 8 17:10:27 EST 2010

THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader

Configure custom boot parameters for updated kernels in /etc/sysconfig/bootloader

default 0
timeout 8
##YaST - generic_mbr
gfxmenu (hd0,5)/boot/message
##YaST - activate

###Don’t change this comment - YaST2 identifier: Original name: linux###
title SUSE LINUX
root (hd0,5)
kernel /boot/vmlinuz root=/dev/disk/by-id/ata-WDC_WD2500BEVE-00WZT0_WD-WX11A10N3227-part6 repair=1 resume=/dev/disk/by-id/ata-WDC_WD2500BEVE-00WZT0_WD-WX11A10N3227-part5 splash=silent quiet showopts vga=0x314
initrd /boot/initrd

###Don’t change this comment - YaST2 identifier: Original name: windows###
title Windows
rootnoverify (hd0,0)
chainloader +1

###Don’t change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe – SUSE LINUX
root (hd0,5)
kernel /boot/vmlinuz root=/dev/disk/by-id/ata-WDC_WD2500BEVE-00WZT0_WD-WX11A10N3227-part6 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 x11failsafe vga=0x314
initrd /boot/initrd
linux-np9z:~ #

A further note regarding the entry “SUSE LINUX”. This was constructed by the openSUSE “Repair”, and is different from the prior (installed) entry. openSUSE boots and runs OK, although some curious messages are produced prior to the login panel. One noticeable word (as it flies by) is “deprecated”.

One noticeable word (as it flies by) is “deprecated”.

don’t worry about that.

Thanks on the “deprecated” message. I reviewed the boot logs and found no serious errors.

After the prior posting, I did a bit of digging. It seems that the UbuntuLiveCD” I used (for the “GParted” utility, and the subsequent install to recover) implemented a “GRUB 2” bootloader. Merged into the Ubuntu-created boot were the entries from openSUSE.

The Ubuntu boot loader (“/boot/grub/grub.cfg”) (currently) is:


#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if  -s /boot/grub/grubenv ]; then
  have_grubenv=true
  load_env
fi
set default="0"
if  ${prev_saved_entry} ]; then
  saved_entry=${prev_saved_entry}
  save_env saved_entry
  prev_saved_entry=
  save_env prev_saved_entry
fi
insmod ext2
set root=(hd0,8)
search --no-floppy --fs-uuid --set c9596f4f-3c86-4ff6-a8dd-ad67e5aeb3ad
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=640x480
  insmod gfxterm
  insmod vbe
  if terminal_output gfxterm ; then true ; else
    # For backward compatibility with versions of terminal.mod that don't
    # understand terminal_output
    terminal gfxterm
  fi
fi
if  ${recordfail} = 1 ]; then
  set timeout=-1
else
  set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/white
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.31-20-generic" {
        recordfail=1
        if  -n ${have_grubenv} ]; then save_env recordfail; fi
	set quiet=1
	insmod ext2
	set root=(hd0,8)
	search --no-floppy --fs-uuid --set c9596f4f-3c86-4ff6-a8dd-ad67e5aeb3ad
	linux	/boot/vmlinuz-2.6.31-20-generic root=UUID=c9596f4f-3c86-4ff6-a8dd-ad67e5aeb3ad ro   quiet splash
	initrd	/boot/initrd.img-2.6.31-20-generic
}
menuentry "Ubuntu, Linux 2.6.31-20-generic (recovery mode)" {
        recordfail=1
        if  -n ${have_grubenv} ]; then save_env recordfail; fi
	insmod ext2
	set root=(hd0,8)
	search --no-floppy --fs-uuid --set c9596f4f-3c86-4ff6-a8dd-ad67e5aeb3ad
	linux	/boot/vmlinuz-2.6.31-20-generic root=UUID=c9596f4f-3c86-4ff6-a8dd-ad67e5aeb3ad ro single 
	initrd	/boot/initrd.img-2.6.31-20-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic" {
        recordfail=1
        if  -n ${have_grubenv} ]; then save_env recordfail; fi
	set quiet=1
	insmod ext2
	set root=(hd0,8)
	search --no-floppy --fs-uuid --set c9596f4f-3c86-4ff6-a8dd-ad67e5aeb3ad
	linux	/boot/vmlinuz-2.6.31-14-generic root=UUID=c9596f4f-3c86-4ff6-a8dd-ad67e5aeb3ad ro   quiet splash
	initrd	/boot/initrd.img-2.6.31-14-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode)" {
        recordfail=1
        if  -n ${have_grubenv} ]; then save_env recordfail; fi
	insmod ext2
	set root=(hd0,8)
	search --no-floppy --fs-uuid --set c9596f4f-3c86-4ff6-a8dd-ad67e5aeb3ad
	linux	/boot/vmlinuz-2.6.31-14-generic root=UUID=c9596f4f-3c86-4ff6-a8dd-ad67e5aeb3ad ro single 
	initrd	/boot/initrd.img-2.6.31-14-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
	linux16	/boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
	linux16	/boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Microsoft Windows XP Home Edition (on /dev/sda1)" {
	insmod ntfs
	set root=(hd0,1)
	search --no-floppy --fs-uuid --set 5cb4d28eb4d269d2
	drivemap -s (hd0) ${root}
	chainloader +1
}
menuentry "Windows NT/2000/XP (on /dev/sda2)" {
	insmod fat
	set root=(hd0,2)
	search --no-floppy --fs-uuid --set 423b-2bdf
	drivemap -s (hd0) ${root}
	chainloader +1
}
menuentry "SUSE LINUX (on /dev/sda6)" {
	insmod ext2
	set root=(hd0,6)
	search --no-floppy --fs-uuid --set ea1183f8-5bb5-46f3-a5e9-357997e3e399
	linux /boot/vmlinuz root=/dev/disk/by-id/ata-WDC_WD2500BEVE-00WZT0_WD-WX11A10N3227-part6 repair=1 resume=/dev/disk/by-id/ata-WDC_WD2500BEVE-00WZT0_WD-WX11A10N3227-part5 splash=silent quiet showopts vga=0x314
	initrd /boot/initrd
}
menuentry "Failsafe -- SUSE LINUX (on /dev/sda6)" {
	insmod ext2
	set root=(hd0,6)
	search --no-floppy --fs-uuid --set ea1183f8-5bb5-46f3-a5e9-357997e3e399
	linux /boot/vmlinuz root=/dev/disk/by-id/ata-WDC_WD2500BEVE-00WZT0_WD-WX11A10N3227-part6 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 x11failsafe vga=0x314
	initrd /boot/initrd
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

Now, for conjecture, if I used the openSUSE bootloader (either YAST or the install DVD’s “Repair Installed System”) to build a “GRUB Legacy” boot loader, and manually entered (via “add”) the corresponding ("sda8 and “sda9”) Ubuntu entries, the boot info in either the MBR or the extended partition would correctly reflect the actual partition allocations. The benefit of said action(s) would be lost whenever Ubuntu decided to update the boot loader.

Such action(s) leaves only one (1) problem. If I use “GParted” (again) to delete the two Ubuntu partitions, will I again lose the MBR, and have to repeat this process ? :\

Additionally, the Windows partition map now correctly reflects each of the current partitions, although Windows cannot calculate usage info for “ext4” partitions (known deficiency, no problem).

Apologies for the ramble, but this is actually making sense! (Must be late-evening euphoria … :wink: )

BTW: I have files with images of the Windows partition map(s), and other information, but it seems I am not (yet) permitted to “attach” such to posts. How might I gain such permissions ?

It appears thet the bootloader contains entries for windows and openSUSE. Just add this entry to add in a boot for Ubuntu:

#Don’t change this comment - YaST2 identifier: Original name: none# title Ubuntu 9.10 booting via symlinks
root (hd0,7)
kernel /vmlinuz root=/dev/sda8 ro quiet splash
initrd /initrd.img

Put it after any of the others e.g. after the first openSUSE

reference: HowTo Multiboot Ubuntu from openSUSE using the GRUB bootloader

PS I wouldn’t lightly shrink the utility partition, at least do a defrag if you must.

BTW: I have files with images of the Windows partition map(s), and other information, but it seems I am not (yet) permitted to “attach” such to posts. How might I gain such permissions ?

Just double checked that. You can’t post those files. They have to be linked from a hosting server e.g. imageshack

It appears thet the bootloader contains entries for windows and openSUSE. Just add this entry to add in a boot for Ubuntu:

#Don’t change this comment - YaST2 identifier: Original name: none# title Ubuntu 9.10 booting via symlinks
root (hd0,7)
kernel /vmlinuz root=/dev/sda8 ro quiet splash
initrd /initrd.img

Put it after any of the others e.g. after the first openSUSE

Attempting the above via YAST seemed to work … almost. Apparently, the boot loader was not re-written, so I booted the openSUSE install DVD, used “Repair Installed System” (which, in turn, found the updated GRUB list), and that re-wrote the actual boot records (MBR and “extended partition”).

All is now well, with the proper GRUB (openSUSE’s :slight_smile: ), Windows safely esconced, and a Ubuntu 9.10 system sitting nicely also. All three systems recognize the same partition maps, and openSUSE and Ubuntu both recognize and can access the Windows NTFS and FAT32 partitions.

PS I wouldn’t lightly shrink the utility partition, at least do a defrag if you must.

By “utility partition”, are you referring to the Windows “D” (installation/recovery) volume, or the Ubuntu partition (which I had mentioned for downsizing) ? The Windows “D” partition was formerly a 4.70 GB/2.01GB(used) before the hard-drive cloning, and is doubly backed up. I checked the drive map, and it is totally packed, so downsizing should be no problem. If, however, you were referring to the Ubuntu partition, that is easily re-built.

I appreciate your caution, as I treat that Windows partition most carefully.

Thanks for your assistance. All is in order on this PC (except for an annoying Ubuntu problem (fresh install, NO SOUND!!! :X). The various installation issues with openSUSE have been resolved, one by one, except for the ATI Radeon driver on another PC. That might have to wait (rotfl! !

Another happy ending…

Hi,

There is a great tool available to create and resize partitions. It is available as a linux live cd called Parted Magic (only 70MB). Try it out, it works wonders.

henkasdf