Page 1 of 3 123 LastLast
Results 1 to 10 of 26

Thread: Can I expand the Ubuntu partition if it's mounted as a pseudo-device?

  1. #1
    Join Date
    Jun 2011
    Beans
    64

    Can I expand the Ubuntu partition if it's mounted as a pseudo-device?

    I installed Ubuntu as a guest OS in the Windows installation that came with my HP computer, by downloading and running the Windows installer for Ubuntu. It created a 30GB partition, but it seems this is actually a pseudo-device whose contents are physically within the Windows partition. From Ubuntu I see my Windows 7 files at /host. Using gparted I see only Windows partitions (the System, OS, and Recovery partitions at /dev/sda1, /dev/sda2, and /dev/sda3. respectively). Running df on the Ubuntu system, I see /host mounted on /dev/sda2, and / mounted on /dev/loop0.

    So I have several questions?

    1. Is there any way to expand the size of the pseudo-device on which / is mounted, so I can use more of the Windows partition for Ubuntu?

    2. I want to install VirtualBox, with Ubuntu as the host and Windows 7 as the guest. I want to follow the instructions here to create a raw disk in VB that points to the existing Windows partition, so I can boot Windows native or in the VM. Can that work with my installation configuration? I asked that question on the VirtualBox forum, but I'd like to also get an answer from an Ubuntu perspective.

    3. Do I need to install Ubuntu in its own partition to accomplish 1 and 2 above? If not, is there some other reason I might want to do that?

    I'm fairly new to Ubuntu, and have been running it for several months. I just downloaded and ran the Windows installer because it seemed like the easiest way to get Ubuntu in a dual boot configuration with Windows. But if I have an installation configuration that's going to limit what I can do in the future, I'd like to change it now, before I get even further along using the current installation.
    Last edited by MidnightJava; October 9th, 2011 at 05:16 AM.

  2. #2
    Join Date
    Jun 2006
    Location
    UK
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Can I expand the Ubuntu partition if it's mounted as a pseudo-device?

    Quote Originally Posted by MidnightJava View Post
    But if I have an installation configuration that's going to limit what I can do in the future, I'd like to change it now, before I get even further along using the current installation.
    I'll take this point first. If I was in your situation, I'd abandon the current Ubuntu system and start afresh with Ubuntu installed natively to its own partition. What you have is a wubi installation.

    https://wiki.ubuntu.com/WubiGuide

    https://help.ubuntu.com/community/Wubi

    It's a perfectly good way of using Ubuntu for a short while but, yes, it is limiting. If you do want to try to resize the Ubuntu pseudo-partition (the C:\ubuntu\disks\root.disk file), you could try this:

    https://wiki.ubuntu.com/WubiGuide#Ho...rtual_disks.3F

    As to your question about installing VirtualBox in Ubuntu, that is not a thing I would want to try in wubi. A wubi install runs significantly slower than a native installation and a guest system in VirtualBox runs slow anyway, so you'd be doubly disadvantaged. Added to which I doubt whether pointing the host Windows partition back to be the guest in VirtualBox would be doable. You would be closing a circle, which would be eccentric if nothing else.

    Last point. You have a Hewlett-Packard machine. HP have an irritating habit of using up the full complement of 4 primary partitions allowed in an mbr partition table, or at least with Windows 7 systems - although this doesn't appear to be the case from the information you've already posted. This needs to be dealt with if you want to install Linux to its own partition(s). Which version of Windows is installed? Also, from Ubuntu post the output of these terminal commands:

    Code:
    sudo fdisk -lu
    sudo blkid
    We'll get a better overview of your partition layout with that.
    Last edited by coffeecat; October 9th, 2011 at 09:36 AM. Reason: Re-phrased sentence.
    Ubuntu 20.04 Desktop Guide - Ubuntu 22.04 Desktop Guide - Forum Guide to BBCode - Using BBCode code tags

    Member: Not Canonical Team

    If you need help with your forum account, such as SSO login issues, username changes, etc, the correct place to contact an admin is here. Please do not PM me about these matters unless you have been asked to - unsolicited PMs concerning forum accounts will be ignored.

  3. #3
    Join Date
    Jun 2011
    Beans
    64

    Re: Can I expand the Ubuntu partition if it's mounted as a pseudo-device?

    Thanks for the explanation. You've confirmed my suspicions, and I'll install Ubuntu in its own partition. The HP came with Windows 7 Home Edition. I do only see the three partitions I mentioned. What do they usually install in the fourth partition?

    Here's the output of the two commands you requested I run. As you may assume from the label, the sdb device is my backup disk.

    Code:
    ubuntu:~$ sudo fdisk -lu
    
    Disk /dev/sda: 640.1 GB, 640135028736 bytes
    255 heads, 63 sectors/track, 77825 cylinders, total 1250263728 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x801f4319
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *        2048      206847      102400    7  HPFS/NTFS
    Partition 1 does not end on cylinder boundary.
    /dev/sda2          206848   637943807   318868480    7  HPFS/NTFS
    /dev/sda3      1224960000  1250260991    12650496    7  HPFS/NTFS
    
    Disk /dev/sdb: 320.1 GB, 320072933376 bytes
    255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0xaefbb026
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1              63   625142447   312571192+   b  W95 FAT32
    mal@ubuntu:~$ sudo blkid
    /dev/loop0: UUID="b48d1b04-84e2-432b-860c-e633291d463e" TYPE="ext4" 
    /dev/sda1: LABEL="SYSTEM" UUID="F8C4B13FC4B100C4" TYPE="ntfs" 
    /dev/sda2: LABEL="OS" UUID="36AA701CAA6FD6C1" TYPE="ntfs" 
    /dev/sda3: LABEL="HP_RECOVERY" UUID="6CEAF910EAF8D774" TYPE="ntfs" 
    /dev/sdb1: LABEL="BACKUP" UUID="7EF5-1DEE" TYPE="vfat" 
    ubuntu:~$

  4. #4
    Join Date
    Jun 2006
    Location
    UK
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Can I expand the Ubuntu partition if it's mounted as a pseudo-device?

    Quote Originally Posted by MidnightJava View Post
    The HP came with Windows 7 Home Edition. I do only see the three partitions I mentioned. What do they usually install in the fourth partition?
    You're lucky! Judging by the number of threads started about this and my own experience of a HP machine, you must have got hold of the only HP in the known Universe with Windows 7 and less than 4 partitions.

    The fourth partition would have been a tiny FAT32 one with the label HP_TOOLS. I simply copied the contents to my C: partition and deleted it.

    Quote Originally Posted by MidnightJava View Post
    Code:
    ubuntu:~$ sudo fdisk -lu
    
    Disk /dev/sda: 640.1 GB, 640135028736 bytes
    255 heads, 63 sectors/track, 77825 cylinders, total 1250263728 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x801f4319
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *        2048      206847      102400    7  HPFS/NTFS
    Partition 1 does not end on cylinder boundary.
    /dev/sda2          206848   637943807   318868480    7  HPFS/NTFS
    /dev/sda3      1224960000  1250260991    12650496    7  HPFS/NTFS
    
    Disk /dev/sdb: 320.1 GB, 320072933376 bytes
    255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0xaefbb026
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1              63   625142447   312571192+   b  W95 FAT32
    sda1 is your Windows 7 boot partition, sda2 the C: partition and sda3 the recovery partition. Your easiest option would be to shrink the sda2 C: partition and then create an extended partition in the freed space. You could then create as many logical partitions as you need in the extended. Linux is happy booting from a logical partition unlike Windows, and you could also create a NTFS data partition as a logical partition to be shared by the two OSs if you want. Windows will be happy with a logical data partition.

    If you need help with the partitioning, don't hesitate to post back. I'd advise you to use Windows' own Disk Management utility to shrink the C: partition (that's safer than using Gparted), but use Ubuntu's Gparted to create the extended/logical partitions. If you use Windows Disk Management there is a danger that it will convert all your partitions into dynamic ones, and then you'll be up a creek with just a leaf for a paddle as far as running Ubuntu is concerned.
    Ubuntu 20.04 Desktop Guide - Ubuntu 22.04 Desktop Guide - Forum Guide to BBCode - Using BBCode code tags

    Member: Not Canonical Team

    If you need help with your forum account, such as SSO login issues, username changes, etc, the correct place to contact an admin is here. Please do not PM me about these matters unless you have been asked to - unsolicited PMs concerning forum accounts will be ignored.

  5. #5
    Join Date
    Jun 2011
    Beans
    64

    Re: Can I expand the Ubuntu partition if it's mounted as a pseudo-device?

    Thanks. I did already shrink the Windows C: partition as far as I could. I should be able to shrink it further after I remove the Ubuntu pseudo-device. But I'll wait until I have Ubuntu installed along-side Windows. Then I'll remove wubuntu, shrink the Windows partition, and grow the Ubuntu partition. I did use the Windows utility to shrink the C: partition. It was nice, because it figured out for me how far I could shrink it, and helped me to see whether a defrag would help.

    I just went to the Ubuntu dowload page and saw that the 32-bit version is tagged as recommended. Is this actually preferable even though I have a 64-bit OS, or is it recommended just so people who don't know what they have will be good with the 32-bit version no matter what?

  6. #6
    Join Date
    Jun 2006
    Location
    UK
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Can I expand the Ubuntu partition if it's mounted as a pseudo-device?

    I missed that you had already shrunk the Windows partition - the output of fdisk was clear if I had read it properly!

    This business about the 32-bit version of Ubuntu being recommended on the ubuntu.com page is the big mystery. I guess your last thought is the right one. If you have a 64-bit processor and at least 2-3 GB RAM then I suggest you go for the 64-bit version.

    By the way, don't forget that you need more than one partition for Ubuntu, which is why you need to create an extended partition. Although you can use a swap file, the usual setup in Ubuntu is to have a separate swap partition.
    Ubuntu 20.04 Desktop Guide - Ubuntu 22.04 Desktop Guide - Forum Guide to BBCode - Using BBCode code tags

    Member: Not Canonical Team

    If you need help with your forum account, such as SSO login issues, username changes, etc, the correct place to contact an admin is here. Please do not PM me about these matters unless you have been asked to - unsolicited PMs concerning forum accounts will be ignored.

  7. #7
    Join Date
    Jun 2011
    Beans
    64

    Re: Can I expand the Ubuntu partition if it's mounted as a pseudo-device?

    I created an extended partition with three logical partitions: an ext2-formatted partition for Ubuntu data, a unix-swap-formatted partition for Ubuntu swap, and an NTFS-formatted partition for shared data.

    In the Ubuntu installation wizard, I did not choose the option "Install Ubuntu along-side Windows". Instead I chose "Something Other", assuming that would enable me to specify the partitions for data and swap directly.

    On the next wizard page, I selected the Ubuntu data partition for installation. There was a drop-down menu for "Device for boot loader installation", with available options: /dev/sda, /dev/sda1, /dev/sda2, /dev/sda3, /dev/sda5, /dev/sda6, /dev/sda7. I wasn't sure which to choose, and was concerned that if I chose the one that contains the current Windows boot loader, I'd over-write the current BCD. So I chose /dev/sda, since it refers to the entire disk, assuming the installer would choose the correct partition.

    When I clicked "Install", I got an error message " No root file system is defined. Please correct this from the partitioning menu." There was a column for mount point in the partition table presented by the wizard; but there were no values in it for any partition, and it was not editable.

    Did I take the wrong path when I chose "Something Other", or am I missing something else?

  8. #8
    Join Date
    Jun 2006
    Location
    UK
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Can I expand the Ubuntu partition if it's mounted as a pseudo-device?

    "Something else" is the correct option. I'm not quite sure what you mean by an ext2 for Ubuntu data. If you are going to have a NTFS partition for shared data between Windows and Ubuntu, you don't really need a data partition formatted with a Linux filesystem. Nevertheless, this seems to be what you tried to choose for installing Ubuntu to. Apart from the NTFS partition, the minimum partitions in your extended partition would be a swap partition and an ext4 partition for the Ubuntu root partition. The shorthand for a root partition is '/'.

    Assuming your ext2 partition is large enough, in the something else option, highlight it and click on 'change'. Choose ext4 for filesystem, it doesn't matter whether you re-format it or not if it's freshly created, and then in mountpoint choose '/'. My guess is that it was the last bit you omitted. You don't need to do anything with the swap partition you've created - the installer will detect and set that up automatically.

    Installing grub to /dev/sda is correct. Some grub code will go to the mbr replacing the Windows bootloader, and some is held in the Ubuntu root partition. You will be able to boot Windows from the grub menu. Don't worry that grub code overwrites the Windows mbr bootloader. If you ever need to revert your machine back to a Windows only one, it is easy to re-install the Windows code from a Windows 7 repair disc. By the way, if you haven't done so already, make a repair CD from within Windows. This is different from the HP recovery DVDs which you may already have made. If you type "repair" in the search box in Windows 7, the system will prompt you. It's also possible to re-install the equivament of the Windows bootloader from an Ubuntu live CD.

    I should have posted this link before. Much of it you will understand already but there's some useful stuff about partitioning for Ubuntu:

    https://help.ubuntu.com/community/HowtoPartition
    Ubuntu 20.04 Desktop Guide - Ubuntu 22.04 Desktop Guide - Forum Guide to BBCode - Using BBCode code tags

    Member: Not Canonical Team

    If you need help with your forum account, such as SSO login issues, username changes, etc, the correct place to contact an admin is here. Please do not PM me about these matters unless you have been asked to - unsolicited PMs concerning forum accounts will be ignored.

  9. #9
    Join Date
    Jun 2011
    Beans
    64

    Re: Can I expand the Ubuntu partition if it's mounted as a pseudo-device?

    OK, I was able to get Ubuntu installed in the partition I created. I didn't notice the right-click menu, which was what I needed to enter the mount point. I was just clicking on the partition table record. When I said Ubuntu Data partition, I should have said Ubuntu Root partition. I originally formatted it as ext2 because only ext2 and ext3 were mentioned in the gparted documentation. But I changed it to ext4 per your suggestion, and after entering the mount point I was able to do the installation.

    I was able to boot into Ubuntu. I saw the grub entries for Windows, but haven't verified booting into Windows yet. However, I thought I'd be able to boot into the previously-installed Ubuntu installation as well, but I don't see a grub entry for it. Is it possible to do that? If not, perhaps I can mount the pseudo-device /dev/loop0 from the new Ubuntu installation, and then grab the data that I'd like to keep, before removing the old Ubuntu installation. I didn't get a chance to try that before leaving the house today.

    I also have two related questions.

    1. From Ubuntu I was able to mount the shared partition I created. But I noticed that the backup drive device sdb was already mounted when I booted into Ubuntu. Is there something I should do in the partition table to cause the shared partition to be automatically mounted?

    2. How should I remove the old Ubuntu installation when I'm ready? I assume I could delete the C:\ubuntu\disks\root.disk file; but should I do something to the /dev/loop0 device as well? Or maybe there's a windows uninstaller for wubi. Didn't think about looking at that before leaving the house today as well.

  10. #10
    Join Date
    Jun 2006
    Location
    UK
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Can I expand the Ubuntu partition if it's mounted as a pseudo-device?

    Quote Originally Posted by MidnightJava View Post
    However, I thought I'd be able to boot into the previously-installed Ubuntu installation as well, but I don't see a grub entry for it. Is it possible to do that?
    Yes, but what I am about to tell you sounds weird. Select Windows from the grub menu that first appears. You will then get the white on black Windows bootloader menu for selecting either Windows or Ubuntu, where this Ubuntu is your wubi install. If you boot into this Ubuntu and then run update-grub, next time after the Windows boot menu you'll get yet another grub menu from which....

    Quote Originally Posted by MidnightJava View Post
    If not, perhaps I can mount the pseudo-device /dev/loop0 from the new Ubuntu installation, and then grab the data that I'd like to keep, before removing the old Ubuntu installation. I didn't get a chance to try that before leaving the house today.
    You can - the method is in the Ubuntu wiki article that I linked earlier. But probably easiest is to boot into the wubi Ubuntu and copy your files to your new NTFS data partition.

    Quote Originally Posted by MidnightJava View Post
    1. From Ubuntu I was able to mount the shared partition I created. But I noticed that the backup drive device sdb was already mounted when I booted into Ubuntu. Is there something I should do in the partition table to cause the shared partition to be automatically mounted?
    Already plugged in USB devices are automounted on bootup. Internal partitions are not by default, but are easily mounted with one mouse-click as you've discovered. The way to get internal partitions mounted on bootup is to add a line to the configuration file /etc/fstab. There are GUI utilities in the repositories for this but I would advise keeping them all at arm's length. They've all been unmaintained for years and are buggy. If you post the output of these two commands I can let you have a line for /etc/fstab:

    Code:
    sudo fdisk -lu
    sudo blkid
    Quote Originally Posted by MidnightJava View Post
    2. How should I remove the old Ubuntu installation when I'm ready? I assume I could delete the C:\ubuntu\disks\root.disk file; but should I do something to the /dev/loop0 device as well? Or maybe there's a windows uninstaller for wubi. Didn't think about looking at that before leaving the house today as well.
    You simply uninstall the wubi installation from Windows control panel as though you were uninstalling an application. The exact method is in the two links I provided earlier.
    Ubuntu 20.04 Desktop Guide - Ubuntu 22.04 Desktop Guide - Forum Guide to BBCode - Using BBCode code tags

    Member: Not Canonical Team

    If you need help with your forum account, such as SSO login issues, username changes, etc, the correct place to contact an admin is here. Please do not PM me about these matters unless you have been asked to - unsolicited PMs concerning forum accounts will be ignored.

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •