Announcement

Collapse
No announcement yet.

Drive Partition problem

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

  • oshunluvr
    replied
    #2: Those files are owned by root, so you have to be root to move them. In a terminal, type kdesudo dolphin and this will get you a root file manager

    #3: This is the correct response: "Command (m for help):". You would then type "m" for the list of commands, and use this program to delete and create partitions among other things. The instructions to do "x" will bring up the "Advanced" options, and then "f" will correct the partition number sequence. DON'T DELETE sdb1 until you have saved the files using step #2.

    A little basics about how partitioning and file systems work using Linux (w
    hen you use Windows, all of this is done, just without you knowing it or having any control over it):

    When you split up the space on a drive, that is called a partition. A partition cannot be accessed directly because the system doesn't know how you want it to do that. So we must create a filesystem. With Linux, you have many - dozens - of different filesystems you can choose from. Why you would choose one over the others has mostly to do with what you are going to store in the filesystem. For general purposes (and certainly for a beginner ) stick with ext2/4 as they are the most common. I recommend using ext4 except for small devices like thumb drives or for /boot partitions. For these use ext2 for /boot and ext2 or fat32/ntfs for thumb drives if you need windows compatibility.

    So to recap: a portion of space on a drive is a partition. On these partitions, we create filesystems. Files are stored in a filesystem - not on a partition.

    fdisk is a partitioning program. It does not create filesystems (also known as formatting). fdisk only manipulates drives at the partition system level. Once you created a partition, you must then create a filesystem on it so you can use it.

    mkfs (MaKe File System) is the command (actually a set of scripts) that creates the filesystems. We use mkfs.ext2 for ext2 and mkfs.ext4 for ext4. There are a series of options available you can list by typing mkfs.ext4 --help . One of these options is to set the UUID as I suggested in the previous post. To create swap partitions, the program is mkswap. You must have root privileges to use these programs, so you preface the commands with sudo: The command to format /dev/sdb1 with ext2 is sudo mkfs.ext2 /dev/sdb1 and so on. Also, the filesystem you are formatting or re-formatting must not be mounted for these to work. To unmount /boot, you would enter sudo umount /boot and to redo the swap partition the command is sudo swappoff --all

    The -U switch does not work using fdisk because fdisk does not create filesystems and therefore does not create UUIDs.

    Leave a comment:


  • Bumpalot
    replied
    SUMMARY OF SEQUENCES:
    Current kubuntu drive:
    Click image for larger version

