Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Solved] btrfs subvolume target installation

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
User avatar
bester69
Posts: 2072
Joined: 2015-04-02 13:15
Has thanked: 24 times
Been thanked: 14 times

[Solved] btrfs subvolume target installation

#1 Post by bester69 »

Hi,
How can i install debian filesystem over a subvolume btrfs with debian's CD installation?

I tried to mount subvolume in /target directory as i usaully do with sparky distro (debian based on), but the wizard installation automatic unmount the subvolume just before to proceed with the files copy installation..and it copies all files in the / (main subvolume).

I wanted something like that:

Code: Select all

mount -t btrfs -o subvolid=xxx /dev/sda1 /target
so, the installation process, use the subvolume xxx for installation.


thanks.
Last edited by bester69 on 2017-04-12 17:03, edited 1 time in total.
bester69 wrote:STOP 2030 globalists demons, keep the fight for humanity freedom against NWO...

User avatar
bester69
Posts: 2072
Joined: 2015-04-02 13:15
Has thanked: 24 times
Been thanked: 14 times

Re: btrfs subvolume target installation

#2 Post by bester69 »

I had to apply some tweaks, to get my goal:


I had previouslly created two btrfs subvolumes:
/home
/rootsys (Here, i wanted to put inside debian target installation)

0-I installed all together (the file system next to subvolumes) in the same parent level.

1- After syste, installation, I created a volume snaphot to put into it that installation:
cd /target
or
mount -t btrfs -o subvolid=0 /dev/sda1 /mnt

Code: Select all

btrfs subvolume delete /rootsys
btrfs subvolume snapshot ./ /rootsys
2- Clean/delete root installation outside subvolumes:

Code: Select all

mv /home .home
mv /rootsys .rootsys
rm -rf / (delete installation files outside snapshot rootsys)
mv .home /home
mv .rootsys /rootsys
3- Install Grub pointing to subvolume system (rootsys):

Code: Select all

mount --bind /dev /rootsys/dev
mount --bind /dev/pts /rootsys/dev/pts
mount --bind /proc /rootsys/proc
mount --bind /sys /rootsys/sys
chroot /rootsys
grub-install /dev/sda
update-grub
4- Editing fstab pointing to home subvolume:
btrfs subvolume list / (get ID subvolume home (649) for using in fstab)

Code: Select all

UUID=5a261bc5-1828-4588-b9a7-beb5f78a20e5	/	btrfs	defaults	0	1
UUID=5a261bc5-1828-4588-b9a7-beb5f78a20e5	/home/user/ btrfs subvolid=649  0 0
bester69 wrote:STOP 2030 globalists demons, keep the fight for humanity freedom against NWO...

User avatar
pylkko
Posts: 1802
Joined: 2014-11-06 19:02

Re: btrfs subvolume target installation

#3 Post by pylkko »

Were you using the stable installer or does not even the RC one support btrfs install straight out-of-the-box?

User avatar
bester69
Posts: 2072
Joined: 2015-04-02 13:15
Has thanked: 24 times
Been thanked: 14 times

Re: btrfs subvolume target installation

#4 Post by bester69 »

pylkko wrote:Were you using the stable installer or does not even the RC one support btrfs install straight out-of-the-box?
I used testing netinst-distro,
Hi pylkko, thanks for ans.

It let you to pick a btrfs partition, but it doesnt let you to choose a subvolume in that partition, so i found it kind of extrange. So i came here to see if i was missleading something.
bester69 wrote:STOP 2030 globalists demons, keep the fight for humanity freedom against NWO...

User avatar
pylkko
Posts: 1802
Joined: 2014-11-06 19:02

Re: btrfs subvolume target installation

#5 Post by pylkko »

maybe bug report it?

User avatar
bester69
Posts: 2072
Joined: 2015-04-02 13:15
Has thanked: 24 times
Been thanked: 14 times

Re: btrfs subvolume target installation

#6 Post by bester69 »

pylkko wrote:maybe bug report it?
I think, that's part of the wizard debian standard installation. there should be something in partition stage menu, when you choose a btrfs partition, you shoud be able to choose a subvolume.

Anyways not a big problem, now that i know i can snaphot the root installation into a subvolume.
bester69 wrote:STOP 2030 globalists demons, keep the fight for humanity freedom against NWO...

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: [Solved] btrfs subvolume target installation

#7 Post by Head_on_a_Stick »

I don't know about the Debian installer but I have just installed Debian stretch to a btrfs formatted partiton (/dev/sda8 in this case, mutatis mutandis) in a multiboot laptop with a simple custom (flat) layout using this sequence from a "live" ISO image:

Code: Select all

# mkfs.btrfs /dev/sda8
# mount /dev/sda8 /mnt
# btrfs subvolume create /mnt/stretch
# btrfs subvolume create /mnt/home
# umount -R /mnt
# mount -o subvol=stretch,compress=lzo /dev/sda8 /mnt
# mount -o subvol=home,compress=lzo /dev/sda8 /mnt/home
# debootstrap stretch /mnt http://cdn-fastly.deb.debian.org/debian
Then chroot into the system and configure it as per https://www.debian.org/releases/jessie/ ... 03.html.en

Pro tip: for the system clock, use this to set UTC:

Code: Select all

# hwclock --systohc
This will create the /etc/adjtime template file ;)

EDIT: be sure to set the custom mount options correctly in /etc/fstab before rebooting into the installed system; for my system it would be:

Code: Select all

/dev/sda8 / btrfs rw,compress=lzo,space_cache,subvol=stretch 0 0
/dev/sda8 /home btrfs rw,compress=lzo,space_cache,subvol=home 0 0
deadbang

User avatar
bester69
Posts: 2072
Joined: 2015-04-02 13:15
Has thanked: 24 times
Been thanked: 14 times

Re: [Solved] btrfs subvolume target installation

#8 Post by bester69 »

Head_on_a_Stick wrote:I don't know about the Debian installer but I have just installed Debian stretch to a btrfs formatted partiton (/dev/sda8 in this case, mutatis mutandis) in a multiboot laptop with a simple custom (flat) layout using this sequence from a "live" ISO image:

Code: Select all

# mkfs.btrfs /dev/sda8
# mount /dev/sda8 /mnt
# btrfs subvolume create /mnt/stretch
# btrfs subvolume create /mnt/home
# umount -R /mnt
# mount -o subvol=stretch,compress=lzo /dev/sda8 /mnt
# mount -o subvol=home,compress=lzo /dev/sda8 /mnt/home
# debootstrap stretch /mnt http://cdn-fastly.deb.debian.org/debian
Then chroot into the system and configure it as per https://www.debian.org/releases/jessie/ ... 03.html.en

Pro tip: for the system clock, use this to set UTC:

Code: Select all

# hwclock --systohc
This will create the /etc/adjtime template file ;)

EDIT: be sure to set the custom mount options correctly in /etc/fstab before rebooting into the installed system; for my system it would be:

Code: Select all

/dev/sda8 / btrfs rw,compress=lzo,space_cache,subvol=stretch 0 0
/dev/sda8 /home btrfs rw,compress=lzo,space_cache,subvol=home 0 0
I take note of it, thanks a lot.
bester69 wrote:STOP 2030 globalists demons, keep the fight for humanity freedom against NWO...

Post Reply