[SOLVED] Re-partitioning: regarding UUID, bootable flag and changing mountpoint
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Re-partitioning: regarding UUID, bootable flag and changing mountpoint
Hello.
I'm going to re-partition the harddrive to allow for dual-booting, and create separate data and home partitions that are shared between the two distributions. This is the first time I do anything like this, and I need some help.
I think I've figured out most of it but there are some questions I've been unable to find answers to:
1. Will shrinking /dev/sda1 change its UUID?
/dev/sda1 is bootable and contains Debian /.
/etc/fstab is defined by UUID. If it changes, I won't be able to boot into Debian to edit fstab and run update-grub. And I need to run update-grub after booting into /dev/sda1 (all the partitioning is to be done from a SystemRescueCD when it's unmounted), creating a sort of catch-22.
2. If shrinking /dev/sda1 destroys it, could it destroy the whole partition table?
3. Should a chainloaded Slackware root (on a logical partition) be bootable?
Grub2 is on the MBR.
LILO will be on the superblock of /dev/sda8 (the Slackware root partition), and LILO will be chainloaded from Grub2.
The Slackware installer says if LILO is on a root partition's superblock, then that partition must be bootable. But does this apply when /dev/sda1 (Debian root) is already bootable, and Grub2 is already on the MBR?
I read somewhere that only BIOS cares about the bootable flag. That should mean that once Grub2 is loaded, it can chainload LILO, which in turn will load Slackware, regardless if /dev/sda8 is bootable or not. Is that correct?
4. About changing the mountpoint of /home to /mnt/data
After doing all of this (see Information, below) I have to boot into Debian again and tell Debian to mount /home (/dev/sda6) at /mnt/data (and /dev/sda7 at /home).
I know how to change the entries in fstab. Is that it, or do I also have to run update-grub and update-initramfs (or anything else)?
The /home partition is currently on /dev/sda6. I want it to be mounted in /mnt/data instead.
I'm going to make a new /home partition on /dev/sda7.
The only dangerous operation that I have to do in GParted is shrinking /dev/sda1, and then I can (hopefully) just restart the computer and boot into Debian like before.
I figured this is the safest approach, since I won't have to resize the 240 GB partition that contains all my stuff.
I'm going to re-partition the harddrive to allow for dual-booting, and create separate data and home partitions that are shared between the two distributions. This is the first time I do anything like this, and I need some help.
I think I've figured out most of it but there are some questions I've been unable to find answers to:
gparted is very good, but you can ameliorate all your fears by taking decent backups - before you start screwing with partitions.
1) no
2) no
3) it had better be. But it (and linux boot-loaders in general) doesn't need a boot flag.
4) just changing fstab should be sufficient.
update-grub may be required, and should be run, but is independent of any fstab/mountpoint changes.
a shared home ?. Whoa. Not on (any of) my systems. Get them backups ready.
3) it had better be. But it (and linux boot-loaders in general) doesn't need a boot flag.
If you need a boot flag on one of your partitions can be hardware dependent. I spent a whole day after re-organizing the partitions and installing a fresh system on my laptops harddisk with trouble-shooting (it just did not want to boot, no matter what I tried), until I realized that this machine refused to boot from a harddisk that does not contain a partition with boot flag. Not surprisingly it didn't care at all which partition was flagged, it just wanted to have that flag.
Quote:
update-grub may be required, and should be run, but is independent of any fstab/mountpoint changes.
update-grub: to run that that is only required if (as the name says) you want to update the bootloader configuration. So it is not needed when you change partitions not involved in the boot process.
Quote:
a shared home ?. Whoa. Not on (any of) my systems. Get them backups ready.
+1 for that. A shared /home will work if you set up different user-names on different distros. If you use the same username this may end in some really weird behavior of your applications, especially if the versions of the same application are far appart, which is to be expected if this is Debian 6 and you intend to install Slackware 14.
3. Should a chainloaded Slackware root (on a logical partition) be bootable?
There is no need to install LILO at all.
Your debian grub2's os-prober will pick slackware up.
Worst case you would have to create a /boot/grub/ directory containing a simple menu.lst file such as
where /boot/vmlinuz-linux and /boot/initramfs-linux.img are symbolic links to your kernel and initrd respectively
Or you could edit the menu.lst file each time you update your kernel, although this would require you to boot into debian and update-grub for the new kernel to show up in grub2 ( this requirement is why I use the above symlink approach.)
EDIT: alternatively, you could add a custom menu entry to Debian's grub for your Slackware kernels ( which is probably not the easy route, but it will work) https://help.ubuntu.com/community/Grub2/CustomMenus
Last edited by andrewthomas; 10-06-2012 at 07:50 PM.
Reason: added custom menu entry option
After you shrink /dev/sda1 you will have unpartitioned space outside your extended partition. You will also have to re-size your extended partition to include the space that your shrink provided.
The shared home is going to contain one user per distribution, and only configuration files. You are correct TobiGSD, it's Debian 6 + Slackware 14 -- the two best distributions.
Quote:
There is no need to install LILO at all. Your debian grub2's os-prober will pick slackware up. Worst case you would have to create a /boot/grub/ directory containing a simple menu.lst file such as
I know but I want to see the LILO screen. Chainloading seems easy to set up, and I probably have to do it in the future anyway. In /etc/grub.d/40_custom:
Code:
menuentry "Slackware" {
set root=(hd0,8)
chainloader +1
}
And in /etc/lilo.conf:
Code:
other = /dev/sda1
label = Debian
I don't have a menu.lst. Isn't that for Grub legacy?
Quote:
After you shrink /dev/sda1 you will have unpartitioned space outside your extended partition. You will also have to re-size your extended partition to include the space that your shrink provided.
I didn't know that. I thought free space could be allocated anywhere. In that case I may as well shrink the 240 GB partition too, and leave 38 GB for future BSD installs among the primary partitions.
That means it would be useless to shrink the swap partition, since it's right before the huge 240 GB partition, unless I move it 1 GB to the "left". Since it has 70+ GB on it, it'll probably take hours and I'll get a power outage in the middle of it. Not worth it.
Just thought I should update this to say how it went, and for future searchers.
Everything worked. Other than Slackware changing the UUID of the swap partition (even though it was already formatted as Linux-swap), so Debian couldn't find it, there were no problems. And this was trivial to fix: just blkid and update the value in fstab.
6 MiB couldn't be allocated at the end of the extended partition -- maybe due to rounding to cylinders, or perhaps it has something to do with fdisk -l reporting a "+" after the block count on the shrunken partition. All the data is intact though, and both systems work fine.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.