View previous topic :: View next topic |
Author |
Message |
scsichen n00b
Joined: 10 Jun 2014 Posts: 9
|
Posted: Mon Nov 10, 2014 4:42 pm Post subject: [Solved]Is need fstrim to all subvolume of btrfs on SSD |
|
|
I install gentoo on an SSD and use btrfs, pls see below
Code: | mount |grep btrfs|grep rootlv
cat /etc/fstab |grep btrfs|grep rootlv
/dev/ssdvg/rootlv / btrfs defaults,noatime,compress=lzo,ssd,nobarrier,space_cache,subvol=root 0 0
/dev/ssdvg/rootlv /home/scsi/usr btrfs defaults,noatime,compress=lzo,ssd,nobarrier,space_cache,subvol=scsissd/usr 0 0
/dev/ssdvg/rootlv /home/scsi/vm btrfs defaults,noatime,compress=lzo,ssd,nobarrier,nodatacow,space_cache,subvol=scsissd/vm 0 0
|
I decide use fstrim instead of mout with discard
when I fstrim on them, they all return same size
Code: | for fs in / /home/scsi/usr /home/scsi/usr ; do fstrim -v $fs; done
/: 3 GiB (3189985280 bytes) trimmed
/home/scsi/usr: 3 GiB (3189985280 bytes) trimmed
/home/scsi/usr: 3 GiB (3189985280 bytes) trimmed |
Should I need to trim all subvolume or just trim one of them?
another quesion is every time i fstrim btrfs mount point. They alway return same size and never to zero
Code: | su:acernb ~ # fstrim -v /
/: 3 GiB (3189985280 bytes) trimmed
su:acernb ~ # fstrim -v /
/: 3 GiB (3189985280 bytes) trimmed |
but on ext4. after fstrim, it can reach zero.
Code: | su:acernb bin # fstrim -v /boot
/boot: 91 MiB (95364096 bytes) trimmed
su:acernb bin # fstrim -v /boot
/boot: 0 B (0 bytes) trimmed |
How can I fix it?
thank a lot _________________ scsi
Last edited by scsichen on Tue Nov 11, 2014 2:22 am; edited 1 time in total |
|
Back to top |
|
|
Ant P. Watchman
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Mon Nov 10, 2014 7:17 pm Post subject: |
|
|
The btrfs numbers are all equal between subvolumes because they share the same storage area. Think of it like a chroot.
You should only need to run fstrim once per physical device, not per logical filesystem.
Not sure about the last question, the fstrim manpage says btrfs's unchanging output for -v is expected though. ext4 may be doing something more clever. |
|
Back to top |
|
|
scsichen n00b
Joined: 10 Jun 2014 Posts: 9
|
Posted: Tue Nov 11, 2014 1:58 am Post subject: |
|
|
Ant P. wrote: | The btrfs numbers are all equal between subvolumes because they share the same storage area. Think of it like a chroot.
You should only need to run fstrim once per physical device, not per logical filesystem.
Not sure about the last question, the fstrim manpage says btrfs's unchanging output for -v is expected though. ext4 may be doing something more clever. |
Thank you for your answer. It's help a lot for me _________________ scsi |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|