I just did a fresh install of Leap-15 onto a new disk.
I’m mounting my old Leap-42.3 disk as a second disk and want to delete unused system partitions.
Can I do this?
When I boot, the OS “sees” the old Leap-42.3 disk and offers it as a boot option, dev/sdb8
When looking at the second old disk with yast/partition, it appears as dev/sdb with sdb1, …, sdb6, and types of WDC-WDC…, Linux Native, Linux LVM, Extended, and swap.
Which of these may be deleted?
In the end I want to edit the partition with my data and make it bigger.
Does this make sense or am I flirting with disaster?
Use YaST’s partitioner. Delete the partitions on /dev/sdb , then create new ones as you like, incl desired mountpoints. After doing so, run YaST’s Bootloader module. It will detect the changes, and remove the 42.3 entries. Hit OK, reboot and done.
When I boot, the OS “sees” the old Leap-42.3 disk and offers it as a boot option, dev/sdb8
When looking at the second old disk with yast/partition, it appears as dev/sdb with sdb1, …, sdb6, and types of WDC-WDC…, Linux Native, Linux LVM, Extended, and swap.
Which of these may be deleted?
It depends which have data you wish to keep, which partition(s) you wish to enlarge. If you show us content of etc/fstab/ on the sdb8 partition and output from ‘gdisk -l /dev/sdb’ we should be able to make recommendations.
GPT fdisk (gdisk) version 1.0.1
Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: not present
***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory.
***************************************************************
Disk /dev/sdc: 3907029168 sectors, 1.8 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): 0C9BFB9A-DF7A-4F93-9447-53A4AE7146E1
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 3907029134
Partitions will be aligned on 8-sector boundaries
Total free space is 184590447 sectors (88.0 GiB)
Number Start (sector) End (sector) Size Code Name
1 2048 1026047 500.0 MiB 8300 Linux filesystem
5 1026050 1028095 1023.0 KiB 8E00 Linux LVM
6 185616384 3907028991 1.7 TiB 8300 Linux filesystem
I already deleted some partitions, like swap.
By right clicking properties, I’m pretty sure my data is on dev/sdc6.
This is the partition created by Leap 42.3 for user data, right?
Just delete dev/sdc1 and dev/sdc5, then run the bootloader?
Sure if it is not used and any partition in it are not being used you can remove it. But remember extended partitions are just containers for other partitions to get around the 4 partition limit on DOS partitioning and they them selves are not mounted but partition in them may be so be sure,
Maybe it would help if you remember an extended partition cannot be formatted. Instead of one filesystem, which is what all others are intended for, the extended holds definitions of logical partitions, one sector for each. It’s the logicals, minus the sectors allocated in making up the definitions, that actually use the space you see allocated to the extended.
“Extended File System” is what e.g. EXT2, EXT3 & EXT4 refer to, having nothing directly to do with partitioning.
The extended partition, unlike the logicals and other primaries, is a label for a virtual object that can contain directly no files or filesystem. It’s defined by the partitions it contains, or the partitions and freespace it contains, according to the way the particular partitioning tool presents it.
The extended partition lists only #5 and above because each “partition” is defined by one 16 byte block in a partition “table”. The MBR table contains 64 bytes, 4 entries entries maximum, so the next is logically the fifth, and named “logical”.
Q2) If I delete the extended, I also delete the useful data partition, right?
Yes, if using a partition tool that lets you. Smarter tools present the extended only by virtue of the logical partitions it does let you create, delete, move or resize, not letting you alter the extended directly in any way.
Q3) Why doesn’t sudo gdisk -l /dev/sdc list the extended file system?
It’s a presentation. Listing a partition that cannot host a filesystem directly serves mainly to confuse someone trying to understand MBR partitioning, why 2 and/or 3 and/or 4 might be absent.
My goal is to create a 3 disk system, disk-one for the OS, disk-two for my-personal-data, and disk-three as a backup.
I screwed up my 42.3 machine but still want to use that old disk as the disk-two, because it already has my-personal-data on it. I want to delete all the partitions on it except for my-personal-data, and then enlarge that partition to use the entire disk with a single partition.
I’m thinking about copying (rsyncing) my-personal-data to a disk, then partitioning-formatting-copying (rsyncing) my-personal-data back to the original disk. The problem is that the copying (rsyncing) NEVER goes smoothly. There’s always some issue, the system hangs or there’s a permission issue. I’m talking about 1Tb of data and ~5hours.
Doing a copy, followed by 1 or 2 rsyncs seems to be the best way. But I have no way to compare the disks so I don’t have 100% confidence that the data is getting moved without errors.
Anyway,...
Q1) How can I be sure that my-personal-data won't become inaccessible if I delete the extended partition?
Q2) Is there a directory to directory comparison tool with say an md5 checksum as the basis for comparison, not just dates and file sizes?
Type mount to see where all things ae mounted. Note the partition that hosts /home If it is a logical in the extended it is best not to delete the extended… fdisk -l will show you what is where. Note the beginning and end block number of each partition any that fall between the begin end blocks of the extended are logical in that extended. Generally any partition number above 5 are logical but that may not be written in stone and depends on the history of the disk’s partition creation so best to note start end block numbers.
You have a long nice story, but nor much hard data. So best is to provide some we can discuss. Please show
fdisk -l
and then add information about all the partitions there: what you think they are used for. And then explain what disks you want to use for in the future. Ther result will be that we can call names, like you can delet sdf7. or you can remove all from sde and then create sde1 with size …
Then I hope we all (inclusing you) will understand what we are talking about.
sda is my backup disk, with a new partition
sdb is the new V15 boot disk, with a new partition
sdc is the old 42.3 disk with my personal data, with the extended partition
I was away and I am not sure if you are still wrestling with this simple case.
First please always try to be very explicit in wording. You posted the fdisk -l listing, so now we all can see what is what. Then you should call the correct names. So not “the extended dtrive”, but “sdc2”. Then the can be no confusion about what you mean.
I assume we are talking about sdc:
Disk /dev/sdc: 1.8 TiB, 2000398934016 bytes, 3907029168 sectorsUnits: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x0000c861
Device Boot Start End Sectors Size Id Type
/dev/sdc2 1026048 3907028991 3906002944 1.8T f W95 Ext'd (LBA)
/dev/sdc5 185616384 3907028991 3721412608 1.8T 83 Linux
As sdc5 is a logical partition and thus part of the extended partition, which is sda2, you have first to remove sdc5, after that you can remove the now empty sdc2.
But you can do it all on one by using what I already told you 10 days ago in post #13 above.
Still assuming that there is NOTHING important on sdc and you want to go for a fresh start using sdc fror something.