Name:	Screenshot2.jpg
Views:	1
Size:	41.8 KB
ID:	640598
    Please excuse my lack of knowledge on this topic - am a newbie trying to learn the fundamentals!!
    NOTE: The previous snapshot was the original format before Fstab changed it.
    1. Open a terminal, type sudo blkid -s UUID /dev/sdb1. Write down or copy the current UUID.
    Done: UUID="38DC9DBDDC9D75BA"
    2. Copy contents of sdb1 (using Dolphin-Split screens)
    Copied to /Data Storage/Copy_of_sda1
    Unable to copy any System.map files (3) or vmlinuz****. Files (2) (Could not read)
    I AM STUCK HERE !

    After the above is completed, my interpretation of your excellent suggestions is as follows:
    3. run sudo fdisk /dev/sdb <<this returns Command (m for help): fdisk help f: unknown command.

    (and delete sdb1.
    Recreate sdb1 as a linux (rather than extended) partition (type 83),
    then do "x" and then "f" to correct partition order.
    4. Delete sdb4 (swap)
    5. Re-create sdb4 as an extended partition.
    6. Create swap as a logical partition.

    Then if you want to use the rest of your disk, you need only add more logical partitions.
    MY NOTE: Is the following switch for using fdisk ? If so what would the command be?
    Note that the -U switch works for mkswap just like it does for mkfs so you should do it the same way as above to regain the UUID and avoid having to edit fstab and/or grub.

    Leave a comment:


  • oshunluvr
    replied
    You messed up because you don't want sdb1 to be extended, correct? Well, I see several issues I would correct, but let's start with sdb1: Simple enough to copy the contents of sdb1 somewhere (thumb drive or other partition), delete and re-create sdb1, copy the files back. Once you have to delete and then re-create sdb1, the partitions will goes through a re-numbering, leaving them in the wrong order, but fdisk will correct them with the "f" command from the "x - experts only" menu.

    This should be able to be done without booting to a Live USB or CD, but you should have one handy just in case. Be aware that fstab and grub use UUID's to mount/select filesystems and when you re-format a partition, it gets a new UUID. If you create your new filesystem(s) using the terminal and mkfs.ext4, you can specify a particular UUID. Here's what I would do:

    1: open a terminal, type sudo blkid -s UUID /dev/sdb1. Write down or copy the current UUID.
    2: copy the entire contents of sdb1 somewhere.
    3: run sudo fdisk /dev/sdb and delete sdb1. recreate sdb1 as a linux (rather than extended) partition (type 83), then do "x" and then "f" to correct partition order. exit fdisk.
    4: run sudo fdisk -l and verify visually that your partitions are in the correct order before proceeding.
    5: run mkfs.ext2 -U <INSERT UUID HERE> /dev/sdb1 to create your new filesystem.
    6: copy the contents of sdb1 back to the new sdb1.

    This should work.

    The other problems I see are:

    #1: Why have a separate /boot partition at all? This used to be a common practice but is no longer recommend unless you are using a filesystem grub does not recognize or possible RAID or encryption. Copying the contents of sdb1 into the /boot partition on sdb2 and running update-grub should leave you bootable without sdb1 needed.

    #2: Why the reverse format selection? If you require or desire a separate /boot along with / and /home; /boot should be ext2 and / and /home should be ext4, not the other way around. ext4 offers some data loss protection and benefits. ext2 does not but operates with less reserved space and a bit quicker.

    #3: Using the MBR drive format with your current partitioning scheme will leave that unallocated 110GB unused forever. I suggest once you reformat sdb1 that you delete sdb4, re-create it as an extended partition, then recreate your swap as a logical partition. Then if you want to use the rest of your disk, you need only add more logical partitions. Note that the -U switch works for mkswap just like it does for mkfs so you should do it the same way as above to reain the UUID and avoid having to edit fstab and/or grub.

    Leave a comment:


  • Bumpalot
    started a topic Drive Partition problem

    Drive Partition problem

    Using kubuntu 13.10 on a 64 bit system, 8G memory

    Drive Partitions changed from original setup in Dec:
    Results of sudo fdisk -l at Jan 6
    Code:
    Disk /dev/sda: 120.0 GB, 120034123776 bytes
    255 heads, 63 sectors/track, 14593 cylinders, total 234441648 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: 0x3bd6013d
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *          63   130521087    65260512+   7  HPFS/NTFS/exFAT
    
    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: 0x0004a04a
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1            2046    10000383     4999169    5  Extended
    /dev/sdb2   *    10000384   209999871    99999744   83  Linux
    /dev/sdb3       209999872   409999359    99999744   83  Linux
    /dev/sdb4       409999360   410998783      499712   82  Linux swap / Solaris
    /dev/sdb5            2048    10000383     4999168   83  Linux
    
    Disk /dev/sdd: 2000.4 GB, 2000396746752 bytes
    255 heads, 63 sectors/track, 243201 cylinders, total 3907024896 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: 0x0003990f
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdd1   *          63  1851025364   925512651    7  HPFS/NTFS/exFAT
    /dev/sdd2      1851025365  3907007999  1027991317+   f  W95 Ext'd (LBA)
    /dev/sdd5      1851025428  3907007999  1027991286    7  HPFS/NTFS/exFAT
                                                                                
                                                                                    
    bumpy@bumpyputer:~$ blkid                                                                               
    /dev/sda1: UUID="38DC9DBDDC9D75BA" TYPE="ntfs"                                                          
    /dev/sdb2: UUID="0110cb19-48b1-49b1-95fa-a3cfeed1edf7" TYPE="ext2"                                      
    /dev/sdb3: UUID="1a76da42-45d6-4662-9870-1c759cc6c039" TYPE="ext2"                                      
    /dev/sdb4: UUID="b32b0388-d9c7-4b97-9de5-5794758b9071" TYPE="swap"                                      
    /dev/sdb5: UUID="3cc8acfc-f516-4946-91a7-1e079719ab00" TYPE="ext4"                                      
    /dev/sdd1: LABEL="Local Disk" UUID="185C5BAF5C5B8682" TYPE="ntfs"                                       
    /dev/sdd5: LABEL="Data Storeage" UUID="14FC9FECFC9FC700" TYPE="ntfs"
    Current fstab: Jan 6

    Code:
    # /etc/fstab: static file system information.
    #
    # Use 'blkid' to print the universally unique identifier for a
    # device; this may be used with UUID= as a more robust way to name devices
    # that works even if disks are added and removed. See fstab(5).
    #
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    # / was on /dev/sdb2 during installation
    UUID=0110cb19-48b1-49b1-95fa-a3cfeed1edf7 /               ext2    errors=remount-ro 0       1
    # /boot was on /dev/sdb5 during installation
    #UUID=3cc8acfc-f516-4946-91a7-1e079719ab00 /boot           ext4    defaults        0       2
    # /home was on /dev/sdb3 during installation
    UUID=1a76da42-45d6-4662-9870-1c759cc6c039 /home           ext2    defaults        0       2
    # swap was on /dev/sdb4 during installation
    UUID=b32b0388-d9c7-4b97-9de5-5794758b9071 none            swap    sw              0       0
    UUID=3cc8acfc-f516-4946-91a7-1e079719ab00	/boot	ext4	defaults	0	2
    Obviously I messed up on original partition creation – re /dev/sdb1!!

    Click image for larger version

Name:	Screenshot1.jpg
Views:	3
Size:	48.7 KB
ID:	648076

    Can I remove /dev/sdb1 partition (since it is booting from /dev/sdb2), without causing problems?
    Sure would like to get out of this mess without having to reinstall!!
    Your suggestions would be very welcome!

Users Viewing This Topic

Collapse

There are 0 users viewing this topic.

Working...
X