Announcement

Collapse
No announcement yet.

Recovering "bad" partitions

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Recovering "bad" partitions

    Now two weeks into Kubuntu and things are going great. I really love this OS. One thing that's been nagging at me, that I finally have time to look into. When first installing Kubuntu, I had a couple of botched installs on my 20gb hard drive. The drive also had WinXP, which I tried initially to make as a bootable partition, but things didn't go so well, so no more Win XP.

    The partition I am using now is roughly 14gb, but there are two other partitions I can see from Dolphin (about 2gb each) that I can't open...and give the error "HAL-storage-fixed-mount refused UID 1000" when I try. I'd like to be able to use the diskspace in these partitions. I've read thru a couple of posts about this error, but am still too newbie-ish to make heads or tails out of how partitioning works. I'm hoping someone can take a look at my partition info, and perhaps suggest a way to resolve this.

    **Output from: sudo fdisk -l
    Disk /dev/sda: 20.4 GB, 20416757760 bytes
    255 heads, 63 sectors/track, 2482 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0xea1aa9c7

    Device Boot Start End Blocks Id System
    /dev/sda1 2235 2482 1992060 83 Linux
    /dev/sda2 1 1848 14844028+ 83 Linux
    /dev/sda3 2115 2234 963900 5 Extended
    /dev/sda4 * 1849 2114 2136645 83 Linux
    /dev/sda5 2136 2234 795186 82 Linux swap / Solaris
    /dev/sda6 2115 2135 168619+ 82 Linux swap / Solaris

    Partition table entries are not in disk order

    **Output from: cat /etc/fstab
    # /etc/fstab: static file system information.
    #
    # <file system> <mount point> <type> <options> <dump> <pass>
    proc /proc proc defaults 0 0
    # /dev/sda2
    UUID=28d8be55-1f6a-4126-a0d0-e93c4e51249f / ext3 nouser,defaults,errors=remount-ro,atime,auto,rw,dev,exec,suid 0 1
    # /dev/sda5
    UUID=3b76ef97-eed1-463b-9549-755f7a9f3272 none swap sw 0 0
    /dev/scd0 /media/cdrom0 udf,iso9660 user,atime,noauto,rw,dev,exec,suid 0 0
    /dev/fd0 /media/floppy0 auto user,atime,noauto,rw,dev,exec,suid 0 0


    Thanks in advance!

    #2
    Re: Recovering &quot;bad&quot; partitions

    I'm far from an expert and pretty much a newbie myself in Kubuntu, but the first thing I would try is qtparted. It's a Partition Magic clone and will manipulate the HD partitions and format them for you. Then you just have to assign the mount points and create the mount points. You can find qparted under the "System" option in the KDE menu. qarted uses a graphical representation of the partitions and kets you manipulate them.

    Good Luck.

    Comment


      #3
      Re: Recovering &quot;bad&quot; partitions

      Let's address a few observations first.

      First, your sudo fdisk -l shows you have two swap partitions. This should be remedied - you only need one swap partition (it can be 'shared' with multiple Linux OS's)

      Second, your fstab shows that your root partition is on /dev/sda2 yet fdisk shows that /dev/sda4 is flagged 'bootable', so it would be a good idea to let us see what your /boot/grub/menu.lst file looks like.

      Also, paste the output of:
      Code:
      df -hT
      This additional information will aid in coming up with an action plan.
      Windows no longer obstructs my view.
      Using Kubuntu Linux since March 23, 2007.
      "It is a capital mistake to theorize before one has data." - Sherlock Holmes

      Comment


        #4
        Re: Recovering &quot;bad&quot; partitions

        /dev/sda2 is the partition I always boot into (as you might recall from a couple of my other posts you helped me with).

        Here is the df -hT output:

        Filesystem Type Size Used Avail Use% Mounted on
        /dev/sda2 ext3 14G 3.3G 11G 25% /
        varrun tmpfs 252M 136K 252M 1% /var/run
        varlock tmpfs 252M 0 252M 0% /var/lock
        udev tmpfs 252M 80K 252M 1% /dev
        devshm tmpfs 252M 0 252M 0% /dev/shm
        lrm tmpfs 252M 34M 218M 14% /lib/modules/2.6.22-14-generic/volatile
        /dev/sdb1 vfat 245M 88M 158M 36% /media/disk


        ...and here is my /boot/grub/menu.lst:

        # menu.lst - See: grub(8), info grub, update-grub(8)
        # grub-install(8), grub-floppy(8),
        # grub-md5-crypt, /usr/share/doc/grub
        # and /usr/share/doc/grub-doc/.

        ## default num
        # Set the default entry to the entry number NUM. Numbering starts from 0, and
        # the entry number 0 is the default if the command is not used.
        #
        # You can specify 'saved' instead of a number. In this case, the default entry
        # is the entry saved with the command 'savedefault'.
        # WARNING: If you are using dmraid do not use 'savedefault' or your
        # array will desync and will not let you boot your system.
        default 5

        ## timeout sec
        # Set a timeout, in SEC seconds, before automatically booting the default entry
        # (normally the first entry defined).
        timeout 5

        ## hiddenmenu
        # Hides the menu by default (press ESC to see the menu)
        #hiddenmenu

        # Pretty colours
        #color cyan/blue white/blue

        ## password ['--md5'] passwd
        # If used in the first section of a menu file, disable all interactive editing
        # control (menu entry editor and command-line) and entries protected by the
        # command 'lock'
        # e.g. password topsecret
        # password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
        # password topsecret

        #
        # examples
        #
        # title Windows 95/98/NT/2000
        # root (hd0,0)
        # makeactive
        # chainloader +1
        #
        # title Linux
        # root (hd0,1)
        # kernel /vmlinuz root=/dev/hda2 ro
        #

        #
        # Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

        ### BEGIN AUTOMAGIC KERNELS LIST
        ## lines between the AUTOMAGIC KERNELS LIST markers will be modified
        ## by the debian update-grub script except for the default options below

        ## DO NOT UNCOMMENT THEM, Just edit them to your needs

        ## ## Start Default Options ##
        ## default kernel options
        ## default kernel options for automagic boot options
        ## If you want special options for specific kernels use kopt_x_y_z
        ## where x.y.z is kernel version. Minor versions can be omitted.
        ## e.g. kopt=root=/dev/hda1 ro
        ## kopt_2_6_8=root=/dev/hdc1 ro
        ## kopt_2_6_8_2_686=root=/dev/hdc2 ro
        # kopt=root=UUID=ab942ec0-570f-496a-8267-fdafb8ba8e65 ro

        ## Setup crashdump menu entries
        ## e.g. crashdump=1
        # crashdump=0

        ## default grub root device
        ## e.g. groot=(hd0,0)
        # groot=(hd0,3)

        ## should update-grub create alternative automagic boot options
        ## e.g. alternative=true
        ## alternative=false
        # alternative=true

        ## should update-grub lock alternative automagic boot options
        ## e.g. lockalternative=true
        ## lockalternative=false
        # lockalternative=false

        ## additional options to use with the default boot option, but not with the
        ## alternatives
        ## e.g. defoptions=vga=791 resume=/dev/hda5
        # defoptions=quiet splash

        ## should update-grub lock old automagic boot options
        ## e.g. lockold=false
        ## lockold=true
        # lockold=false

        ## Xen hypervisor options to use with the default Xen boot option
        # xenhopt=

        ## Xen Linux kernel options to use with the default Xen boot option
        # xenkopt=console=tty0

        ## altoption boot targets option
        ## multiple altoptions lines are allowed
        ## e.g. altoptions=(extra menu suffix) extra boot options
        ## altoptions=(recovery) single
        # altoptions=(recovery mode) single

        ## controls how many kernels should be put into the menu.lst
        ## only counts the first occurence of a kernel, not the
        ## alternative kernel options
        ## e.g. howmany=all
        ## howmany=7
        # howmany=all

        ## should update-grub create memtest86 boot option
        ## e.g. memtest86=true
        ## memtest86=false
        # memtest86=true

        ## should update-grub adjust the value of the default booted system
        ## can be true or false
        # updatedefaultentry=false

        ## should update-grub add savedefault to the default options
        ## can be true or false
        # savedefault=false

        ## ## End Default Options ##

        title Ubuntu 7.10, kernel 2.6.22-14-generic
        root (hd0,3)
        kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=ab942ec0-570f-496a-826
        7-fdafb8ba8e65 ro quiet splash
        initrd /boot/initrd.img-2.6.22-14-generic
        quiet

        title Ubuntu 7.10, kernel 2.6.22-14-generic (recovery mode)
        root (hd0,3)
        kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=ab942ec0-570f-496a-826
        7-fdafb8ba8e65 ro single
        initrd /boot/initrd.img-2.6.22-14-generic

        title Ubuntu 7.10, memtest86+
        root (hd0,3)
        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 an existing
        # linux installation on /dev/sda1.
        title Ubuntu 7.10 (7.10) (on /dev/sda1)
        root (hd0,0)
        kernel /boot/vmlinuz-2.6.22-14-generic root=/dev/sda1
        savedefault
        boot


        # This entry automatically added by the Debian installer for an existing
        # linux installation on /dev/sda2.
        title Ubuntu 7.10, kernel 2.6.22-14-generic (on /dev/sda2)
        root (hd0,1)
        kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=28d8be55-1f6a-4126-a0d
        0-e93c4e51249f ro
        initrd /boot/initrd.img-2.6.22-14-generic
        savedefault
        boot


        # This entry automatically added by the Debian installer for an existing
        # linux installation on /dev/sda2.
        title Ubuntu 7.10, kernel 2.6.22-14-generic (recovery mode) (on /dev/s da2)
        root (hd0,1)
        kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=28d8be55-1f6a-4126-a0d 0-e93c4e51249f ro single quiet
        initrd /boot/initrd.img-2.6.22-14-generic
        savedefault
        boot


        # This entry automatically added by the Debian installer for an existing
        # linux installation on /dev/sda2.
        title Ubuntu 7.10, memtest86+ (on /dev/sda2)
        root (hd0,1)
        kernel /boot/memtest86+.bin
        savedefault
        boot

        Comment


          #5
          Re: Recovering &quot;bad&quot; partitions

          Originally posted by sbradley07
          /dev/sda2 is the partition I always boot into (as you might recall from a couple of my other posts you helped me with).
          Oh the memories of the young!

          As all of the listed partitions (sudo fdisk -l) are Linux, accessing any of them (except for the swaps of course) is a simple matter of including them in your fstab file. Given the information posted, editing your fstab file so that it looks like this:
          # /etc/fstab: static file system information.
          #
          # <file system> <mount point> <type> <options> <dump> <pass>
          proc /proc proc defaults 0 0
          # /dev/sda2
          UUID=28d8be55-1f6a-4126-a0d0-e93c4e51249f / ext3 nouser,defaults,errors=remount-ro,atime,auto,rw,dev,exec,suid 0 1
          /dev/sda1 /media/sda1 ext3 defaults 0 2
          /dev/sda4 /media/sda4 ext3 defaults 0 2
          # /dev/sda5
          UUID=3b76ef97-eed1-463b-9549-755f7a9f3272 none swap sw 0 0
          /dev/scd0 /media/cdrom0 udf,iso9660 user,atime,noauto,rw,dev,exec,suid 0 0
          /dev/fd0 /media/floppy0 auto user,atime,noauto,rw,dev,exec,suid 0 0
          and then running:
          Code:
          sudo mount -a
          should result in your being able to access the other two partitions.

          **ALWAYS MAKE A BACKUP OF ANY SYSTEM FILE BEFORE MAKING MODIFICATIONS**
          Windows no longer obstructs my view.
          Using Kubuntu Linux since March 23, 2007.
          "It is a capital mistake to theorize before one has data." - Sherlock Holmes

          Comment


            #6
            Re: Recovering &quot;bad&quot; partitions

            Oh the memories of the young!
            Be careful not to equate inexperience with youth...the next elected president will be the 10th in my lifetime

            I made the changes you suggested and it did not work. Right now, I'm logged in from a different location, so I don't have the exact output, though it said something like "could not mount device" and "device not found." I'll post the exact output when I get home. Thanks.

            Comment


              #7
              Re: Recovering &quot;bad&quot; partitions

              I was a bit off. Here's the actual results:

              :~$ sudo mount -a
              mount: mount point /media/sda1 does not exist
              mount: mount point /media/sda4 does not exist

              Comment


                #8
                Re: Recovering &quot;bad&quot; partitions

                Okay. Are both of these partitions (/dev/sda1 and /dev/sda4) 'empty' - contain no data? I'm going to guess 'yes.' In which case, as root, create the two 'mount points' under /media
                Code:
                cd /
                sudo mkdir media/sda1
                sudo mkdir media/sda4
                Then issue the sudo mount -a command and see if the two partitions don't become accessible.
                Windows no longer obstructs my view.
                Using Kubuntu Linux since March 23, 2007.
                "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                Comment


                  #9
                  Re: Recovering &quot;bad&quot; partitions

                  Ok, that worked. I can now access both...but they are definitely not empty. They seem to have the folder structure of a full installation (/bin, /boot, /etc, /lib, /usr and so on). Kind of makes sense since it took me three tries to finally get the install right (I can't quite remember but at least one time I started over because it looked like I made the partition too small).

                  They are both roughly 2gb in size. Can I just wipe out the files on these partitions to recoup the disk space? Or would that damage something?

                  Comment


                    #10
                    Re: Recovering &quot;bad&quot; partitions

                    If you know you don't need the data in the partitions, you can safely delete the contents. As both contain directories/files that are owned by 'root' you will want to delete the contents 'as root.'

                    The question of 'using this space' with the existing running OS requires some thought. You can 'expand' existing partitions 'to the right' (grow the length from the end) but you can't do so from the beginning - grow the partition to the left.
                    Windows no longer obstructs my view.
                    Using Kubuntu Linux since March 23, 2007.
                    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                    Comment


                      #11
                      Re: Recovering &quot;bad&quot; partitions

                      Using Windows parlance, I'm asking if I can use these partitions like a D: and E: drive.

                      Or, using your description of expanding 'to the right', can I expand my current working partition (/dev/sda2) to encompass the diskspace currently defined in these two "rogue" partitions? ...so that my current 14gb partition becomes a 18gb one...

                      Comment


                        #12
                        Re: Recovering &quot;bad&quot; partitions

                        You could expand /dev/sda2 into the space used by /dev/sda4 (GParted LiveCD would be the mechanism of choice) once that partition is cleaned out. However, if you wanted to utilize /dev/sda1 for /dev/sda2, that's problematic. IF the total space 'used' on /dev/sda2 is less than the total size of /dev/sda1, then it is possible to 'move' /dev/sda2 to /dev/sda1 (again, GParted LiveCD is the mechanism of choice for this). Planning is required. Editing of your fstab as well as your /boot/grub/menu.lst file is mandatory prior to rebooting after such a change, or your system isn't going to boot.
                        Windows no longer obstructs my view.
                        Using Kubuntu Linux since March 23, 2007.
                        "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                        Comment


                          #13
                          Re: Recovering &quot;bad&quot; partitions

                          I loaded up GParted and took a look at things. As you say, /dev/sd4 is really the only partition that I could expand into, however that partition is currently flagged as 'boot.' The Grub list used at system startup comes from that partition, and I have modified that (based on your help in another thread) to boot into /dev/sda2 by default.

                          In order to expand my sda2 partition to recover the disk space in /sda4, is it a matter of 1) changing sda2 to be the bootable partition instead of /sda4, 2) cleaning out the files in /sda4, and 3) use GParted to expand /sda2 in to the unused space?

                          I saw in GParted that I could right click to change the 'boot' flag...is there file I could edit to make that change? Finally, what changes would need to happen in the /sda2 menu.lst?

                          Comment

                          Working...
                          X